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

View File

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