Linux News
Linuxberg
Ext2.org
Filewatcher
Geeknews
Linuxnews.org
International
Linux Center
Click here to go to the Linux2000 homepage.

Upgrading to Kernel 2.2

This is a basic guide to upgrading to kernel 2.2.* series kernel. It also provides general guidance for compiling in software support for hardware devices in general. To upgrade to 2.2 you will need one of the later distributions such as Red Hat 5.2 and a number of packages still need to be upgraded. Mandrake users stop here! Mandrake have prepared a special set of packages together with a pre-compiled kernel binary in RPM format. You can find this here.

A detailed explanation of the commands can be found in the kernel HOWTO.

Intel Packages

http://www.kernel.org
For the latest kernels.
dhcpcd-1.3.16-0.i386.rpm
This package does not work with the 2.0.x kernels.
initscripts-3.78-2.4.i386.rpm
ipchains-1.3.8-0.i386.rpm
This package does not work with the 2.0.x kernels.
modutils-2.1.121-0.i386.rpm
This package does not work with the 2.0.x kernels.
net-tools-1.50-0.i386.rpm
procinfo-15-0.i386.rpm
samba-2.0.5a-0.5.2.i386.rpm
samba-client-2.0.5a-0.5.2.i386.rpm
util-linux-2.9-0.i386.rpm

Alpha Packages

http://www.kernel.org
For the latest kernels.
dhcpcd-1.3.16-0.alpha.rpm
This package does not work with the 2.0.x kernels.
initscripts-3.78-2.4.alpha.rpm
ipchains-1.3.8-0.alpha.rpm
This package does not work with the 2.0.x kernels.
modutils-2.1.121-0.alpha.rpm
net-tools-1.50-0.alpha.rpm
procinfo-15-0.alpha.rpm
samba-2.0.5a-0.5.2.alpha.rpm
samba-client-2.0.5a-0.5.2.alpha.rpm
util-linux-2.9-0.alpha.rpm

Sparc packages

http://www.kernel.org
For the latest kernels.
dhcpcd-1.3.16-0.sparc.rpm
This package does not work with the 2.0.x kernels.
initscripts-3.78-2.4.sparc.rpm
ipchains-1.3.8-0.sparc.rpm
This package does not work with the 2.0.x kernels.
modutils-2.1.121-0.sparc.rpm
net-tools-1.50-0.sparc.rpm
procinfo-15-0.sparc.rpm
samba-2.0.5a-0.5.2.sparc.rpm
samba-client-2.0.5a-0.5.2.sparc.rpm
util-linux-2.9-0.sparc.rpm

Making an emergency boot floppy

On 5.2 machines you can simply do this with the mkbootdisk command.

First find out what kernel, you are currently using. On my example 5.2 machine, I have the following in /etc/lilo.conf.


boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz-2.0.36-0.7
     label=linux
     root=/dev/hda10
     initrd=/boot/initrd-2.0.36-0.7.img
     read-only
     vga=ask
other=/dev/hda1
     label=dos
     table=/dev/hda

Find the image that you booted from. On a standard installation, it will be labeled linux. On mine the machine booted using the /boot/vmlinuz-2.0.36-0.7 kernel. Now put a formatted 1.44 floppy in your system. Make sure you have logged in as root.



# mkbootdisk --device /dev/fd0 2.0.36-0.7
Insert a disk in /dev/fd0. 
Any information on the disk will be lost.
Press <Enter> to continue or ^C to abort:

Reboot with the floppy to make sure it works properly!

We are now ready to upgrade the kernel support packages. You will need to be logged in as root to execute all of these commands.

Non Kernel Packages

The RPM packages should upgrade cleanly with the rpm command:




rpm -Uvh dhcpcd-1.3.16-0.i386.rpm
rpm -Uvh modutils-2.1.121-0.i386.rpm
rpm -Uvh initscripts-3.78-2.4.i386.rpm
rpm -Uvh net-tools-1.50-0.i386.rpm
rpm -Uvh ipchains-1.3.8-0.i386.rpm
rpm -Uvh procinfo-15-0.i386.rpm
rpm -Uvh samba-2.0.5a-0.5.2.i386.rpm
rpm -Uvh samba-client-2.0.5a-0.5.2.i386.rpm
rpm -Uvh util-linux-2.9-0.i386.rpm


Due to the growth in kernel source code, you will want to use bzip2. Make sure that the bzip rpm is installed (rpm -q bzip2). If not pull it off your install CD-ROM. Mount your cdrom, and do the following:



cd /mnt/cdrom
rpm -Uvh bzip2-0.9.0b-2.i386.rpm

This will allow you to uncompress the kernel sources ending in .tar.bz2 which are highly compressed code.

Sparc and Alpha Users

The Sparc and Alpha can be compiled with make zImage because the boot-code doesn't have to deal with the memory limits PCs have.

Compiling the 2.2 kernel

For this doc' we will be using the linux-2.2.6 kernel as an example:

login in as root. In our example the kernel tarball was downloaded into the /tmp directory.
We need to un-tar the source code in the "proper" directory. This is a kind of a workaround to allow for better tar ball management, so if you get 2.2.2 you wont accidently have 2.2.6 files intermingled with it.


cd /usr/src
rm linux
tar xzvf /tmp/linux-2.2.6.tar.gz
mv linux linux-2.2.5
ln -s linux-2.2.6 linux
cd /usr/src/linux
make mrproper
Configuring the kernel is the next step. Due to the growth in size of various modules, I recommend making the kernel as modular as possible. If you plan to make a static or monolithic kernel, you must be discriminatory on what you install in the kernel. Some people argue there is less to break on a static kernel.

make xconfig  # X graphical version
or
make menuconfig  # my favorite way
or
make config  # if you must

A sample .config file that you might want to try can be found at Due to the fact that every system is different, it is difficult to expand further than this. If you need further help, the Red Hat mailing lists can be extremely useful, or you can read the documentation contained in the kernel source tree itself.

Hopefully your kernel will compile without any problems. My advise is to compile with a lightly loaded machine. That is one preferably not running "X" whilst connected to the Internet, playing Quake2! The kernel will compile faster with more memory available.

Occassionally, you might get Signal 11 error. This is bad news, because on well tested software like the Linux kernel its likely to be indicative of some hardware problem. See this FAQ for more information.

Anyway these steps will compile the kernel for you.

make dep
make clean
make bzImage
# this is to make system modules
make modules
# this is to install them in /lib/modules/2.2.6
make modules_install
cd /usr/src/linux-2.2.6 (be in linux-2.2.6 dir)
cp arch/i386/boot/bzImage /boot/vmlinuz-2.2.6
cp System.map /boot/System.map-2.2.6
# put the kernel in the /boot partition/directory.
cd /boot
rm System.map
ln -s System.map-2.2.6 System.map

Initial Ramdisk

The final steps of the upgrade are to make the initial ram disk for your machine, and to ensure LILO to boots your new kernel. Edit the /etc/lilo.conf file.

(The purpose of the initial ram disk is to allow a modular kernel to have access to modules that it might need to boot from before the kernel has access to the device where the modules normally reside. This is usually required on systems with SCSI controllers).

To make this ramdisk, you will first need to find out what the kernel in /boot is called and then using the mkinitrd command.



# ls /boot/vmlinuz*
/boot/vmlinuz-2.0.36-0.7
/boot/vmlinuz-2.2.6



# mkinitrd /boot/initrd-2.2.6.img 2.2.6


We have successfully created the initial ram disk called /boot/initrd-2.2.6.img, and can proceed to editing the LILO files.

Setting up LILO

Edit LILO so it can find the new kernel image. Simple add an entry that follows this template:



image=/boot/vmlinuz-<kernel version goes here>
label=linux-test
root=<your root (/) partition goes here
initrd=/boot/initrd-<kernel version goes here>
read-only


On my example 5.2 machine, I made the following changes to the /etc/lilo.conf file.




# cat /etc/lilo.conf
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz-2.2.6
        label=test
        root=/dev/hda10
        initrd=/boot/initrd-2.2.6.img
        read-only
        vga=ask
image=/boot/vmlinuz-2.0.36-0.7
        label=linux.old
        root=/dev/hda10
        initrd=/boot/initrd-2.0.36-0.7.img
        read-only
        vga=ask
other=/dev/hda1
        label=dos
        table=/dev/hda


I made /boot/vmlinuz-2.2.6 the "default" boot kernel and called it test and the old kernel was renamed linux.old Please note in my example the root partition is /dev/hda10. This will most likely be different on your computer.

Finally, you will need to run the lilo to write these changes to the boot sector LILO is installed on.



# /sbin/lilo -v


You should be ready to reboot your machine with /sbin/shutdown -r now and the system will come up with the new kernel. Remember to remove the rescue floppy from the drive.


hosting by blueznet.com design © 1998-99 by webspinner.com