I keep two kernels installed. One is the active kernel, the second in the last working kernel. This is my lilo.conf section related to the kernel images.
Code:
## kernel images ##
# Slackware64
image = /boot/vmlinuz
initrd = /boot/initrd.gz
label = Slackware64
# Working kernel
image = /boot/vmlinuz-working
initrd = /boot/initrd-working.gz
label = LastWorking
I also create a mkinitrd.conf file using /usr/share/mkinitrd/mkinitrd_command_generator.sh.
From the /boot/ directory, the steps I take after running slackpkg to update everything:
Note: I will use for the example my last update kernel versions.
1. Edit /etc/slackpkg/blacklist to comment out the kernel packages except for kernel-huge.
Note: I do not blacklist kernel-firmware or kernel-headers.
Code:
#kernel-generic
kernel-huge
#kernel-modules
#kernel-source
2. Run 'slackpkg download kernel' deselect firmware and headers since they have already been updated.
3. Edit /etc/slackpkg/blacklist to uncomment the kernel packages.
Code:
kernel-generic
kernel-huge
kernel-modules
kernel-source
4. Install the updated kernel packages.
installpkg /var/cache/packages/Slackware64/a/*.t?z
installpkg /var/cache/packages/Slackware64/k/*.t?z
Note: At this point I now have three kernels installed.
5. Delete the download packages as they are no longer needed.
rm /var/cache/packages/Slackware64/a/*
rm /var/cache/packages/Slackware64/k/*
6. Create the initrd for each kernel
mkinitrd -F -k 4.14.55
mkinitrd -F -k 4.14.53 -s initrd-working-tree -o initrd-working.gz
7. Set the working kernels symlinks to previous kernel
Note: I actually use mc to edit the symlinks.
rm System.map-working
ln -s System.map-generic-4.14.53 System.map-working
rm config-working
ln -s config-generic-4.14.53.x64 config-working
rm vmlinux-working
ln -s vmlinuz-generic-4.14.53 vmlinuz-working
8. Run lilo
9. Reboot
10. After the reboot I remove the unused kernel.
In virtual machines I don't blacklist the kernel packages (default) and let slackpkg update the kernel.
I have an Acer laptop I just acquired, was running with huge until I noted some things not loading, I switched to generic with an initrd. Used to mkinitrd_command_generator.sh to create a mkinitrd.conf which fixed the issue.