LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-13-2021, 10:06 AM   #1
tfrei
Member
 
Registered: Dec 2004
Location: Fargo
Distribution: slackware 14.2
Posts: 103

Rep: Reputation: 18
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?
 
Old 11-13-2021, 10:11 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
You can use the kexec command to switch kernels.
 
2 members found this post helpful.
Old 11-13-2021, 10:15 AM   #3
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,404

Rep: Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $NEW_KERNEL_VERSION
 
1 members found this post helpful.
Old 11-13-2021, 10:16 AM   #4
pghvlaans
Member
 
Registered: Jan 2021
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 459

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
You can make an initrd for any installed kernel by passing it to the script, e.g.:

Code:
$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r /boot/vmlinuz-generic)
 
1 members found this post helpful.
Old 11-13-2021, 10:20 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,404

Rep: Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337
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 members found this post helpful.
Old 11-13-2021, 10:25 AM   #6
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 508

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
I use the new geninitrd command in -current.

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.
 
1 members found this post helpful.
Old 11-13-2021, 10:51 AM   #7
tfrei
Member
 
Registered: Dec 2004
Location: Fargo
Distribution: slackware 14.2
Posts: 103

Original Poster
Rep: Reputation: 18
Thanks for the helpful suggestions. I'll start working with them.
 
Old 11-14-2021, 12:32 AM   #8
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 577

Rep: Reputation: Disabled
Question

Quote:
Originally Posted by hazel View Post
You can use the kexec command to switch kernels.
Do you mean something like this?
https://www.linux.com/training-tutor...kexec-example/
 
Old 11-14-2021, 12:54 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
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.
 
4 members found this post helpful.
Old 11-14-2021, 02:19 AM   #10
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,979

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by tfrei View Post
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.
 
1 members found this post helpful.
Old 11-14-2021, 01:44 PM   #11
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,267
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
Quote:
Originally Posted by chrisretusn View Post
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.
Or even more simply, and no kernel blacklisting (in case you DO need to boot huge for recovery):
Code:
# slackpkg update
# slackpkg install-new
# slackpkg upgrade-all
# slackpkg clean-system
# mkinitrd -c -k 5.15.2 -m ext4 -f ext4 /dev/nvme0n1p2
Note: My boot drive is NVME and filesystem is ext4. You really don't need much else or need to stuff mkinitrd.conf full of extras.

Now just copy initrd.gz and kernel-generic -> vmlinuz to /boot/efi/EFI/Slackware/ and reboot. My elilo.conf is simply:
Code:
chooser=simple
delay=1
timeout=1
#
image=vmlinuz
        label=slackware
        initrd=initrd.gz
        read-only
        append="root=/dev/nvme0n1p2 vga=normal ro acpi_enforce_resources=lax"
Note: 'acpi_enforce_resources=lax" is a workaround to get sensors working on the AMD Ryzen X570 motherboard, discussed here: https://www.linuxgalaxy.org/kingbeow...e-8688-sensor/

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.
 
1 members found this post helpful.
Old 11-14-2021, 05:47 PM   #12
tfrei
Member
 
Registered: Dec 2004
Location: Fargo
Distribution: slackware 14.2
Posts: 103

Original Poster
Rep: Reputation: 18
Thanks again for the help to everybody.
 
Old 11-14-2021, 06:36 PM   #13
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Quote:
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.
 
Old 11-14-2021, 07:06 PM   #14
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,191

Rep: Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770Reputation: 1770
Quote:
Originally Posted by allend View Post
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?
 
Old 11-14-2021, 08:27 PM   #15
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] UEFI laptop won't reboot after attempted kernel upgrade (-current) semiprime Slackware 20 01-28-2021 04:15 PM
How to update Kernel in centos 5.7 version to centos kernel version 6.2 jayakumar01 Linux - Server 4 09-13-2012 12:49 AM
[SOLVED] Slackware-current need a double reboot command to really reboot the system sardinha Slackware 11 09-12-2012 03:19 PM
[SOLVED] Please upgrade Operating System version to 2.6.5-7.97-bigsmp - the current version is panneer_dxb Linux - Kernel 1 04-10-2011 03:16 PM
reboot freezes after yast update run, reboot for kernel update sparkbot Linux - Software 2 11-15-2006 06:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration