Enable UKI support for the Limine bootloader option (#3207)

This commit is contained in:
mintsuki 2025-03-02 00:33:07 +01:00 committed by GitHub
parent 0b551d729e
commit 645e8d0144
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 9 deletions

View File

@ -1231,7 +1231,8 @@ class Installer:
self,
boot_partition: PartitionModification,
efi_partition: PartitionModification | None,
root: PartitionModification | LvmVolume
root: PartitionModification | LvmVolume,
uki_enabled: bool = False
) -> None:
debug('Installing limine bootloader')
@ -1306,12 +1307,19 @@ Exec = /bin/sh -c "{hook_command}"
for kernel in self.kernels:
for variant in ('', '-fallback'):
entry = [
'protocol: linux',
f'kernel_path: boot():/vmlinuz-{kernel}',
f'kernel_cmdline: {kernel_params}',
f'module_path: boot():/initramfs-{kernel}{variant}.img',
]
if uki_enabled:
entry = [
'protocol: efi',
f'path: boot():/EFI/Linux/arch-{kernel}.efi',
f'cmdline: {kernel_params}',
]
else:
entry = [
'protocol: linux',
f'path: boot():/vmlinuz-{kernel}',
f'cmdline: {kernel_params}',
f'module_path: boot():/initramfs-{kernel}{variant}.img',
]
config_contents += f'\n/Arch Linux ({kernel}{variant})\n'
config_contents += '\n'.join([f' {it}' for it in entry]) + '\n'
@ -1463,7 +1471,7 @@ Exec = /bin/sh -c "{hook_command}"
case Bootloader.Efistub:
self._add_efistub_bootloader(boot_partition, root, uki_enabled)
case Bootloader.Limine:
self._add_limine_bootloader(boot_partition, efi_partition, root)
self._add_limine_bootloader(boot_partition, efi_partition, root, uki_enabled)
def add_additional_packages(self, packages: str | list[str]) -> None:
return self.pacman.strap(packages)

View File

@ -15,7 +15,7 @@ class Bootloader(Enum):
def has_uki_support(self) -> bool:
match self:
case Bootloader.Efistub | Bootloader.Systemd:
case Bootloader.Efistub | Bootloader.Limine | Bootloader.Systemd:
return True
case _:
return False