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.
-I downloaded the following packages from current (more so to make sure that I can successfully install a new kernel, rather than letting them upgrade through slackpkg):
-Ran command: usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-4.4.172 >> /etc/lilo.conf (changing the kernel version to match the kernel I was installing).
-Ran command: lilo -v
-Rebooted.
I could successfully boot into the new kernel without a problem. The issue is that I can't boot into the old 5.15.19 kernel as I get a message saying that the kernel modules for that kernel aren't installed, even though I never uninstalled them and used installpkg to install the modules for the new kernel.
I'm sure that I'm missing something, but I'm not sure what.
Last edited by Bertman123; 02-12-2022 at 08:16 AM.
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 462
Rep:
I like to copy it to initrd-old.gz for safekeeping beforehand; nothing too fancy.
Anyway, mkinitrd-command-generator.sh can take a kernel command to regenerate it: $(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r /boot/vmlinuz-generic-5.15.19).
Last edited by pghvlaans; 02-12-2022 at 08:26 AM.
Reason: wrong syntax
I like to copy it to initrd-old.gz for safekeeping beforehand; nothing too fancy.
Anyway, mkinitrd-command-generator.sh can take a kernel command to regenerate it: $(/usr/bin/mkinitrd/mkinitrd-command-generator.sh -r -k /boot/vmlinuz-generic-5.15.19).
Can we have more that one initrd? If I do remake the initrd for the old kernel, how do I make it and keep the one for the new kernel?
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 462
Rep:
Sorry, I got the syntax wrong: it should be $(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r /boot/vmlinuz-generic-5.15.19).
I don't use lilo, but I imagine you'd need a separate entry for each kernel. As far as keeping the new kernel's initrd is concerned, maybe move it somewhere else, generate the 5.15 initrd, move that one somewhere else, and move the current initrd back.
Can we have more that one initrd? If I do remake the initrd for the old kernel, how do I make it and keep the one for the new kernel?
I don't know about the initrd as I don't use it myself aside from with the Slackware Kernel, but doing what pghvlaans said, and always backing up your old initrd first seems like a good procedure in general.
It looks like I can either boot into the old kernel or the new one. I re-ran the mkinitrd.sh command below for the 5.15.19 kernel and was able to boot into it, but then I was unable to boot into the 5.16.8 kernel so I re-ran the mkinitrd.sh command for the new kernel and was able to boot into the new kernel but unable to boot into the old kernel.
Both entries in lilo point to the same initrd file, so I'm assuming that is the problem. Can lilo be able to boot into two different kernels without re-running mkinitrd commands each time?
Can you have two different generic kernels and be able to boot into them using grub without re-running the commands?
It looks like I can either boot into the old kernel or the new one. I re-ran the mkinitrd.sh command below for the 5.15.19 kernel and was able to boot into it, but then I was unable to boot into the 5.16.8 kernel so I re-ran the mkinitrd.sh command for the new kernel and was able to boot into the new kernel but unable to boot into the old kernel.
Both entries in lilo point to the same initrd file, so I'm assuming that is the problem. Can lilo be able to boot into two different kernels without re-running mkinitrd commands each time?
Can you have two different generic kernels and be able to boot into them using grub without re-running the commands?
And the command from the mkinitrd command turns into emoticons. sigh.
And the command from the mkinitrd command turns into emoticons. sigh.
It's because you're using [quote][/quote] insted of [code][/code].
OT: Sure you can have multiple initrd.gz just rename it initrd-01.gz, initrd-02.gz, etc, and edit boot config file to reflect that.
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 462
Rep:
Quote:
Originally Posted by Bertman123
Can you have two different generic kernels and be able to boot into them using grub without re-running the commands?
It's pretty straightforward with GRUB, but running at least a couple of commands is more or less unavoidable. My basic procedure is:
Code:
cd /boot
ln -sf $(readlink vmlinuz-generic) vmlinuz-old # make a symlink to the currently-installed kernel
mv initrd.gz initrd-old.gz # Move the current initrd out of the way
installpkg new-kernel-here # Installs the new kernel, and makes a new vmlinuz-generic symlink
$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r vmlinuz-generic) # generate initrd for the new kernel
And that's pretty much it. The advantage is that there's no need to touch grub.cfg if the "linux" lines in both entries point to symlinks:
Code:
...
linux /boot/vmlinuz-generic root=...
initrd /boot/initrd.gz
...
...
linux /boot/vmlinuz-old root=...
initrd /boot/initrd-old.gz
Putting everything in a script is the way to go. No reason to type out all those commands every single time.
Both entries in lilo point to the same initrd file, so I'm assuming that is the problem. Can lilo be able to boot into two different kernels without re-running mkinitrd commands each time?
Code:
mkinitrd -c -k 5.16.8 -f ext4...
The problem is the -c option which clears the modules of the previous kernel from the initrd. If you leave that out, mkinitrd adds modules for the new kernel without removing the old ones.
It's because you're using insted of [code][/code].
OT: Sure you can have multiple initrd.gz just rename it initrd-01.gz, initrd-02.gz, etc, and edit boot config file to reflect that.
So when I run the command below, this is where I can rename the initrd?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.