-
Notifications
You must be signed in to change notification settings - Fork 0
Bootloader Implementation
This document details the engineering decisions behind Apollo OS's bootloader installation process, specifically the shift from bootupd to a native bootctl approach.
By default, the bootc utility delegates bootloader installation and configuration to a backend service called bootupd. However, bootupd was primarily designed for Fedora-based systems and expects specific bootloader binaries and cryptographic signatures (e.g., shim for Secure Boot).
Apollo OS is based on Arch Linux, which ships standard, unsigned systemd-boot EFI binaries (systemd-bootx64.efi).
During development, integrating Arch Linux's systemd-boot with bootupd proved incompatible:
-
Metadata Generation Failures: Running
bootupctl backend generate-update-metadatawithin the build environment resulted in internal assertion panics (assertion failed: efi_components.len() > 1). -
Path Hardcoding: System tracing (
strace) revealed thatbootupdis strictly hardcoded to search for EFI components in paths specific to Fedora OSTree deployments, rejecting generic Arch Linux EFI structures. -
Previous Workarounds: Initial attempts to bypass this involved creating placeholder GRUB configurations in the
Containerfile. While this allowed the build to pass, it resulted in empty EFI partitions during hardware installation, rendering the system unbootable.
To ensure a robust and reliable boot sequence, Apollo OS completely bypasses the incompatible bootupd implementation in favor of a native approach.
The Current Workflow:
-
Container Cleanup: All placeholder bootloader configurations and
bootupctlcommands have been removed from theContainerfileto maintain image purity. -
Bootc Delegation: During installation, the Alga installer explicitly instructs
bootcto skip bootloader management by passing the--bootloader noneargument. -
Native Installation: Immediately after
bootcsuccessfully deploys the root filesystem, the Alga installer assumes control. It dynamically locates the EFI System Partition (via GUIDc12a7328-f81f-11d2-ba4b-00a0c93ec93b), mounts it, and executes the nativebootctl install --esp-path=...command.
Result: Apollo OS utilizes a pure, native systemd-boot implementation that fully complies with the Boot Loader Specification (BLS) and integrates seamlessly with OSTree deployments without relying on fragile workarounds.
Alah Taek Lebay