Fix boot partition regression (#1942)

* Fix boot partition regression

* Fix spelling
This commit is contained in:
codefiles 2023-07-25 05:16:02 -04:00 committed by GitHub
parent 69c37e7c79
commit d76f4a0296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View File

@ -789,8 +789,8 @@ class DeviceModification:
"""
Similar to get_boot_partition() but excludes XBOOTLDR partitions from it's candidates.
"""
fliltered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
return next(fliltered, None)
filtered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
return next(filtered, None)
def get_boot_partition(self) -> Optional[PartitionModification]:
"""
@ -798,11 +798,13 @@ class DeviceModification:
Only returns XBOOTLDR if separate EFI is detected using self.get_efi_partition()
"""
if efi_partition := self.get_efi_partition():
fliltered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
filtered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
if boot_partition := next(filtered, None):
return boot_partition
return efi_partition
else:
fliltered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
return next(fliltered, None)
filtered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
return next(filtered, None)
def get_root_partition(self, relative_path: Optional[Path]) -> Optional[PartitionModification]:
filtered = filter(lambda x: x.is_root(relative_path), self.partitions)

View File

@ -726,10 +726,11 @@ class Installer:
# TODO: Ideally we would want to check if another config
# points towards the same disk and/or partition.
# And in which case we should do some clean up.
bootctl_options = [
f'--esp-path={efi_partition.mountpoint}' if efi_partition else '',
f'--boot-path={boot_partition.mountpoint}' if boot_partition else ''
]
bootctl_options = []
if efi_partition and boot_partition != efi_partition:
bootctl_options.append(f'--esp-path={efi_partition.mountpoint}')
bootctl_options.append(f'--boot-path={boot_partition.mountpoint}')
# Install the boot loader
try: