Linux Gazette Article

In August 1998, Linux Gazette published this short reply to a reader's question:

Re: Suggestion for Article, simultaneous versions of Kernels

Date: Wed, 01 Jul 1998 10:39:21 +0100
From: Hans-Georg Esser, esser@i2.informatik.rwth-aachen.de (This address is void now.)

From: Renato Weiner, reweiner@yahoo.com
Recently I was looking at the Gazette and I think I have a good suggestion of an article that will be very useful for the Linux community. I have had some technical difficulties of having two simultaneous versions of Kernels in my system. I mean a stable one and a developing one. I searched the net looking for information of how to co-exist both but it's completely fragmented. If somebody more experienced could put all this information together, it will certainly help a lot of people from kernels developers to end-users.
Let me state the following:

HOW TO HAVE COEXISTING KERNELS

First let me assume that, with "coexisting kernels", you meant to have several different kernels (with different kernel numbers such as 2.0.34 and 2.1.101) each of which can be chosen at boot time to be started. (The point is: I suppose, you don't want to simultaneously __run__ different kernels, which of course is impossible.)

So, all you have to do is this:

For each kernel you want to use, get the kernel sources, e.g. as .tgz file, cd to /usr/src, do a

 
  tar xzf ../where/ever/it/is/package.tgz
then cd to /usr/src/linux-2.0.34 (e.g.) and do the ordinary kernel configuration / compilation, i.e.
 
  make config  (or menuconfig or xconfig, whatever you like)
  make zImage modules modules_install
  cp arch/i386/boot/zImage /linux-2.0.34  (e.g.)
The last bit of the make will generate a directory /lib/modules/2.0.34 (e.g.) where the modules are put.

Then edit the /etc/lilo.conf. Copy the parts that configure your "normal" system start and change the name of the configuration. Also change the name of the kernel binary to /linux-2.0.34 (e.g.).

Then proceed with the next kernel in identic behaviour. Nothing can be overwritten during this process, because all of the kernel compilation is done in its separate directory /usr/src/linux-2.x.y, and all the generated modules will be put in a separate directory /lib/modules/2.x.y, and your zImage copy (residing in /) will have a new name, as you have used an other kernel version.

When you're through with all your kernel versions and have added the last portion to the /etc/lilo.conf file do a

 
  lilo
at the prompt which will make lilo reinstall the boot manager with the changed values. Now reboot, press [TAB] at the LiLo prompt and choose a kernel to use. If you followed these steps, you will not have deleted your original entry in /etc/lilo.conf, so if none of your newly compiled kernels can boot properly, you can still boot the old kernel.

Hope it helps,

H.-G. Esser


Read the original at Linux Gazette.
Hans-Georg Eßer
Last modified: Tue Nov 16 16:39:25 CET 1999