# systemd-boot

Date: 2021-08-07 20:08:09 +08:00Date modified: 2022-05-22 21:24:33 +08:00

systemd also comes with a bootloader aptly named `systemd-boot` though it only supports UEFI-based firmware. Just like GRUB, they can be configured through plain-text files.

For detailed information about the bootloader, see the manual page `systemd-boot.7`.

With a complete installation, the bootloader config folder may look like the following list.

    /boot/
    `-- loader
        |-- entries             # (ref:loader-entries)
        |   `-- arch.conf
        |-- loader.conf         # (ref:loader-conf)
        `-- random-seed

- `loader/entries/` is a directory containing all of the entries available to be booted.

- `loader.conf` contains the loader configuration.

Most Linux distros with systemd installed should have a sample config file somewhere. As an example, we'll show what those look like.

`loader.conf` is the configuration for the boot loader including the timeout seconds among others. Here is a sample of a bootloader configuration.

    default arch
    timeout 4

In this config, this simply makes the `arch` loader entry to be default when no actions has occurred. It will start loading it automatically after a timeout of 4 seconds.

The `arch` loader entry can be found at `${ESP}/loader/entries/arch.conf`. The following code block shows what a loader entry looks like.

    title   Arch Linux
    linux   /vmlinuz-linux
    initrd  /initramfs-linux.img
    options root="PARTUUID=${PARTUUID}"

You can customize and create extra entries for the same installation. This is what NixOS does with its system generations, letting the user to boot to a specific point in time from the boot loader. Very useful for emergency boots in case the current generation breaks for whatever reason.

For complete details of the configuration file, you can see `loader.conf.5` manual page.

## Backlinks

- systemd