From 03a4debbbaf1e5f63673725ea957082783b4b138 Mon Sep 17 00:00:00 2001 From: Vendula Poncova Date: Thu, 23 Nov 2023 16:24:36 +0100 Subject: [PATCH] Support partitioning of hybrid boot disks Anaconda needs to be able to create hybrid boot disks. For example: clearpart --all --initlabel --disklabel=gpt part prepboot --size=4 --fstype=prepboot part biosboot --size=1 --fstype=biosboot part /boot/efi --size=100 --fstype=efi part /boot --size=1000 --fstype=ext4 --label=boot part / --grow --fstype xfs However, this kickstart snippet is not working with two or more disks. The bootloader-related partitions should be all created on the disk the computer will boot from, but Blivet does that only for platform -specific partitions. The rest of them are created on any disk with enough space. It looks like this can be easily fixed by setting the same weight to all of these partitions regardless of the current platform. See: https://github.com/rhinstaller/anaconda/pull/5298 --- blivet/devices/partition.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py index cfb287415..7667e7ce4 100644 --- a/blivet/devices/partition.py +++ b/blivet/devices/partition.py @@ -454,24 +454,19 @@ def _get_weight(self): # now we have the weights for varying mountpoints and fstypes by platform weight = 0 + if self.format.mountable and self.format.mountpoint == "/boot": weight = 2000 elif (self.format.mountable and self.format.mountpoint == "/boot/efi" and - self.format.type in ("efi", "macefi") and - arch.is_efi()): + self.format.type in ("efi", "macefi")): weight = 5000 - elif arch.is_x86() and self.format.type == "biosboot" and not arch.is_efi(): + elif self.format.type in ("biosboot", "appleboot", "prepboot"): weight = 5000 elif self.format.mountable and arch.is_arm(): # On ARM images '/' must be the last partition. if self.format.mountpoint == "/": weight = -100 - elif arch.is_ppc(): - if arch.is_pmac() and self.format.type == "appleboot": - weight = 5000 - elif arch.is_ipseries() and self.format.type == "prepboot": - weight = 5000 return weight