Linux 7.4 EFI stub populates Boot Loader Interface variables for direct kernel boots
The kernel's EFI libstub now sets LoaderDevicePartUUID when booted directly by firmware, enabling systemd-gpt-auto-generator to discover filesystem layouts without a conventional bootloader.
Summary
EFI subsystem changes merged for Linux 7.4 address a gap in systemd's Boot Loader Interface when the kernel is launched directly by EFI firmware rather than through GRUB or systemd-boot. The kernel's EFI libstub now populates the LoaderDevicePartUUID variable, which systemd-gpt-auto-generator uses to identify the source disk and automatically mount partitions. This change was authored by Vincent Mailhol and applies to x86_64 and ARM64 systems using direct EFI kernel booting.
Previously, direct EFI boots left this variable unset because no external bootloader existed to provide it. The libstub now parses the loaded image device path, extracts the GPT partition GUID from the HD() node, and publishes it under the Linux loader entry vendor GUID as a volatile EFI variable. If LoaderInfo is already set by an earlier boot stage, the stub skips this step to avoid overwriting existing values.
EFI libstub and Boot Loader Interface changes in Linux 7.4
- Boot Loader Interface compliance: The EFI libstub now acts as a bootloader surrogate, populating EFI variables defined by systemd's Boot Loader Interface specification when no external bootloader is present.
- Sentinel-based conditional logic: LoaderInfo serves as a sentinel check; if already set by GRUB, systemd-boot, or another earlier boot stage, the stub exits without modifying variables to prevent conflicts.
- systemd-gpt-auto-generator integration: The populated variable enables systemd's generator to identify the boot disk and automatically discover and mount root, home, and other GPT-partitioned filesystems.
Why it matters
This improvement removes a configuration barrier for users and distributions adopting direct EFI kernel booting, such as UKI-based deployments or embedded systems foregoing traditional bootloaders. It ensures systemd's automatic partition discovery works consistently regardless of whether GRUB, systemd-boot, or the kernel's own EFI stub initiates the boot process, reducing manual fstab or kernel parameter management.
Original reference: www.phoronix.com →