Page 1 of 1

systemd-boot using kernel-install

PostPosted: Jun 20th, '21, 21:35
by dalto
I wanted to convert my installation to systemd-boot using kernel-install for a project I am working on. Since there didn't seem to be a supported way to do this that I could find here is the approach I took.
  • rm /etc/dnf/protected.d/basesystem.conf
  • dnf remove "grub*"
  • remount /boot/efi as /efi and update /etc/fstab to match
  • clean out the unneeded bits from /efi
  • bootctl install
  • mkdir -p /efi/$(cat /etc/machine-id) # it may be created by bootctl install
  • kernel-install add 5.10.16-desktop-1.mga8 /boot/vmlinuz-5.10.16-desktop-1.mga8 # do this for all kernels
That seemed to work fine but if were to install/update/remove a kernel it would have been a mess since nothing was instrumented for kernel-install.

In order to resolve that I took these steps:
  • Use rpm to forcibly remove bootloader-utils
  • Install a dummy bootloader-utils package to satisfy dependencies
  • Created a modified /sbin/installkernel and a dummy /sbin/kernel-remove-initrd
This all seems to have worked and installing updates and/or new kernels seems to behave sensibly. Removing kernels also seems to work.

So, that being said, I have a couple of questions.
  • Is there something else out there that does this already?
  • Is there a better approach to this?