by July 6, 2001 0 comments

After installing Red Hat 5.2, one of the first things you might want to do is
update your kernel. This is because the original Red Hat Linux 5.2 shipped with a
pre-release version (2.0.36-0.7) of the 2.0.36 kernel. We have, however, included the
final-release version (2.0.36-3) of the kernel on the PCQ CD, in the directory
/pcq-linux/extra/kernel-updates/2.0.36. (Did we see a 2.2 directory just before that?)

Updating the kernel is not one of those simple “rpm
-Uvh”
commands. It takes a little more than that to get this one right. There are several issues
involved and you’ve to make sure you get all the steps right, or you may land up with
a brain-dead machine.

First of all, it’s a good idea to determine which kernel you
are using. We are assuming that you’ve installed Linux from the accompanying PCQ CD.
Even after you’ve run the pcqupdt script the kernel has not been upgraded. The kernel
currently installed would be 2.0.36-0.7. This can be confirmed by looking at the contents
of your lilo.conf file (/etc/lilo.conf). Now in order to update the kernel there are
certain things you must make sure you have. There are a few non-kernel files, and then the
kernel updates themselves are required. Run this command to check if you have these files
with you:

# rpm -q mkinitrd SysVinit
initscripts
mkinitrd-1.8-3
SysVinit-2.74-5
initscripts-3.78-1

Check for the kernel files too.

# rpm -q kernel kernel-headers
kernel-source kernel-ibcs kernel-pcmcia-cs
kernel-2.0.36-0.7
kernel-headers-2.0.36-0.7
kernel-source-2.0.36-0.7
kernel-ibcs-2.0.36-0.7
kernel-pcmcia-cs-2.0.36-0.7

Now that we know which files we have, let’s compare them with
the list of updates provided by Red Hat (ftp://updates.redhat.com/5.2/i386). The updates
directory will also actually have files–other than the kernel update–that need
to be updated. Most of these files have been put on the PCQ CD, including the ones for the
kernel update. So for the time being if you have the CD then you don’t need to
download anything new.

The kernel updates files are in
/pcq-linux/extra/kernel-updates/2.0.36 directory. Now to confirm if the files are all
intact, mount the CD, change to the kernel update directory and give the following
command:

# rpm -K -nopgp *rpm

  kernel-2.0.36-3.i386.rpm:
size md5   OK
kernel-headers-2.0.36-3.i386.rpm:   size md5 OK
kernel-ibcs-2.0.36-3.i386.rpm: size   md5 OK
kernel-pcmcia-cs-2.0.36-  3.i386.rpm: size md5 OK
kernel-source-2.0.36-3.i386.rpm:   size md5 OK The md5 checksum indicates that all the files are fine and you can
proceed with the actual update. Just to make sure that we can still use the system, it
would be a good idea to make a boot disk.

This is easy to do with Red Hat 5.2—just use the mkbootdisk
command

# mkbootdisk -device /dev/fd0 2.0.36-0.7

This will, of course, wipe out any data on the floppy and create a
bootable disk with a working kernel on it. It would be a good idea to boot from this
floppy once to make sure that it really works.

Now we are ready to start the update. Let’s start with the
kernel source and header files. These are required only if you do development work or
kernel hacking.

# rpm -Uvh
kernel-headers-2.0.36-3.i386.rpm kernel-source-2.0.36-3.i386
kernel-headers #########
kernel-source ##########

Any errors at this stage would probably be due to the
fact that a directory that did not exist was being removed. However, everything should
actually be okay and work fine.

Next let’s install the kernel and modules. This one is not an
upgrade but a fresh install so you need to use the rpm -ivh command instead.

# rpm -ivh kernel-2.0.36-3.i386.rpm
kernel-ibcs-2.0.36-3.i386.rpm kernel-pcmcia-cs-2.0.36-3.i386.rpm
kernel     #############
kernel-ibcs  #############
kernel-pcmcia-cs #########

Now to create the initial ram disk.

# mkinitrd /boot/initrd-2.0.36.img 2.0.36-3

Edit /etc/lilo.conf using a text editor such as joe. Note that your
values may be different. Use your existing lilo.conf values as a guide, duplicate the
current Linux image and adapt it for the new kernel.

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
other=/dev/hda1
label=windows
table=/dev/hda
image=/boot/vmlinuz-2.0.36-3
label=linux
root=/dev/hda6
read-only
image=/boot/vmlinuz-2.0.36-0.7
label=linuxold
root=/dev/hda6
read-only

# lilo -v

LILO version 20, Copyright 1992-1997
Werner Almesberger
Reading boot sector from /dev/hda
Merging with /boot/boot.b
Boot other: /dev/hda1, on /dev/hda, loader /boot/chain.b
Added windows *
Boot image: /boot/vmlinuz-2.0.36-3
Added linux
Boot image: /boot/vmlinuz-2.0.36-0.7
Added linuxold
/boot/boot.0300 exists – no backup copy made.
Writing boot sector.

This is the procedure in brief. For more details, fire up your
browser, mount our CD, and read the file kernupd.htm in the /doc/kernel directory.

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.

Your data will be safe!Your e-mail address will not be published. Also other data will not be shared with third person.