Filter phantom entries when rewriting EFI BootOrder (#94)

The Limine registration helper rebuilds the UEFI BootOrder from the
pre-state read, but passes every entry through verbatim. Some firmware
(listed in the BootOrder but with no matching BootXXXX variable) causes
efibootmgr --bootorder to fail with exit status 8, aborting the whole
install at the bootloader step.

Only carry forward entries that still exist as boot variables.
This commit is contained in:
N1R4 authored and GitHub committed 2026-08-01 13:07:09 -05:00
1 parent a76f599eaa
commit 0b4d74f6af
1 file changed
+7 -1
@@ -437,7 +437,13 @@ def _register_limine_efi_entry(
raise RuntimeError("efibootmgr --create reported success but no Limine entry found")
limine_num = new_limine[0]
keep = [num for num in pre_state["order"] if num not in stale_limine and num != limine_num]
keep = [
num
for num in pre_state["order"]
if num not in stale_limine
and num != limine_num
and num in pre_state["entries"]
]
subprocess.run(
["efibootmgr", "--bootorder", ",".join([limine_num, *keep])],
check=True, capture_output=True,