Kernel-install failure when using different bootloader and uninstalling grub

Hi!
I freshly created this account, just so I could share my findings (and frustrations) regarding missing vmlinuz archives in my /boot/ folder, even though dnf reinstall kernel and dnf reinstall kernel-core kept executing successfully.

Brief summary of what my problem is:

  • I am using reFind instead of grub as the bootloader and removed grub some time in the past
  • When trying to update my packages, I received a failure, without explanation. Trying --skip-broken did not help either. After some digging, I found that simply removing an older kernel package (6.6.*) allowed me to upgrade the packages.
  • Through this, I noticed that, while several kernel packages were theoretically installed, none of them were selectable at boot. Additionally, none of the corresponding vmlinuz archives were created in /boot/
  • Reinstalling the kernel and kernel-core packages several times did not solve this issue.

What I found out:
I kept digging for several hours and found this issue in the systemd repo. This leads me to believe, that the standard handling for kernel-install to check which layout is used for the fedora install is somehow tied to grub2 being installed on the system. As I am using reFind, I removed grub from my install some time ago. This must have tripped something in the kernel-install procedure that lead it to try and move the kernels to the /boot/efi/$machine-id/ directory, instead of placing them simply in /boot/.

Now my question would be if this could indeed be, what caused my problems?
I also found this discussion topic, where it was suggested to simply create the /etc/kernel/install.conf file and fill it with:

layout=other

So this is what I did.

(I also briefly reinstalled grub2, reinstalled kernel-core and subsequently uninstalled grub again, when I thought it didn’t help, but somehow the newest kernel is now in my /boot/ folder.)

I’d appreciate any help from you very much!
Cheers in advance.

The kernel is installed in /boot by a script provided by grub2. If you uninstall grub2, you need to create another way to fetch the kernel from /usr/lib/modules/*/vmlinuz. You may also need to arrange for the dracut program to be run.

Thanks for letting me know!
Dracut seems to run without grub2, as the initramsfs were created for all kernels.

Is there a reason why grub performs this task? Shouldn’t this be kept seperate from the specific bootloader that is in use?
Also: do I need to install all 3 packages for this, or does one of the extra packages (grub2-pc, …) perform this task?

More specific, it is the script at /usr/lib/kernel/install.d/20-grub.install provided by the package grub2-common. For your purpose, you can make a much simpler script. The package grub2-pc is only need for legacy BIOS boot.

The place where vmlinuz needs to be installed differs depending on which boot loader you are using. So grub2 takes care of installing it where it needs to be for grub2.