Systemd Boot

Systemd-boot is a lightweight bootloader for linux that is an excellent replacement for grub due to it’s simplicity. However the configuration is a bit different and requires manual intervention to work. So, let’s see how we can configure systemd-boot.

Pre-requisites

Before you proceed this only works if your init system is SystemD and the firmware is UEFI. There might be other options but I’m yet to try those. You also need the UUID of your root partition.

Tip : Run the command lsblk -f to find the UUID of the required partition

Abbrevations

  1. esp is the location is the location of the boot partition. ie, /boot /efi etc.

  2. foo.conf can be linux.conf , linuxzen.conf , bruhmoment.conf , etc.

Loader Configuration

esp/loader/loader.conf

timeout 3
console-mode keep
editor no
default foo.conf

What this does is set the timeout to 3 seconds, and set the default entry as the one specified by foo.conf (as opposed to foo-alternative.conf)

Entry Creation

esp/loader/entries/foo.conf

title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options root="UUID=92aa783d-795f-46d3-8fcb-beba5efd2cdd" rootflags=subvol=@ rw

esp/loader/entries/foo-fb.conf

title Arch Linux Fallback
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux-fallback.img
options root="UUID=92aa783d-795f-46d3-8fcb-beba5efd2cdd" rootflags=subvol=@ rw

Here we have two .conf files for the main kernel and it’s fallback respectively.

  1. title is what is displayed on the boot menu

  2. linux is the kernel file to be loaded

  3. initrd specifies the initramfs image and the amd or intel micro-code that is to be loaded.

  4. options

    a. root="UUID=uuid_of_your_root_partition" rw (specifies the root partition and also enables the read-write flag)

    b. rootflags=subvol=@ (only required for btrfs partitions to specify the the subvolume in which root partition exist)