diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-04-25 23:27:30 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-04-25 23:27:30 -0500 |
commit | 5df1abdb743ac71986cabe8c76dcd9a0f75e44da (patch) | |
tree | 3aaa931a60b67df85f5062fe1c689675a73dffa0 | |
parent | 4f6ebb22bad530c08bc27c13e8171bdd19dab8fd (diff) | |
download | horizon-5df1abdb743ac71986cabe8c76dcd9a0f75e44da.tar.gz horizon-5df1abdb743ac71986cabe8c76dcd9a0f75e44da.tar.bz2 horizon-5df1abdb743ac71986cabe8c76dcd9a0f75e44da.tar.xz horizon-5df1abdb743ac71986cabe8c76dcd9a0f75e44da.zip |
Qt UI: Fix partition count for APM disklabel
The APM disklabel includes a meta partition for the partition map
itself. This is always counted by parted as a partition, and is *not*
considered to be a metadata partition. We therefore need to start our
partitioning at #2 on APM, not #1.
Closes: #376
-rw-r--r-- | CHANGELOG.rst | 14 | ||||
-rw-r--r-- | ui/qt5/horizonwizard.cc | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7afcb34..b944410 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,19 @@ * **A. Wilcox**, documentation writer * **Contributors**, code :Copyright: - © 2019-2023 Adélie Linux and contributors. + © 2019-2024 Adélie Linux and contributors. + + + +0.9.9 (2024-??-??) +================== + +Qt UI +----- + +* The Qt UI now counts APM partition map partitions when creating APM + disklabels, fixing a long-standing bug when installing to an empty disk + on PowerPC Macintosh systems. diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index 298cd15..2872eb6 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -400,7 +400,8 @@ QString nameForPartitionOnDisk(const std::string &dev, int part) { /*! Determine the correct disk label based on the target platform. */ QStringList eraseDiskForArch(const std::string &raw_disk, HorizonWizard::Arch arch, - HorizonWizard::Subarch subarch) { + HorizonWizard::Subarch subarch, + int *start) { const auto disk = QString::fromStdString(raw_disk); switch(arch) { @@ -412,6 +413,7 @@ QStringList eraseDiskForArch(const std::string &raw_disk, case HorizonWizard::ppc64: /* Complicated */ switch(subarch) { case HorizonWizard::ppc64_PowerMac: + (*start)++; return {QString{"disklabel %1 apm"}.arg(disk)}; case HorizonWizard::ppc64_PowerNV: return {QString{"disklabel %1 gpt"}.arg(disk)}; @@ -620,7 +622,7 @@ QString HorizonWizard::toHScript() { int start = 1; if(erase) { - lines << eraseDiskForArch(chosen_disk, arch, subarch); + lines << eraseDiskForArch(chosen_disk, arch, subarch, &start); } else { /* This branch will be taken when "use available space" is back. */ Q_ASSERT(false); |