Skip to content

fix: register EFISTUB UKIs on the EFI system partition - #4887

Open
RageGen wants to merge 1 commit into
archlinux:masterfrom
RageGen:fix/efistub-uki-partition
Open

RageGen wants to merge 1 commit into
archlinux:masterfrom
RageGen:fix/efistub-uki-partition

Conversation

@RageGen

@RageGen RageGen commented Nov 24, 2026

Copy link
Copy Markdown

With EFISTUB and UKI enabled, a separate /boot partition produces a firmware entry pointing at the wrong partition. _config_uki writes the image to the EFI system partition, but _add_efistub_bootloader passes the /boot partition's disk and number to efibootmgr. Installation can finish with an entry that firmware cannot load.

Use the EFI system partition for UKI entries. Keep /boot for ordinary kernel entries. Also apply the non-FAT /boot restriction only when UKI is disabled, since UKIs are written to the ESP.

Adds eight regression cases covering shared and separate partitions, an ESP on another disk, both UKI modes, two kernel entries, and an ext4 /boot. Before the fix, three cases failed; afterward, all eight passed.

Validation includes, a 42 tests passed, ruff lint/format, Flake8, Pylint, project-wide mypy and the wheel build passed.
Tested both revisions in QEMU/OVMF using the official Arch Linux ISO and a disposable GPT disk with separate FAT /efi and /boot partitions. The real configuration writer and efibootmgr registered partition 2 before the fix and partition 1 afterward. Booted each saved disk/firmware state without the ISO or a directly supplied kernel. The original entry failed with Not Found and firmware reported no bootable device. The fixed entry loaded the UKI and the Arch kernel reached a test initramfs.

The test UKI used Arch's kernel and systemd stub, built with Arch's ukify package. Package installation and Installer's mkinitcpio call were skipped; the test supplied a prebuilt UKI. Physical firmware, Secure Boot and a full installed system were not tested.

efibootmgr documents --disk and --part as the disk and partition containing the loader: https://man.archlinux.org/man/efibootmgr.8

Related to #2684, but this change addresses UKI layouts; the non-UKI /efi layout described there remains outside its scope.

efistub-before-boot efistub-after-boot

@RageGen
RageGen requested a review from Torxed as a code owner November 24, 2026 13:57
h8d13 added a commit to h8d13/archinstoo that referenced this pull request Nov 26, 2026
With a separate /boot the UKI is written to the ESP, but efibootmgr
got /boot's disk and partition number, so firmware could not load it.
Same for the removable-path fallback copy.
Non-FAT /boot is only rejected without UKI, firmware never reads it.

efibootmgr(8): --disk/--part are the partition containing the loader.

Ported from archlinux/archinstall#4887

Co-authored-by: RageGen <zamorin.daniil@mail.ru>
h8d13 added a commit to h8d13/archinstoo that referenced this pull request Nov 26, 2026
Ported from archlinux/archinstall#4887

Co-authored-by: RageGen <zamorin.daniil@mail.ru>
h8d13 added a commit to h8d13/archinstoo that referenced this pull request Nov 26, 2026
* fix(bootloader): efistub UKI entry targets the ESP

With a separate /boot the UKI is written to the ESP, but efibootmgr
got /boot's disk and partition number, so firmware could not load it.
Same for the removable-path fallback copy.
Non-FAT /boot is only rejected without UKI, firmware never reads it.

efibootmgr(8): --disk/--part are the partition containing the loader.

Ported from archlinux/archinstall#4887

Co-authored-by: RageGen <zamorin.daniil@mail.ru>

* test(bootloader): efistub entry partition and UKI validation

Ported from archlinux/archinstall#4887

Co-authored-by: RageGen <zamorin.daniil@mail.ru>

---------

Co-authored-by: RageGen <zamorin.daniil@mail.ru>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant