Skip to content

Commit

Permalink
Support partitioning of hybrid boot disks
Browse files Browse the repository at this point in the history
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: rhinstaller/anaconda#5298
  • Loading branch information
poncovka committed Nov 24, 2023
1 parent 793ec72 commit 03a4deb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions blivet/devices/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 03a4deb

Please sign in to comment.