when updating my system i get new kernels. and with every new kernel my systemd-boot menu grows with a new entry. as my /efi volume is only 1G it fills up with old kernels when reinstall-kernels is invoked
# kernel-install list
VERSION HAS KERNEL PATH
6.11.8-arch1-2 β /usr/lib/modules/6.11.8-arch1-2
6.6.61-1-lts β /usr/lib/modules/6.6.61-1-lts
but a bootctl list shows the previous kernels too:
as you can see the default is still 6.11.6 althoug i have 6.11.8 . every time a new kernel is published this will appear in the kernel list and a new loader entry is generated. but the old ones are not pruned.
as my /efi partition is ony 1G in size it will fill up.
# tree
.
βββ 6.11.6-arch1-1
β βββ initrd
β βββ linux
βββ 6.11.7-arch1-1
β βββ initrd
β βββ linux
βββ 6.11.8-arch1-2
β βββ initrd
β βββ linux
βββ 6.6.61-1-lts
βββ initrd
βββ linux
yes, i know how to manually cleanup. but is there any automatism? it would be great when i get a new kernel version not only to add this one to the boot loader list but also to remove the entries which are not listed by kernel-install list, in my case the 6.11.6 and 6.11.7.
FYI: i played around a bit. when doing a pacman -R linux the bootloader entry is removed. when i install it again, the entry appears. so it looks like it is working for the simple case.
in real live i mostly do system updates on a daily base but i do not reboot, i simply suspend my notebook. i reboot about once a week. perhaps this is a problem.
but it would be great to have some sort of βhard cleanupβ when a pacman hook installs/removes a kernel. because in my case the default boot entry is the first one (with the lowest version number). when the system boots i have to manually select the latest kernel or i have to cleanup the kernel list and reboot again.
There should be no need for a hard cleanup. The fact that you are seeing a need for it means something is broken somewhere or you are doing something unexpected.
Can you share the output of pacman -Q | grep -E "linux|dracut|kernel|mkinitcpio|hook"
yes, that worked. downgrading to 6.11.7 and upgrading again removed the 6.11.7.
i will observe this. iβm sure i installed both packages to solve this problem, but perhaps that made the whole thing worse.
i have the impression that the problem arises, when i do a system update (where i get a new kernel) and a few days later i receive the next kernel although my system was not rebooted and my laptop still runs with an older kernel.