On Wed, 08 Jun 2016 14:03:18 -0400, Genes Lists via arch-general wrote:
Is there a way to mark the deletion to happen after the new kernel is booted ?
I may well be missing something of course.
What you're missing is, that the directory names in /lib/modules/ differ, but not the kernel names in /boot/.
$ ls -Ggh /boot/vm* -rw-r--r-- 1 4.3M May 11 22:23 /boot/vmlinuz-linux -rw-r--r-- 1 4.4M Nov 18 2015 /boot/vmlinuz-linux-rt -rw-r--r-- 1 4.0M Nov 27 2014 /boot/vmlinuz-linux-rt-lts
If you upgrade the new kernel has got the file name "vmlinuz-linux*", too, so the old kernel must be removed first. However, this could be done without running dkms remove, IOW keeping the directory of the old kernel in /lib/modules/ is possible, but then dkms remove fails later, after the old kernel is removed. By this approach you later need to tidy up /var/lib/dkms/ and /lib/modules/ with the rm command.
If the kernel file names in /boot/ would differ, then it would require to manually remove old kernels and to handle links or to edit boot loader configs. Arch Linux users not necessarily install GRUB2 by their Arch installs and even if they would, they not necessarily want to allow that the config is edited automatically.
It doesn't harm to at least install two different kinds of kernels (e.g. mainline and longterm) and to add at least one kernel to IgnorePkg in /etc/pacman.conf and to upgrade this kernel only, after another kernel was successfully used. So there usually is no reason to collect several versions of the same kind of kernel and the approach that the file names in /boot/ don't differ is usually wanted. IMO it's not an issue to reboot, if a kernel was upgraded and additional modules need to be loaded, that were removed for the currently running kernel. If a reboot would be an issue, then upgrading the kernel later might be the better approach, IOW adding all installed kernels to IgnorePkg could solve this issue.