HOWTO set up a choice of kernels on boot

Other talk about Salix
Post Reply
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

HOWTO set up a choice of kernels on boot

Post by mimosa »

I've never done this and would be grateful for any pointers.

I imagine you just install the packages and edit lilo.conf to point at two or more options in /boot.

Is there anything special you need to do to ensure the correct modules are used?

A friend asked me to put Salix on a hard disk for him, which he wants to use on any and every machine he's working on - he fixes people's computers. So it would be useful to offer a choice of kernels for single or multiple core, also perhaps the option of a more recent kernel, though I suppose I could then just not bother with the older one.

I'm going to put two installations on the disk, one per architecture. I might also add extra Salix editions.

EDIT See solution below
Last edited by mimosa on 3. Sep 2012, 14:56, edited 1 time in total.
User avatar
laprjns
Salix Warrior
Posts: 1105
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: How to set up a choice of kernels on boot

Post by laprjns »

“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to set up a choice of kernels on boot

Post by mimosa »

Thanks laprjns, that's what I imagined. No problem about the modules, then?
User avatar
laprjns
Salix Warrior
Posts: 1105
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: How to set up a choice of kernels on boot

Post by laprjns »

I don't thinks so. Give it a try and see what happens.
“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to set up a choice of kernels on boot

Post by mimosa »

Yes it worked. The only gotcha in the process is that installing the extra kernel overwrites the System.map, config and vmlinuz links in /boot, so it's good to rename those first. I was actually able to use lilosetup to inaugurate the new option - all that needed changing was it thought vmlinuz_smp was a third kernel. In fact it looks as though it doesn't even use the vmlinuz symlink.

The reason the modules are ok is they get put in appropriately named directories. I bet the same is true of kernel headers.

Code: Select all

vanilla[~]$ ls /lib/modules
2.6.37.6  2.6.37.6-smp
EDIT The kernel firmware also gets put in appropriately named directories - so different number kernels will be ok in that respect.

That was so easy to do I'm never going to do another kernel upgrade again without retaining the old files. Thanks again laprjns!
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: How to set up a choice of kernels on boot

Post by thenktor »

mimosa wrote:Yes it worked. The only gotcha in the process is that installing the extra kernel overwrites the System.map, config and vmlinuz links in /boot, so it's good to rename those first.
Those are only symlinks. Usually I just rename the newly installed files to more meaningful name (e.g. vmlinuz-3.3.5-my-kernel) and leave the symlinks for the original kernel.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: HOWTO set up a choice of kernels on boot

Post by mimosa »

But when I installed the new kernel (in this case, huge alongside smp) those symlinks were overwritten. So I suppose I'd do it the other way round - rename the links before installing the new kernel.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: HOWTO set up a choice of kernels on boot

Post by thenktor »

Actually the symlinks are not needed at all. But probably one entry in your lilo.conf uses these symlinks. That means this entry just boots the kernel the symlinks are pointing to.
Just make sure all installed kernels are available in lilo. If you do this by symlinks or by lilo.conf entries is not important.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: HOWTO set up a choice of kernels on boot

Post by mimosa »

lilosetup.conf already points directly at the kernel(s). But does anything point at config or System.map (which in turn point at the kernel)? Just out of interest, could I just delete all the symlinks? Here are the relevant bits of /boot and lilosetup.conf:

Code: Select all

vanilla[~]$ ls -l /boot | grep huge
-rw-r--r-- 1 root root 2124138 Apr 10  2011 System.map-huge-2.6.37.6
-rw-r--r-- 1 root root 2169190 Apr 10  2011 System.map-huge-smp-2.6.37.6-smp
lrwxrwxrwx 1 root root      24 Sep  3 11:37 System.map_huge -> System.map-huge-2.6.37.6
lrwxrwxrwx 1 root root      32 Sep  3 11:35 System.map_smp -> System.map-huge-smp-2.6.37.6-smp
-rw-r--r-- 1 root root  117019 Apr 10  2011 config-huge-2.6.37.6
-rw-r--r-- 1 root root  117494 Apr 10  2011 config-huge-smp-2.6.37.6-smp
lrwxrwxrwx 1 root root      20 Sep  3 11:37 config_huge -> config-huge-2.6.37.6
lrwxrwxrwx 1 root root      28 Sep  3 11:35 config_smp -> config-huge-smp-2.6.37.6-smp
-rw-r--r-- 1 root root 5523488 Apr 10  2011 vmlinuz-huge-2.6.37.6
-rw-r--r-- 1 root root 5719840 Apr 10  2011 vmlinuz-huge-smp-2.6.37.6-smp
lrwxrwxrwx 1 root root      21 Sep  3 11:37 vmlinuz_huge -> vmlinuz-huge-2.6.37.6
lrwxrwxrwx 1 root root      29 Sep  3 11:35 vmlinuz_smp -> vmlinuz-huge-smp-2.6.37.6-smp

Code: Select all

# Linux bootable partition config begins
image = /boot/vmlinuz-huge-2.6.37.6
root = /dev/disk/by-uuid/7486e789-c9e6-4672-8f12-6b8870e70593
label = Ratpoison_huge
read-only
# Linux bootable partition config ends
#
# Linux bootable partition config begins
image = /boot/vmlinuz-huge-smp-2.6.37.6-smp
root = /dev/disk/by-uuid/7486e789-c9e6-4672-8f12-6b8870e70593
label = Ratpoison_smp
read-only
# Linux bootable partition config ends
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: HOWTO set up a choice of kernels on boot

Post by thenktor »

AFAIK this is prefectly fine and you won't need the symlinks then. Nothing is pointing directly to vmlinuz & co.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
Post Reply