Boot Linux Without Grub

  • Another approach is systemd-stub. This is a small bit of efi code that looks for the kernel and ramdisk within the efi executable itself.

    An added benifit of this approach is that you can have a full linux system in a single file. In addition to being more convenient in many scenerios, this also means that your initrd and kernel commandline can be signed under secureboot.

    If you are using dracut to create your ramdisk, it has an option to automatically package it into an EFI executable. Given the design of Dracut, you probably wouldn't use it to put the entire system into the EFI executable, as Dracut assumes its job is to load the real rootfs.

    https://www.freedesktop.org/software/systemd/man/systemd-stu...

    https://man7.org/linux/man-pages/man8/dracut.8.html

  • I recently reinstalled Windows 10 and Ubuntu 21.10 (in that order) in EFI mode. I had assumed that grub was superfluous even in that situation: I figured the BIOS would see that there's an EFI partition with several operating systems and let me choose one.

    Well, apparently it doesn't work that way. The BIOS still just lets me pick a disk (or flash memory, pxe, ...). And then grub takes over.

    Hilariously, Ubuntu did not automatically set up an entry for the Windows 10 install (something that had always worked for legacy setups). Had to do it by hand. Really not something I would have wanted to spend time on.

  • Next we should make GRUB chainload itself