Skip to content

Commit d76f4a0

Browse files
authored
Fix boot partition regression (#1942)
* Fix boot partition regression * Fix spelling
1 parent 69c37e7 commit d76f4a0

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

archinstall/lib/disk/device_model.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,20 +789,22 @@ def get_efi_partition(self) -> Optional[PartitionModification]:
789789
"""
790790
Similar to get_boot_partition() but excludes XBOOTLDR partitions from it's candidates.
791791
"""
792-
fliltered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
793-
return next(fliltered, None)
792+
filtered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
793+
return next(filtered, None)
794794

795795
def get_boot_partition(self) -> Optional[PartitionModification]:
796796
"""
797797
Returns the first partition marked as XBOOTLDR (PARTTYPE id of bc13c2ff-...) or Boot and has a mountpoint.
798798
Only returns XBOOTLDR if separate EFI is detected using self.get_efi_partition()
799799
"""
800800
if efi_partition := self.get_efi_partition():
801-
fliltered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
801+
filtered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
802+
if boot_partition := next(filtered, None):
803+
return boot_partition
804+
return efi_partition
802805
else:
803-
fliltered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
804-
805-
return next(fliltered, None)
806+
filtered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
807+
return next(filtered, None)
806808

807809
def get_root_partition(self, relative_path: Optional[Path]) -> Optional[PartitionModification]:
808810
filtered = filter(lambda x: x.is_root(relative_path), self.partitions)

archinstall/lib/installer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,11 @@ def _add_systemd_bootloader(
726726
# TODO: Ideally we would want to check if another config
727727
# points towards the same disk and/or partition.
728728
# And in which case we should do some clean up.
729-
bootctl_options = [
730-
f'--esp-path={efi_partition.mountpoint}' if efi_partition else '',
731-
f'--boot-path={boot_partition.mountpoint}' if boot_partition else ''
732-
]
729+
bootctl_options = []
730+
731+
if efi_partition and boot_partition != efi_partition:
732+
bootctl_options.append(f'--esp-path={efi_partition.mountpoint}')
733+
bootctl_options.append(f'--boot-path={boot_partition.mountpoint}')
733734

734735
# Install the boot loader
735736
try:

0 commit comments

Comments
 (0)