Red Hat Linux/Intel 4.2 (Biltmore) Kernel Upgrade

(Updated: 05-Jan-1998 )

For Errata details on kernel files see:

Introduction

This document describes how to upgrade your kernel using Red Hat-supplied kernel packages. Upgrading your kernel can be tricky, and should only be done when necessary. If you are interested in experimenting with new kernels or compiling the kernel from source, this document does not contain the information you need. Documentation on building customized kernels can be found in many of the Linux books available at your local bookstore, and on the World Wide Web. Please note that the procedure is slightly different for different releases of Red Hat Linux. Some of the steps mentioned here may be unnecessary on some releases of Red Hat; these will be obvious, as the change you will be instructed to make will already be present. In these cases, simply ignore those changes, and continue as instructed. As with most system-level maintenance, every step in this document needs to be done while logged in as root.

Background

All kernel-related files are contained in the following packages:
  • kernel
  • kernel-modules
  • pcmcia-cs
  • iBCS
  • Let's take a look at each package:

    The kernel package contains the main kernel binary, which resides in the file /boot/vmlinuz-"kernelversion", where "kernelversion" looks something like "2.0.28".

    The kernel-modules package contains drivers for various hardware devices and other system services, all of which live in /lib/modules/"kernelversion".

    The pcmcia-cs package contains kernel modules for PCMCIA services. These modules are placed in /lib/modules/"kernelversion"/pcmcia. If you do not need PCMCIA support (normally, only laptops do), there's no reason to upgrade it. Instead, remove the package before going any further. To do this, issue the following command:
          rpm -e pcmcia-cs
    
    (Don't worry if you get a "package pcmcia-cs is not installed" error message; that just means that you never installed the package in the first place.)

    If your system does require PCMCIA support, you'll need to install the new version of the pcmcia-cs package.

    The iBCS package is used to allow Red Hat Linux to run programs from other Intel-based UNIX operating systems. Unless you know you need support for iBCS binaries, you won't need this package. Note that the iBCS package will not impact system startup.

    It's important to note that each package must have the same version as the others, or else your system will not operate correctly! This means that these packages must be upgraded at the same time. Kernel modules (which the kernel-modules and pcmcia-cs packages provide) are very sensitive to the kernel they are loaded into. Unless they match the kernel environment, the modules will not load, and your system will not function properly.

    An additional complication is present on SCSI systems. The basic kernel does not include support for any SCSI devices; the proper module to support SCSI must be loaded through a special mechanism known as an initial ramdisk, or initrd. The initrd contains the module for the SCSI card, and must be built to match a particular kernel. If your system is entirely IDE-based, you do not need to build an initial ramdisk.

    Before You Begin

    Before beginning this process, make sure you have downloaded the new packages you need. All systems will need the kernel and kernel-modules packages. If you need PCMCIA support, you'll need a new pcmcia-cs package as well. The same goes for the iBCS package.

    Next, see what version of the kernel package you are currently running. You can do this with the following command:
        rpm -q kernel
    
    This command will output something similar to kernel-2.0.15-3, 2.0.15 is the kernel version. Ignore the number after the dash (the "3" in this case), as it is the release number of the kernel package. Make sure you write down the kernel version, because you'll need it later.

    Installing the New Packages

    Those of you that have some experience with RPM are most likely thinking about using RPM's -U option to perform an upgrade for each package. DO NOT DO THIS! An upgrade removes the old kernel, which we want to leave in place for now. By leaving the old kernel in place, the system will still be able to boot (using the old kernel) if something goes wrong.

    To install the packages, simply use RPM's -i option:
    rpm -i kernel-2.0.32-1.i386.rpm
    rpm -i kernel-modules-2.0.32-1.i386.rpm
    
    (If one of the package installs fails, add the --force option to the command line. This option is required in some circumstances, and is no cause for concern.) If you require PCMCIA support, install that package the same way. We'll discuss iBCS support at the end of this document.

    Generating an Initial Ramdisk

    If you have any SCSI devices on your system, you'll need to perform this step -- if you don't, please skip ahead to the next section. If you're not sure whether your system is SCSI-based, you can easily find out by issuing the following command:
    grep scsi /etc/conf.modules
    
    If the command produces no output, your system is not currently using an initial ramdisk, and you can skip on to the next section. If your system does require an initial ramdisk, create one using this command:
    /sbin/mkinitrd /boot/initrd- 
    
    For example, if you are upgrading to the 2.0.32 kernel, the command you'd use would look like this:
    /sbin/mkinitrd /boot/initrd-2.0.32 2.0.32
    
    If the command fails, add the -v option immediately after the command name. This option produces more output, which should help you determine what went wrong.

    Updating lilo.conf

    The /etc/lilo.conf file tells your system's bootloader what to do. It contains one or more stanzas, each looking something like this:
        image=/boot/vmlinuz
                label=linux
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
    
    (the exact contents will vary depending on your system). The first stanza specifies the default boot image, which will be used if there is no user input at the boot: prompt. If your computer is configured to boot more than one type of operating system, your default boot image might not be for Linux. In that case, the first stanza will look something like this:
            other=/dev/sda1
                    label=Win95
                    table=/dev/sda
    
    With all this in mind, find the stanza in your lilo.conf file that is used to boot Red Hat Linux. We want to make sure the kernel image pointed to by this stanza is available after the upgrade (in case of problems). We can do this by adding the version number of the old kernel to the "image" and "label" lines:
        image=/boot/vmlinuz-2.0.16
                label=linux-2.0.16
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
    
    (Note that if the image already contains a kernel version number, you must leave the "image" line as-is. The "label" line must still be modified, however.)

    The next thing to do is to make a copy of the entire stanza:
    
        image=/boot/vmlinuz-2.0.16
                label=linux-2.0.16
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
        image=/boot/vmlinuz-2.0.16
                label=linux-2.0.16
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
    
    Now modify the first stanza to refer to the new kernel. To do this, you'll need to change the kernel version number in the "image" line. If you're going to use an initial ramdisk, make sure the correct kernel version is in the "initrd" line, too. Delete the kernel version from the label line, leaving just label=linux. When you're done, your ilo.conf file should have two stanzas that look somewhat like these:
        image=/boot/vmlinuz-2.0.32
                label=linux
                root=/dev/sda1
                initrd=/boot/initrd-2.0.32
                read-only
        image=/boot/vmlinuz-2.0.16
                label=linux-2.0.16
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
    
    For reference, here is an example of a properly modified /etc/lilo.conf in its entirety:
        boot=/dev/sda
        map=/boot/map
        install=/boot/boot.b
        prompt
        timeout=50
        image=/boot/vmlinuz-2.0.32
                label=linux
                root=/dev/sda1
                initrd=/boot/initrd-2.0.32
                read-only
        image=/boot/vmlinuz-2.0.16
                label=linux-2.0.16
                root=/dev/sda1
                initrd=/boot/initrd
                read-only
    
    Now, save the changes you've made, and return to the system shell. Issue the following command:
    /sbin/lilo
    
    (If lilo returns an error, add the -r option to obtain more information on what went wrong. If you have problems running /sbin/lilo, DO NOT REBOOT until you have resolved them! Your system may not reboot!)

    You now have two kernels available -- the original one, and the new one. The new one will boot when linux is entered at the boot: prompt (or will boot by default if its stanza was first in /etc/lilo.conf). But you can also select the old kernel by entering its label at the boot: prompt (i.e. linux-2.0.16 would boot the second image in our sample lilo.conf file).

    iBCS

    If you use iBCS, you'll need to get a new iBCS package which works with the new kernel you are now using. After you are have successfully booted the new kernel, simply upgrade the iBCS package using the following command:
    rpm -U iBCS-2.0-10.i386.rpm
    
    (Replace the example iBCS package name given here with the name of the iBCS package you've downloaded.)

    Completion

    You've successfully upgraded your Red Hat Linux kernel!


    Feedback | Store | News | Support | Product Errata | About Us | Linux Info | Search | JumpWords
    No Frames | Show Frames

    Copyright © 1995-1997 Red Hat Software. Legal notices