A. How to upgrade your kernel?


LINUX NEWBIE ADMINISTRATOR GUIDE
ver. 0.194 2003-06-04 by Stan, Peter and Marie Klimas
The latest version of this guide is available at http://linux-newbie.sunsite.dk.
Copyright (c) <1999-2003> by Peter and Stan Klimas. Your feedback, comments, corrections, and improvements are appreciated. Send them to linux_nag@canada.com This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0, 8 or later http://opencontent.org/openpub/ with the modification noted in lnag_licence.html.


Appendix.
Kernel Upgrade - version 1.1.2
October 11th 1999
All contents of this page were written by Alesh Mustar.
Distributed under the General Public Licence http://www.gnu.org/copyleft/gpl.html. Your feedback, comments, corrections, and improvements are appreciated. Comment specific to this page: alesh@jpdesign.net
Contents:
A.1 Introduction
A.2 What is kernel?
A.3 Why upgrade?
A.4 Where can I get the new kernel?
A.5 Should I download full source or the patch only?
A.6 Unpacking the download file
   A.6.1 Unpacking the patch
   A.6.2 Unpacking the full source
A.7 Compiling new kernel
   A.7.1 Using the patch
   A.7.2 Using the full source
A.8 Installing the new kernel
A.9 What about next kernel upgrade?
A.10 Notice for Red Hat users
A.11 About the author
A.12 Changes

A.1 Introduction

This document was written to help the new users of Linux upgrade their kernel. I used various sources for writting this document. From the official HOW-TOs ( http://metalab.unc.edu/LDP/HOWTO/ ) to the  Linux Knowledge Base  and other sources.

A.2 What is kernel?

The kernel acts as a mediator between your programs and your hardware. First, it does (or arranges for) the memory management for all of the running programs (processes), and makes sure that they all get a fair (or unfair, if you please) share of the processor's cycles. In addition, it provides a nice, fairly portable interface for programs to talk to your hardware. There is certainly more to the kernel's operation than this, but these basic functions are the most important to know.

A.3 Why upgrade?

There are several reasons to upgrade your kernel. Most of the reasons are that you perhaps need a new device driver for your new or old hardware (the previous device driver could have had a bug somewhere) or you need to upgrade due to a bug in the kernel (security one or a non-security one). Usually new kernels run faster than the old ones and are more stable and reliable.

A.4 Where can I get the new kernel?

First you need to get the new kernel. Start a browser (any kind) and point it to http://www.kernel.org/ . There you can find a list of mirrors. Mirrors are sites with the (mostly) same information as the main site. Since the main kernel.org site is heavily overloaded with downloads choose a mirror site closest to you or even the one located in your country. For example: to get the new kernel from Norway point your browser to the .no kernel archive => http://www.no.kernel.org/ . Notice the .no after the www string. Lots of countries have mirrors for the kernel archive.
Once the mirror page loads you will find information on that page which looks like this:
<= start of example page=>
The Linux Kernel Archives mirror at Sunsite.uio.no

All transfers are logged. If you don't like this policy please disconnect now.

Welcome to the Linux Kernel Archives. This is an official mirror site for the Linux kernel source. Please see http://www.kernel.org/mirrors/ for information about how to connect to an other kernel-mirror site.

 

Protocol
URL 
HTTP 
http://linux-kernel.uio.no/pub/
FTP 
ftp://linux-kernel.uio.no/pub
What is Linux?Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX compliance.
...
<= end of example page=>

Now choose a protocol which suits you better to transfer the files. Let's say we will choose HTTP protocol (same protocol as your WWW browser uses).
Your browser will display a page with a directory structure, perhaps similar to this:

<= start of example page =>

Index of /pub

Name Last modified Size Description
_________________________________________________________________________________________________________

[DIR] Parent Directory 28-Dec-98 12:06 -
[DIR] linux/ 31-Dec-98 09:57 -
[ ] ls-lR 29-Mar-99 14:56 262k
[DIR] software/ 31-Dec-98 18:25 -

<= end of example page =>

Note the linux directory. Point your browser at it. A page like this will show:

<= start of example page =>

Index of /pub/linux

Name Last modified Size Description
_________________________________________________________________________________________________________

[DIR] Parent Directory 29-Mar-99 14:56 -
[DIR] daemons/ 12-Feb-99 01:19 -
[DIR] devel/ 18-Dec-98 19:34 -
[DIR] distributions/ 18-Dec-98 19:34 -
[DIR] docs/ 31-Jan-99 04:01 -
[DIR] kernel/ 18-Mar-99 21:55 -
[DIR] libs/ 18-Dec-98 19:35 -
[DIR] utils/ 31-Jan-99 04:01 -

<= end of example page =>

This site contains lots of things to download but currently we are only interested in the kernel. Point your browser at the kernel directory.
Something like this should show:

<= start of example page =>

Index of /pub/linux/kernel

Name Last modified Size Description
_________________________________________________________________________________________________________

[DIR] Parent Directory 31-Dec-98 09:57 -
[ ] COPYING 13-Mar-94 00:00 18k
[ ] CREDITS 16-Sep-96 00:00 36k
[DIR] Historic/ 18-Dec-98 20:55 -
[DIR] SillySounds/ 18-Dec-96 09:45 -
[DIR] alan/ 18-Mar-99 21:55 -
[DIR] davem/ 29-Jan-99 04:05 -
[DIR] hpa/ 19-Dec-98 02:16 -
[DIR] people/ 18-Mar-99 21:55 -
[DIR] testing/ 27-Mar-99 00:55 -
[DIR] v1.0/ 19-Dec-98 02:19 -
[DIR] v1.1/ 19-Dec-98 03:51 -
[DIR] v1.2/ 19-Dec-98 04:36 -
[DIR] v1.3/ 19-Dec-98 13:21 -
[DIR] v2.0/ 11-Feb-99 16:48 -
[DIR] v2.1/ 11-Feb-99 16:45 -
[DIR] v2.2/ 24-Mar-99 00:27 -
[DIR] whawes/ 18-Dec-98 19:34 -
________________________________________________________________________________________________
 

Linux kernel release 2.0.xx

These are the release notes for linux version 2.0. Read them carefully,
as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong.
...
....

<= end of example page =>

For our example we will take in consideration that while writting this the kernel version 2.2.x series is the stable version. That's why we choose the v2.2/ directory on the server.
How do you know which is the latest version? At the bottom of the http://www.kernel.org/ page you have a text like this:

<= start of example page =>

 

The latest stable version of the Linux kernel is: 
2.2.12 
The latest beta version of the Linux kernel is: 
2.3.20 
The latest prepatch (alpha) version appears to be: 
none 
<= end of example page =>

That is your information to find out which is the latest stable kernel and which one is also recomended to use. Also as you will see you can usualy see a file with the name like LATEST-IS-2.2.12 at the top of the directory listing which tells you the latest version.

Once that we are in the v2.2/ directory on our server we will see something like this:

<= start of example page =>

Index of /pub/linux/kernel/v2.2

Name Last modified Size Description
_________________________________________________________________________________________________________

[DIR] Parent Directory 16-Aug-99 09:13 -
[ ] LATEST-IS-2.2.12 26-Aug-99 02:45 0k
[ ] linux-2.2.0.tar.bz2 26-Jan-99 02:41 10.1M
[ ] linux-2.2.0.tar.bz2.s..26-Jan-99 02:41 1k
[CMP] linux-2.2.0.tar.gz 26-Jan-99 02:41 12.5M
[ ] linux-2.2.0.tar.gz.sign26-Jan-99 02:41 1k
[ ] linux-2.2.1.tar.bz2 28-Jan-99 21:56 10.1M
[ ] linux-2.2.1.tar.bz2.s..28-Jan-99 21:56 1k
[CMP] linux-2.2.1.tar.gz 28-Jan-99 21:56 12.5M
[ ] linux-2.2.1.tar.gz.sign28-Jan-99 21:56 1k
[ ] linux-2.2.10.tar.bz2 14-Jun-99 07:33 10.8M
[ ] linux-2.2.10.tar.bz2...14-Jun-99 07:33 1k
[CMP] linux-2.2.10.tar.gz 14-Jun-99 07:33 13.3M
[ ] linux-2.2.10.tar.gz.s..14-Jun-99 07:33 1k
[ ] linux-2.2.11.tar.bz2 10-Aug-99 01:03 11.2M
[ ] linux-2.2.11.tar.bz2...10-Aug-99 01:03 1k
[CMP] linux-2.2.11.tar.gz 10-Aug-99 01:03 13.8M
[ ] linux-2.2.11.tar.gz.s..10-Aug-99 01:03 1k
[ ] linux-2.2.12.tar.bz2 26-Aug-99 02:45 11.5M
[ ] linux-2.2.12.tar.bz2...26-Aug-99 02:45 1k
[CMP] linux-2.2.12.tar.gz 26-Aug-99 02:45 14.2M
[ ] linux-2.2.12.tar.gz.s..26-Aug-99 02:45 1k
[ ] linux-2.2.2.tar.bz2 23-Feb-99 03:58 10.1M
[ ] linux-2.2.2.tar.bz2.s..23-Feb-99 03:58 1k
[CMP] linux-2.2.2.tar.gz 23-Feb-99 03:58 12.5M
[ ] linux-2.2.2.tar.gz.sign23-Feb-99 03:58 1k
[ ] linux-2.2.3.tar.bz2 09-Mar-99 01:42 10.2M
[ ] linux-2.2.3.tar.bz2.s..09-Mar-99 01:42 1k
[CMP] linux-2.2.3.tar.gz 09-Mar-99 01:42 12.6M
[ ] linux-2.2.3.tar.gz.sign09-Mar-99 01:42 1k
[ ] linux-2.2.4.tar.bz2 23-Mar-99 23:33 10.4M
[ ] linux-2.2.4.tar.bz2.s..23-Mar-99 23:33 1k
[CMP] linux-2.2.4.tar.gz 23-Mar-99 23:33 12.8M
[ ] linux-2.2.4.tar.gz.sign23-Mar-99 23:33 1k
[ ] linux-2.2.5.tar.bz2 29-Mar-99 08:54 10.4M
[ ] linux-2.2.5.tar.bz2.s..29-Mar-99 08:54 1k
[CMP] linux-2.2.5.tar.gz 29-Mar-99 08:54 12.9M
[ ] linux-2.2.5.tar.gz.sign29-Mar-99 08:54 1k
[ ] linux-2.2.6.tar.bz2 16-Apr-99 23:46 10.5M
[ ] linux-2.2.6.tar.bz2.s..16-Apr-99 23:46 1k
[CMP] linux-2.2.6.tar.gz 16-Apr-99 23:46 13.0M
[ ] linux-2.2.6.tar.gz.sign16-Apr-99 23:46 1k
[ ] linux-2.2.7.tar.bz2 28-Apr-99 20:42 10.6M
[ ] linux-2.2.7.tar.bz2.s..28-Apr-99 20:42 1k
[CMP] linux-2.2.7.tar.gz 28-Apr-99 20:42 13.0M
[ ] linux-2.2.7.tar.gz.sign28-Apr-99 20:42 1k
[ ] linux-2.2.8.tar.bz2 11-May-99 21:59 10.7M
[ ] linux-2.2.8.tar.bz2.s..11-May-99 21:59 1k
[CMP] linux-2.2.8.tar.gz 11-May-99 21:59 13.2M
[ ] linux-2.2.8.tar.gz.sign11-May-99 21:59 1k
[ ] linux-2.2.9.tar.bz2 14-May-99 01:54 10.7M
[ ] linux-2.2.9.tar.bz2.s..14-May-99 01:54 1k
[DIR] Parent Directory 16-Aug-99 09:13 -
[ ] LATEST-IS-2.2.12 26-Aug-99 02:45 0k
[ ] linux-2.2.0.tar.bz2 26-Jan-99 02:41 10.1M
[ ] linux-2.2.0.tar.bz2.s..26-Jan-99 02:41 1k
[CMP] linux-2.2.0.tar.gz 26-Jan-99 02:41 12.5M
[ ] linux-2.2.0.tar.gz.sign26-Jan-99 02:41 1k
[ ] linux-2.2.1.tar.bz2 28-Jan-99 21:56 10.1M
[ ] linux-2.2.1.tar.bz2.s..28-Jan-99 21:56 1k
[CMP] linux-2.2.1.tar.gz 28-Jan-99 21:56 12.5M
[ ] linux-2.2.1.tar.gz.sign28-Jan-99 21:56 1k
[ ] linux-2.2.10.tar.bz2 14-Jun-99 07:33 10.8M
[ ] linux-2.2.10.tar.bz2...14-Jun-99 07:33 1k
[CMP] linux-2.2.10.tar.gz 14-Jun-99 07:33 13.3M
[ ] linux-2.2.10.tar.gz.s..14-Jun-99 07:33 1k
[ ] linux-2.2.11.tar.bz2 10-Aug-99 01:03 11.2M
[ ] linux-2.2.11.tar.bz2...10-Aug-99 01:03 1k
[CMP] linux-2.2.11.tar.gz 10-Aug-99 01:03 13.8M
[ ] linux-2.2.11.tar.gz.s..10-Aug-99 01:03 1k
[ ] linux-2.2.12.tar.bz2 26-Aug-99 02:45 11.5M
[ ] linux-2.2.12.tar.bz2...26-Aug-99 02:45 1k
[CMP] linux-2.2.12.tar.gz 26-Aug-99 02:45 14.2M
[ ] linux-2.2.12.tar.gz.s..26-Aug-99 02:45 1k
[ ] linux-2.2.2.tar.bz2 23-Feb-99 03:58 10.1M
[ ] linux-2.2.2.tar.bz2.s..23-Feb-99 03:58 1k
[CMP] linux-2.2.2.tar.gz 23-Feb-99 03:58 12.5M
[ ] linux-2.2.2.tar.gz.sign23-Feb-99 03:58 1k
[ ] linux-2.2.3.tar.bz2 09-Mar-99 01:42 10.2M
[ ] linux-2.2.3.tar.bz2.s..09-Mar-99 01:42 1k
[CMP] linux-2.2.3.tar.gz 09-Mar-99 01:42 12.6M
[ ] linux-2.2.3.tar.gz.sign09-Mar-99 01:42 1k
[ ] linux-2.2.4.tar.bz2 23-Mar-99 23:33 10.4M
[ ] linux-2.2.4.tar.bz2.s..23-Mar-99 23:33 1k
[CMP] linux-2.2.4.tar.gz 23-Mar-99 23:33 12.8M
[ ] linux-2.2.4.tar.gz.sign23-Mar-99 23:33 1k
[ ] linux-2.2.5.tar.bz2 29-Mar-99 08:54 10.4M
[ ] linux-2.2.5.tar.bz2.s..29-Mar-99 08:54 1k
[CMP] linux-2.2.5.tar.gz 29-Mar-99 08:54 12.9M
[ ] linux-2.2.5.tar.gz.sign29-Mar-99 08:54 1k
[ ] linux-2.2.6.tar.bz2 16-Apr-99 23:46 10.5M
[ ] linux-2.2.6.tar.bz2.s..16-Apr-99 23:46 1k
[CMP] linux-2.2.6.tar.gz 16-Apr-99 23:46 13.0M
[ ] linux-2.2.6.tar.gz.sign16-Apr-99 23:46 1k
[ ] linux-2.2.7.tar.bz2 28-Apr-99 20:42 10.6M
[ ] linux-2.2.7.tar.bz2.s..28-Apr-99 20:42 1k
[CMP] linux-2.2.7.tar.gz 28-Apr-99 20:42 13.0M
[ ] linux-2.2.7.tar.gz.sign28-Apr-99 20:42 1k
[ ] linux-2.2.8.tar.bz2 11-May-99 21:59 10.7M
[ ] linux-2.2.8.tar.bz2.s..11-May-99 21:59 1k
[CMP] linux-2.2.8.tar.gz 11-May-99 21:59 13.2M
[ ] linux-2.2.8.tar.gz.sign11-May-99 21:59 1k
[ ] linux-2.2.9.tar.bz2 14-May-99 01:54 10.7M
[ ] linux-2.2.9.tar.bz2.s..14-May-99 01:54 1k

<= end of example page =>

A.5 Should I download full source or the patch only?

Now you have a choice to download either the patch or the full source.
If you're upgrading from 2.0.x kernel series you will have to download the full source.
If you're upgrading a 2.2.x kernel series you can download only the patch, which is of course much smaller than the full source. The patch contains only the differences.
If you would like more detailed info on patches and diff take a look at this link: http://www.linuxpower.org/display_item.phtml?id=101 .
Now grab your choice and download it. I highly suggest you download it to /usr/src/ directory.
I suggest downloading the file with the .tar.gz extension (if you're downloading the full source). For patches I suggest .bz2 extension. The examples which follow assume these file types.

A.6 Unpacking the download file

A.6.1 Unpacking the patch

We are assuming that you downloaded the patch into /usr/src/ directory. For our example let's say the patch filename is patch-2.2.12.bz2. Before using it we must first unpack it. .bz2 extension is bunzip2 format. By using the following command we unpack the file:

<= start of example command =>

bunzip2 patch-2.2.12.bz2

<= end of example command =>

No visual output will be shown. Check what files are located in the directory now. You will notice that the patch-2.2.12.bz2 file is gone and patch-2.2.12 is there of a much bigger size.

A.6.2 Unpacking the full source

Again we are assuming that you downloaded the full source into /usr/src/ directory. For our example let's say the source filename is linux-2.2.12.tar.gz.
Before even upacking it we must first do something else. In /usr/src/ you have a symbolic link named linux which points to for example at linux-2.0.36. How can you check that out? Type ls -al in the /usr/src/ directory. You'll see something like this:

<= start of example page =>

total 7295
drwxr-xr-x 5 root root 1024 Mar 19 15:01 .
drwxr-xr-x 20 root root 1024 Mar 13 22:52 ..
lrwxrwxrwx 1 root root 11 Mar 15 18:21 linux -> linux-2.0.36
drwxr-xr-x 17 root root 1024 Mar 13 22:52 linux-2.0.36
...

<= end of example page =>

Notice the lrwxrwxrwx 1 root root 11 Mar 15 18:21 linux -> linux-2.0.36 which is the symbolic link pointing to linux-2.0.36 directory.
If we would unpack the kernel source now, by default it would be unpacked into the linux directory overwriting our previous source.
Let's delete the link by typing rm linux. It only removes the link, not the directory!
Now let's unpack the source. Type tar -xvzf linux-2.2.12.tar.gz. Lots of text will fly by. If you do a ls -al now you'll notice the linux directory. That is our new kernel source directory.

A.7 Compiling new kernel

A.7.1 Using the patch

If you downloaded the patch you will need to go through this section.We are assuming right now that you are located in /usr/src/ directory. We have unpacked the patch (Section A.6.1). Now we will move to the kernel directory (assuming linux). Type cd linux.
Now we are located in the kernel directory. At this point we have a lot of options and questions. Is this your first patch of the kernel? No? Yes? We won't go into details and we will assume that this is your first kernel patch. Now we are ready to patch the kernel.
To do this we will use the patch utility. For more detail and wider information about this I suggest checking out the article from the www.linuxpower.org web site, located at this url:  http://www.linuxpower.org/display_item.phtml?id=101 .
Type patch -E -p1 < ../patch-2.2.12
Lots of text will fly by. If it doesn't stop anywhere but only at the end (otherwise it will be asking you a question) everything went ok. If not, then you might have a problem (you already patched a kernel once, or something went really really wrong).
If everything went ok read on. Now it's time to configure the kernel and then compile it. We now have 2 choices. One is to compile the new kernel totally from scratch, the other one is to just re-compile it using the old configuration. Since you used the patch we are assuming that you're going to compile with the old configuration. If you don't wish to, read section 6.2 where we compile the kernel from scratch and use the steps there. The only difference is in step 1, where you should type make menuconfig.
This is the re-compile of the kernel using the old configuration. Follow these steps:
1. type make oldconfig
At this point you could have been asked for new drivers and development ones. Unless you really need them answer no (n).
2. type make dep
3. type make clean
4. type make zImage  (if this fails use bzImage, which stands for big zImage)
5. type make modules (if you enabled them)
6. type make modules_install (if you typed #5)

If everything went ok, we have a new kernel, ready to be installed and used on the system.

A.7.2 Using the full source

If you downloaded the full source you will need to go through this section.
We are assuming right now that you are located in /usr/src/ directory. We have unpacked the new kernel (Section A.6.2). Now we will move to the kernel directory (assuming linux). Type cd linux.
Now we are located in the kernel directory. Now let's start our fresh compile.
1. type make menuconfig
Here you will have to configure your kernel. We won't go into details or explanations here since the configuration is different from machine to machine. Go through the configuration wisely and if you don't know what something is, rather leave it in then putting it out of the configuration.
2. type make dep
3. type make clean
4. type make zImage  (if this fails use bzImage, which stands for big zImage)
5. type make modules (if you enabled them)
6. type make modules_install (if you typed #5)

If everything went ok, we have a new kernel, ready to be installed and used on the system.

A.8 Installing the new kernel

Installing the new kernel takes a knowledge of editing the lilo.conf file located in the /etc/ directory. I will state now that lilo.conf differs from machine to machine and it might not look the same on your machine as it does on my machines.
First of all, we will assume that you are still in the /usr/src/linux/ directory. We will have to copy the new kernel and System.map to certain location which again is different on some distributions.
Let's change directory to the new kernel.
Type cd /arch/i386/boot/
Type ls -al just to see what's there. You'll see something like this:

<= start of example page =>

total 588
drwxr-xr-x   4 1046     1046         1024 Apr  5 20:54 .
drwxr-xr-x   7 1046     1046         1024 Mar 13 02:39 ..
-rw-r--r--   1 1046     1046         2633 Jan  2 19:27 Makefile
-rwxr-xr-x   1 root     root          544 Apr  5 20:54 bootsect
-rw-r--r--   1 1046     1046         9536 Jun 24  1998 bootsect.S
-rw-r--r--   1 root     root         1238 Apr  5 20:54 bootsect.o
-rw-r--r--   1 root     root         8293 Apr  5 20:54 bootsect.s
drwxr-xr-x   2 1046     1046         1024 Apr  5 20:54 compressed
-rw-r--r--   1 1046     1046          904 Jan  3  1995 install.sh
-rwxr-xr-x   1 root     root         1428 Apr  5 20:54 setup
-rw-r--r--   1 1046     1046        20136 Nov 29 02:18 setup.S
-rw-r--r--   1 root     root         3053 Apr  5 20:54 setup.o
-rw-r--r--   1 root     root        24136 Apr  5 20:54 setup.s
drwxr-xr-x   2 1046     1046         1024 Apr  5 20:54 tools
-rw-r--r--   1 1046     1046        36836 Sep 30  1998 video.S
-rw-r--r--   1 root     root       477285 Apr  5 20:54 zImage

<= end of example page =>

If, at section A.7.x, you used make zImage you should copy the zImage file, otherwise copy the bzImage file. We will assume zImage.
The option which we encounter now is where to copy the kernel. On Red Hat distributions the kernel is located in /boot/ on Slackware in / . I'm not very familiar with other distributions (Debian, SuSe, etc.). Depending on your distribution make your choice where you will copy the new kernel.
We will make an example for Red Hat.
Type cp zImage /boot/vmlinuz-2.2.12

Now change the directory back to /usr/src/linux/ .
Type cd /usr/src/linux/ .

Now let's copy the new System.map. Please note that System.map is always located in /boot/ .
Type cp System.map /boot/System.map-2.2.12

Now we have to make a new symbolic link which points to the new System.map.
First change the directory to /boot by typing cd /boot .
Now delete the old symbolic link (note that deleting the symbolic link only deletes the link, not also the file or directory to which it points). Type rm System.map .
Now let's create a new symbolic link which points to our new System.map-2.2.12. Type ln -s System.map-2.2.12 System.map .

All we have to do now is to edit the lilo.conf file, add our new kernel in there and run lilo.
Let's change directory to /etc by typing cd /etc . With your favourite editor (vi, joe, pico) edit the lilo.conf file. For our example we will use joe.
You will see something like this in your file :

= start of example page =>

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz-2.0.36-0.7
        label=linux.old
        root=/dev/hda1
        read-only

<= end of example page =>

Please note that this can and probably is different on your system.
Now we will add the new kernel to our lilo.conf file. Copy the part from image to the end and paste it before the current image. You should get something like this:

= start of example page =>

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz-2.0.36-0.7
        label=linux.old
        root=/dev/hda1
        read-only
image=/boot/vmlinuz-2.0.36-0.7
        label=linux.old
        root=/dev/hda1
        read-only

<= end of example page =>

Now change the pasted part to the settings and version(s) of your new kernel. For our example (we use the 2.2.4 kernel) it looks like this:

= start of example page =>

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz-2.2.12
        label=linux
        root=/dev/hda1
        read-only
image=/boot/vmlinuz-2.0.36-0.7
        label=linux.old
        root=/dev/hda1
        read-only

<= end of example page =>

We changed the label part, the image part, everything else stayed that same.
I won't explain the basics of the lilo.conf file, since it's very well described in the  LILO How-To .

Now run lilo by simply typing that. You should see something like this (more or less exactly this):

= start of example page =>

Added linux *
Added linux.old

<= end of example page =>

You can now reboot your machine to the new kernel.

A.9 What about next kernel upgrade?

Well everything should be the same only one thing not. If you will be patching the kernel you will first have to remove the old patch before applying the new one. This is done by first typing patch -R -p1 < ../patchfile  (where patchfile is the name of the old patch) and then applying the new patch with the -E switch. Everything else should be the same.

A.10 Notice to Red Hat users

Red Hat users should note this. If you're upgrading your kernel from the 2.0.xx series to 2.2.x series you must read this. The document states similar to this one, step by step how to upgrade certain system specific things like init, samba, etc.. which for such upgrade is neccesary.
If there are similar issues for other distributions, please let me know. It would be nice if you could point me to a certain document with information about it.

A.11 About the author

My name is Alesh Mustar, I'm 20 years old, living in Slovenia, Europe working as a programmer and system administrator. Beside spending lots of time behind the computer screen(s) I like spending time with my girlfriend Tanja, reading books and driving around with my car. I can be contacted at the email address which is at the top of the page. Comments, suggestions or anything else is more then just welcome.

A.12 Changes

Version 1.1.0 - minor changes, some typo errors fixed and some kernel numbers repairs.
Version 1.1.1 - a couple of typos corrected.
Version 1.12. - corrected some typos pointed out by Jo.
Go back to top: Linux Newbie Administrator Guide (LNAG)