systemd-boot (sd-boot / gummiboot)
- Arch linux doc
- Arch Linux – How to migrate from grub to systemd-boot in less than 2 minutes.
- Distro with systemd-boot by default
- Arch wiki: dm-crypt - encrypt hook - Using systemd-cryptsetup-generator
Install sd-boot:
$ bootctl install
Created "/efi/EFI/systemd".
Created "/efi/loader".
Created "/efi/loader/entries".
Created "/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
Random seed file /efi/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".
Change default boot entry
Edit /efi/loader/loader.conf
Automated kernel image management and boot loader entries
kernel-install-for-dracut
Kernelstub
Kernelstub is a utility to automatically manage your OS's EFI System Partition (ESP). It makes it simple to copy the current kernel and initramfs image onto the ESP so that they are automatically probable by most EFI boot loaders as well as the EFI firmware itself.
- Github
- What is Kernelstub
- Developed by System76, packaged in Pop-Os deb repo
- Not packaged in Arch, neither in AUR
- Sample template:
/etc/default/kernelstub.SAMPLE
Copy current kernel and inintd to EFI partition:
kernelstub -v
Install older kernel as default
kernelstub -v -k /boot/vmlinuz-5.19.16-76051916-generic -i /boot/initrd.img-5.19.16-76051916-generic
Then copy the older kernel to i.e. *-previous
:
cp vmlinuz.efi vmlinuz-previous.efi
cp initrd.img initrd.img-previous
Then override the default kernel + initrd entries:
kernelstub -v
Dracut
From Arch wiki: Dracut;
dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem. Upon installing linux, you can choose between mkinitcpio and dracut. dracut is used by Fedora, RHEL, Gentoo, and Debian, among others. Arch uses mkinitcpio by default.
Manually create intiramfs images (not needed when using kernel-install-for-dracut
):
dracut --hostonly --no-hostonly-cmdline /efi/initramfs-6.1-x86_64-dracut.img
dracut /efi/initramfs-6.1-x86_64-dracut-fallback.img
Migrate from grub/mkinitcpio to sd-boot/dracut
see ./systemd-boot-migration.md