[SOLVED] kernel update question: do I have to reboot to upgrade to new kernel version in current?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
kernel update question: do I have to reboot to upgrade to new kernel version in current?
My usual practice is to update in current, then reboot in order to get the new kernel version installed, then run the mkinitrd_command_generator.sh scrpt to get the modules for the generic modules identified, and then reboot again to get to the new version of the generic kernel.
Is there a way to do this "on the fly" without the two reboots?
You can make the initrd for new kernel while running another kernel version. If you update grub.cfg, install the modules, run mkinitrd with the options to clear the directory /boot/initrd-tree and to use the relevant kernel version, and update the hard disk boot sector (I think) it should be possible to do it in one reboot.
1) update via slackpkg
2) as root: geninitrd
3) copy vmlinuz-generic and new initrd.gz to my efi partition
4) reboot
This works because when generating an initrd you can actually specify the kernel to create it for as mentioned by marav. The geninitrd script just automates this by detecting the newly installed kernel version even when the old kernel is still running.
If you use slackpkg to update, do the initial 'slackpkg upgrade-all' without including the generic kernel. Then do a second 'slackpkg upgrade-all' (just need to hit the up arrow key). This way results in the /boot/vmlinuz symlink pointing to the generic kernel rather than the huge kernel. Then make the new initrd and update the bootloader.
My usual practice is to update in current, then reboot in order to get the new kernel version installed, then run the mkinitrd_command_generator.sh scrpt to get the modules for the generic modules identified, and then reboot again to get to the new version of the generic kernel.
Is there a way to do this "on the fly" without the two reboots?
Here is how I would to this.
Blacklist kernel-huge.
Have an /etc/mkinitrd.conf with my desired settings. "mkinitrd_command_generator.sh -c" can help with this.
Do the "slackpkg upgrade-all"
cd /boot
run "mkinitrd -F -k x.x.x" (-F to use /etc/mkinitrd.conf; -k the kernel version to use.)
run lilo
reboot
done one reboot.
Last edited by chrisretusn; 11-14-2021 at 02:22 AM.
Blacklist kernel-huge.
Have an /etc/mkinitrd.conf with my desired settings. "mkinitrd_command_generator.sh -c" can help with this.
Do the "slackpkg upgrade-all"
cd /boot
run "mkinitrd -F -k x.x.x" (-F to use /etc/mkinitrd.conf; -k the kernel version to use.)
run lilo
reboot
done one reboot.
Or even more simply, and no kernel blacklisting (in case you DO need to boot huge for recovery):
If using lilo, and lilo.conf is configured, just run lilo after mkinitrd then reboot. Specifying the kernel in the mkinitrd command line will enure which version gets grabbed for those that like the have a few laying about.
You really don't need much else or need to stuff mkinitrd.conf full of extras for most simple Desktop and Server installations.
If using lilo, and lilo.conf is configured, just run lilo after mkinitrd then reboot.
This is dependent on the configuration in /etc/lilo.conf.
If 'image = /boot/vmlinuz' is set, then the order of upgrade of the generic and huge kernels is important.
If 'image = /boot/vmlinuz-generic' or 'image = /boot/vmlinuz-huge' is set, then the kernel type is specified.
If you use slackpkg to update, do the initial 'slackpkg upgrade-all' without including the generic kernel. Then do a second 'slackpkg upgrade-all' (just need to hit the up arrow key). This way results in the /boot/vmlinuz symlink pointing to the generic kernel rather than the huge kernel. Then make the new initrd and update the bootloader.
If you do it this way, do the System.map and config symlinks also point to their generic equivalents? Do they need to? Config probably not, but System.map?
If you install the generic kernel after the huge kernel, then the /boot/config and /boot/System.map symlinks will point to the generic kernel versions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.