Help File Library: Updating a Kernel
By: rpmilius
I had Red Hat Linux 6.1 with the 2.2.12-20 kernel installed. For various reasons, I wanted to update the kernel to 2.2.13.
I performed the following steps, which seem to have
worked.
- Download the latest stable kernel from www.kernel.org
into your home directory.
- Type the following commands
su -
cd /usr/src
ls -l
This showed that /usr/src/linux was a link to /usr/src/linux-2.2.12-20, the current kernel.
- Type:
rm /usr/src/linux
tar xzvf ~home/linux-2.2.13.tar.gz
This last command creates a new Linux
sub directory containing new kernel source files
- Now type:
mv /usr/src/linux /usr/src/linux-2.2.13
ln -s /usr/src/linux-2.2.13 /usr/src/linux
This ln command links the linux directories just as in the prior configuration, for consistancy's sake.
- After linking the new kernel directory to /usr/src/linux, type:
cd /usr/src/linux
- If you haven't done so, be sure to read through the README file, which explains the make
commands you're about to enter:
make mrproper
This preserves the previous configuration options
- Type
cp /usr/src/linux-2.2.12-20/.config /usr/src/linux
make oldconfig
When prompted, enter m to make a module for
new options
- Type:
make dep
make bzImage
make modules
make modules_install
cd /boot
ls -l
This last command shows that old System.map is now a link to System.map-2.2.12-20 and that the old vmlinuz is a link to linuz-2.2.12.20
- Enter these commands:
rm /boot/System.map
rm /boot/vmlinuz
This will copy the newly created kernel and system.map to /boot
- Type
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.13
ln -s /boot/vmlinuz-2.2.13 /boot/vmlinuz
cp /usr/src/linux/System.map /boot/System.map-2.2.13
ln -s /boot/System.map-2.2.13 /boot/System.map
- Create /boot/initrd.2.2.13.img by typing:
/sbin/mkinitrd /boot/initrd-2.2.13.img 2.2.13
- Edit the /etc/lilo.conf by copying the linux section
and giving it a new label and updating the image and intitrd files. An example lilo.conf file appearers here:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=win98
image=/boot/vmlinuz-2.2.12-20
label=linux
initrd=/boot/initrd-2.2.12-20.img
read-only
root=/dev/hda5
image=/boot/vmlinuz-2.2.13
label=newlinux
initrd=/boot/initrd-2.2.13.img
read-only
root=/dev/hda5
other=/dev/hda2
label=win98
- Type
/sbin/lilo
To run the new kernel, I enter
newlinux
at the lilo prompt.
If you have problems, you can go back and run "linux" at the LILO prompt to get original kernel.
Once satisfied it works okay, update /etc/lilo.conf so that the new Linux kernel is labeled "linux" and original Linux is labeled "oldlinux" and re-run /sbin/lilo.