Page 1 of 1

HOWTO set up a choice of kernels on boot

Posted: 3. Sep 2012, 11:19
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

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

Posted: 3. Sep 2012, 13:38
by laprjns

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

Posted: 3. Sep 2012, 14:23
by mimosa
Thanks laprjns, that's what I imagined. No problem about the modules, then?

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

Posted: 3. Sep 2012, 14:38
by laprjns
I don't thinks so. Give it a try and see what happens.

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

Posted: 3. Sep 2012, 14:56
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!

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

Posted: 4. Sep 2012, 07:11
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.

Re: HOWTO set up a choice of kernels on boot

Posted: 4. Sep 2012, 10:14
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.

Re: HOWTO set up a choice of kernels on boot

Posted: 5. Sep 2012, 10:26
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.

Re: HOWTO set up a choice of kernels on boot

Posted: 5. Sep 2012, 10:54
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

Re: HOWTO set up a choice of kernels on boot

Posted: 5. Sep 2012, 11:48
by thenktor
AFAIK this is prefectly fine and you won't need the symlinks then. Nothing is pointing directly to vmlinuz & co.