| .forgejo/workflows | Forgejo workflow | |
| src | Initial commit | |
| .gitignore | Initial commit | |
| build.zig | Initial commit | |
| build.zig.zon | Initial commit | |
| README.md | Initial commit | |
WARNING: This is a work-in-progress project. Use at your own risk.
An extremely minimal bootloader for cross-filesystem EFI chain-loading.
Uses EFI driver preloading to chain-load an EFI application, even if it's stored in a non-FAT partition.
Installed on the default EFI entry path (instead of relying on writing an entry to the UEFI NVRAM) so it's suitable for removable drives as is.
Simply copy the bootloader to \EFI\BOOT\BOOTX64.EFI in the EFI System Partition, and write the config to \CONFIG.
Use case
In a traditional Linux system, you have a bootloader (e.g. GRUB), the kernel and the initrd all in the ESP (EFI System Partition).
This is fine for many systems, but what if you want to have every package in its own isolated directory?
You could use symlinks for most packages, like /bin/foo -> /opt/foo/bin/foo, but not for any of the three listed above, since they must live in the ESP and are read by the UEFI firmware, which doesn't know about your non-FAT FS.
You could of course have the entire linux FS formatted a single FAT32 partition, but that comes with its own set of problems.
What you can do instead is use an extremely minimal bootloader (trapdoor) which reads a non-FAT partition and chain-loads an EFI application.
The EFI application can directly be the Linux kernel or, if the user wants a boot menu, another EFI bootloader that provides one (e.g. GRUB).
That way, you can also upgrade the bootloader, kernel or initrd without having to modify the ESP at all.
You can even avoid mounting the ESP at all in the running system.
Configuration example
# An EFI driver that will be loaded before the target image (usually a filesystem driver)
preload = xfs.efi
# The UUID of the partition
uuid = c8ce7c18-23c0-49f6-ab4a-f9b4b93d093d
# The EFI application to chain-load
target_image = /path/to/vmlinuz
# (optional) Load options passed to the EFI image via the LoadedImage protocol (in the case of a linux kernel, it's the kernel parameters)
load_options = console=ttyS0 root=PARTUUID=c8ce7c18-23c0-49f6-ab4a-f9b4b93d093d