Toddler Proofing systemd-boot

If you let your toddler bang on your keyboard while you boot, you might be surprised to find that it’s not booting right, afterwards.

Many modern Linux distributions aren’t using LILO or Grub anymore, they’re using systemd-boot. It’s nice- fast, lots of security considerations, etc. It’s also very minimalist by default, it doesn’t even show you a prompt. So, to break out of the boot loop fugue state, hold down spacebar as the box boots.

You don’t have to hit space at the right time, for the right length, nothing, you just have to get it down while systemd-boot is going, so the easiest thing to do is to hit that power button and weight the thing down.

Now you’ll be treated to a state of the art, 3-5 line TUI. Fantastic. Pick the normal boot option, log in as you normally would, breathe a sigh of relief. But wait, there’s more.

While normally systemd-boot remembers the last thing you picked, there is some sort of Toddler Superpower that makes selections sticky. I have not discovered what this is in the man pages. To undo this feat, you need to manually fiddle with the boot list. Run bootctl list to get a list of magic ids-

# sudo bootctl list
Boot Loader Entries:
        title: Normal Boot
           id: current.conf
       source: /boot/efi/loader/entries/current.conf
        linux: /EFI/64f4c214-26c0-40ed-a6a4-630aff85d8f7/vmlinuz.efi
       initrd: /EFI/64f4c214-26c0-40ed-a6a4-630aff85d8f7/initrd.img
      options: root=UUID=64f4c214-26c0-40ed-a6a4-630aff85d8f7 ro quiet splash

        title: Oldboi boot
           id: oldkern.conf
       source: /boot/efi/loader/entries/oldkern.conf
        linux: /EFI/64f4c214-26c0-40ed-a6a4-630aff85d8f7/vmlinuz-previous.efi
       initrd: /EFI/64f4c214-26c0-40ed-a6a4-630aff85d8f7/initrd.img-previous
      options: root=UUID=64f4c214-26c0-40ed-a6a4-630aff85d8f7 ro quiet splash

        title: Reboot Into Firmware Interface
           id: auto-reboot-to-firmware-setup
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

and then run bootctl set-default with the id field-

# sudo bootctl set-default current.conf

to quit rebooting into the EFI configuration screen.