New systemd-boot Integration in openSUSE
5. Mar 2024 | Douglas DeMaio | CC-BY-SA-3.0
There are several changes happening in openSUSE’s rolling release Tumbleweed on a daily basis and integrating systemd-boot into has been evolving.
A shift from the traditional GRUB boot loader is promising better system boot performance and security.
An all-systems-go presentation by Ludwig Nussel sheds some light on the motivations, challenges and future direction of systemd-boot integration in openSUSE.
The primary motivation behind adopting systemd-boot lies in its simplicity and efficiency, especially when handling full-disk encryption. Traditional boot loaders like GRUB require embedding decryption code and key derivation functions that can complicate the boot loader code and the boot process; this could slow down the system at startup. With systemd-boot, these responsibilities are delegated to the Linux Kernel and user space, which helps to streamline the boot process.
MicroOS and Tumbleweed’s use of Btrfs and its snapshotting capabilities adds complexity to the boot process; this is being addressed by integrating systemd-boot with the snapshot management system to ensure each snapshot boots successfully and that kernel updates are handled gracefully within this dynamic environment.
To facilitate this integration, new packaging scripts and tools like sdbootutil
were introduced to manage kernel versions, snapshots and boot entries. This tool plays a crucial role in making systemd-boot a practical choice for openSUSE users, as the way that the snapshots are managed are different in MicroOS than in Tumbleweed.
Using sdbootutil
, the system will create new Type #1 boot entries in the EFI System Partition (ESP) to represent all the avaliable boot options, which will copy from the snapshot the new installed kernels into this partition. It will also generate good initrd
for those snapshots.
When using full disk encryption, sdbootutil
will also call the different commands that will update the policies required to automatically unlock the new snapshots using the internal Trusted Platform Module 2.0 (TPM2) device of the system.
Ideally, in the future, some if not all of this functionallity will be exported into systemd
itself or other systems components in the distribution. These changes make this tools a good place to experiment, validate or discard the different approaches that openSUSE is leading with systemd-boot.
At this point, systemd-boot support in openSUSE is still considered experimental. Both Tumbleweed and MicroOS yast installers offer systemd-boot as an alternative to grub for the brave. There are also ready-made appliances for qemu that use systemd-boot and full-disk encryption by default.
(Image made with DALL-E)