After upgrading F39->F40, I noticed my EFI partition is very full. That’s partly my fault for making it too small, but it holds enough kernels so I haven’t dealt with it.
However, I notice that more than the set max of kernels are still in there. So I tried to remove the oldest one and got this error from DNF:
...
Running transaction
Preparing : 1/1
Erasing : kernel-modules-extra-6.8.10-200.fc39.x86_64 1/4
Running scriptlet: kernel-modules-extra-6.8.10-200.fc39.x86_64 1/4
Erasing : kernel-modules-6.8.10-200.fc39.x86_64 2/4
Running scriptlet: kernel-modules-6.8.10-200.fc39.x86_64 2/4
Erasing : kernel-modules-core-6.8.10-200.fc39.x86_64 3/4
Running scriptlet: kernel-core-6.8.10-200.fc39.x86_64 4/4
rm: cannot remove '/efi/<hostid redacted>/6.8.10-200.fc39.x86_64/': Is a directory
/usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.
error: %preun(kernel-core-6.8.10-200.fc39.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package kernel-core
error: kernel-core-6.8.10-200.fc39.x86_64: erase failed
I think this is strange, because I didn’t notice any problem on F39 when new kernels were installed; old kernels got removed as expected. Why would it break now? This error seems to suggest the script is just not attempting to do the right thing, but obviously that’s crazy, right? That path is always a directory, not a file, so why would the script try to rm it?
Can I just remove this path, manually? That’s my instinct, but I’m not sure what will happen with the preun script. Can I force uninstall the pkg and then delete the path? Do you think there is something more serious going on?
This usually is because on some older fedora versions the directory /boot/efi/<machine ID> directory may have been created and with newer systems that directory is only for use with systemd-boot. Removing that directory then running dnf reinstall kernel-core usually fixes that problem.
Note there is no directory with the machine ID in that area.
When using grub to boot that directory became a problem after f40 was released due to changes in booting. That directory has not been used by grub for a long time and only became a problem with recent system updates.
In fact, the /efi directory does not exist with f40 and grub. As I understand it the /efi directory only is used when using systemd-boot. Which way are you booting? Default with grub or with systemd boot?
Anything that deviates for the default configuration can be important. Otherwise people would just assume that you are using a standard Gnome Workstation as is was when first installed.
Yes, I understand that. Again, I’m sorry. I switched to EFI no-grub in 2016. So, I kinda forgot about it.
This issue with preun script never showed up before; it doesn’t make sense that this just cropped up after F40. Could something unexpected have changed during upgrade F39->F40?
It’s really cool that you know how dracut works that well. But, you’re suggesting me to change a file in /usr/ owned by a pkg. That seems very unusual. Is there anything else I should know about systemd-boot systems that might be set incorrectly? Maybe something with /etc/dracut.conf.d/ ? Can I put a modified copy of 50-dracut.install in that directory or something? What I’m getting at is, what do I need to watch out for if I change that file? Won’t that cause a checksum error on that file with rpm --verify?