GRUB alternatives
I’ve never liked GRUB much. I don’t understand it and it makes me anxious. I never have good experiences using GRUB, I don’t want to use GRUB at all really. I want to use Linux. The only time I think about GRUB is when something goes wrong and my system is broken.
Anyway, there’s alternatives to GRUB in the modern UEFI world. EFI itself really was designed to be a boot loader, it’s weird we only use it to boot a second boot loader. Why not boot Linux directly?
One reason is drivers and filesystem support. EFI supports FAT12, FAT16, and FAT32. If you want to put your kernel on a more Linux-native filesystem you need something to load a driver for it in EFI first.
EFISTUB. The option with no extra boot loader. You build the Linux kernel with an option that makes it directly bootable from EFI. There is no boot firmware or OS at all; the EFI BIOS directly loads the Linux kernel. You put the kernel and initial ramdisk in the existing EFI partition, which is probably a FAT32 filesystem. Then you use efibootmgr from Linux to tell EFI about your kernel and the command line options to boot it. This seems remarkably straightforward.
systemd-boot. Yes, systemd also comes with a boot manager, a whole mini-OS. You install systemd-bootx64.efi in the EFI partition as an EFI boot manager. You put an ordinary Linux kernel and init ram disk in a XBOOTLDR boot partition and systemd-boot calls them. You can also have systemd-boot load drivers for devices and filesystems to get to your Linux kernel.
rEFInd (formerly rEFIt). Another boot manager. It has some built-in support for some filesystems and can load drivers. This one boots EFISTUB kernels, not normal kernel images.
So three different boot managers all roughly similar. Or boot the kernel directly via EFISTUB. I’m not sure in practice any of these buy me much over using GRUB. They all seem simpler than GRUB, that seems like a small advantage.
I think all of these are tricky with Secure Boot. One nice thing about GRUB is it has a binary signed by a key that commercial computers already recognizes, no work required. For the other options there’s some magic tool called sbctl that seems to be able to sign binaries so Secure Boot will boot them. There’s a step of “enroll keys”; you create your own your own signing key that you then install in the BIOS as a one time thing. Then with sbctl you can sign any binary. (Here’s some notes on a manual process instead).
With all of these alternatives you need to evaluate what your plan is to getting to a rescue mode or single user if you have to. Honestly for me my plan is usually “boot from USB”, not relying on whatever GRUB has access to. But I think all 3 boot loader OSes have some menu or command line editing. EFISTUB direct is trickier, but maybe the BIOS EFI shell can do.
Now that I have Proxmox set up it’d be easy to create VMs to experiment with this. I wonder if the OVMF UEFI BIOS they offer causes any issues. A quick search doesn’t show any clear guides on how to use alternate boot methods with OVMF but a bunch of suggestions it should work.
For that matter on a virtual machine it’s not clear using UEFI really offers any advantages over the old fashioned MBR-style BIOS. I kinda miss LILO. (IIRC, you could also boot Linux directly from an MBR BIOS with some tricks, but not sure about initial ramdisks.)