Installing a New Kernel Version

 < Day Day Up > 



To install a new kernel, you need to download the software packages for that kernel to your system. You can install a new kernel either by downloading a binary version from your distribution's Web site and installing it or by downloading the source code, compiling the kernel, and then installing the resulting binary file along with the modules. For Red Hat, the binary version of the kernel is provided in an RPM package. You can install a new kernel, just as you would any other RPM software package.

The easiest way to install a new kernel on Red Hat is to use the Red Hat Network update agent (the Red Hat Network is now a subscription service you need to pay for). The update agent automatically downloads, updates, and installs a new kernel. The Red Hat Network does not automatically select kernel files for download. Although they are listed, you have to explicitly select them to be downloaded and installed.

If you want to download kernel RPM packages manually, directly from Red Hat, keep in mind that the complete kernel installation usually includes a series of RPM packages, all beginning with the word kernel. There are also other packages you may need, which contain updated system configuration files used by the new kernel. You can use the packages already installed on your system as a guide. Use the rpm command with the -qa option to list all packages and then pipe that list through the grep command with the kernel pattern to display only the kernel packages:

rpm -qa | grep kernel

The source code version is available for download from distribution FTP sites and is included on distribution CD-ROMs. You can also download the latest source directly from www.kernel.org. Wherever you download a kernel version from, it is always the same. The source code downloaded for a particular kernel version from a distribution site is the same as the one for www.kernel.org. Patches for that version can be applied to any distribution.

Red Hat Kernel Packages

As an example, the kernel packages for Red Hat are listed here. You should install only one of the kernel-version-ix86 and athlon packages. This will suffice for standard single-processor computers. The others are optimization, support, or configuration packages that you may need, depending on the hardware configuration of your PC, namely for multiprocessor machines, laptops, and computers with memory larger then 4GB. The name includes nptl, which indicates that this version of the kernel supports the Native POSIX Thread Library (NPTL) providing more efficient process control, improving performance and processor scalability.

kernel-2.4.22-1.2115.nptl.athlon.rpm kernel-2.4.22-1.2115.nptl.i586.rpm kernel-2.4.22-1.2115.nptl.i686.rpm kernel-doc-2.4.22-1.2115.nptl i386.rpm kernel-bigmem-2.4.22-1.2115.nptl.i686.rpm kernel-pcmcia-cs-3.1.31-13.i386.rpm kernel-smp-2.4.22-1.2115.nptl.i686.rpm kernel-smp-2.4.22-1.2115.nptl.athlon.rpm kernel-utils-2.4.9-1.101.fedora.i386.rpm kernel-source-2.4.22-1.2115.nptl.i386.rpm kernel-BOOT-2.4.22-1.2115.nptl.i686.rpm

CPU Kernel Packages

Red Hat provides different kernel packages optimized for various popular CPUs. Choose the appropriate one for your machine. Each package is named kernel, but each has a different qualifier. Red Hat includes three different kernel packages, one for Athlon and Duron CPUs, one for Pentium 2, 3, and 4 CPUs, and one for the older Pentiums, AMD K6 CPUs, and other older systems. Each package will have a CPU reference in its filename: athlon for Athlon and Duron, 686 for Pentium 2, 3, and 4, 586 for Pentium, K6, and other systems.

kernel-2.4.22-1.2115.nptl.athlon.rpm kernel-2.4.22-1.2115.nptl.i586.rpm kernel-2.4.22-1.2115.nptl.i686.rpm 

In addition, if you are installing on a laptop computer or a system that uses PCMCIA cards, you also need to install the pcmcia-cs package.

kernel-pcmcia-cs-3.1.31-13.i386.rpm

If your computer has more than 4GB of RAM memory, you will need to also install the bigmem package.

kernel-bigmem-2.4.22-1.2115.nptl.i686.rpm

If your system supports multiple CPU processors, you will also need to install the smp package instead of the standard cpu ones. Red Hat provides packages for Athlon and Pentium computers.

kernel-smp-2.4.22-1.2115.nptl.i686.rpm kernel-smp-2.4.22-1.2115.nptl.athlon.rpm
Tip 

The kernel-BOOT package is a smaller version of kernel meant to be used for floppy installation disks only.

Support Packages

In addition, if you are planning to customize your kernel, you should download the source package. The doc package provides updated documentation. The utils package contains various hardware monitoring tools like smardctl for hard drives, along with user-mode Linux (UML) tools.

kernel-utils-2.4.8-31.i386.rpm kernel-source-2.4.22-1.2115.nptl.i386.rpm kernel-doc-2.4.22-1.2115.nptl i386.rpm

Installing Kernel Packages: /boot

You will not need all of these packages. For example, for a simple kernel upgrade for a basic Pentium computer (Pentium 3 or 4 with less than 4GB memory, single processor, and no customization), you would need only the 686 package. For an Athlon or Duron system, you would use the athlon package. For a more complete upgrade, you would include the pcmcia, source, doc, and utils packages. If your system supports multiple processors, you would use the smp packages.

To make sure a kernel RPM package was downloaded without any errors and to verify its authentication, you can use the rpm command with the -K option (to authenticate the package, you need the Red Hat public key):

rpm -K *rpm

You can now install the kernel. As a safety precaution, you should preserve your old kernel in case the new one does not work out for some reason. This involves installing with the install (-i) option instead of the update (-U) option, creating a separate RAM disk for the new kernel, and then modifying grub.conf to have GRUB start up using the new kernel.

# rpm -ivh kernel-2.4.22-1.2115.nptl.i686.rpm 

If your system has a SCSI controller or any other specialized hardware, RPM will also create a RAM disk to hold appropriate support modules (you can create a RAM disk manually with the mkinitrd command). The RAM disk is named initrd-kernel-version.img and is located in the /boot directory, as in /boot/initrd-2.4.22-1.img.

Tip 

The redhat-config-packages tool does not support kernel package installation. You have to install the kernel package manually using the rpm command in a terminal window.

If you are customizing the kernel, installing the source code and headers for the kernel is also essential. You need the source code to generate any modules and tailor the kernel to your own needs. For example, you can use the source code to generate modules containing device drivers for any uncommon devices you may have installed, as shown here:

# rpm -Uvh kernel-source-2.4.22-1.2115.nptl.i386.rpm

On most distributions, kernels are installed in the /boot directory. Performing an ls -l operation on this directory lists all the currently installed kernels. A file for your old kernel and a file for your new one now exist, as well as a link file called vmlinuz that links to the new kernel file. If you took the precautions described in the preceding section, you may have already renamed the older kernel. If you are using a boot loader such as GRUB, you needn't change its configuration file (grub.conf), because the entry to invoke the kernel still references the /boot/vmlinuz link, which now points to the new kernel. The kernel boots using the /boot/vmlinuz link to the kernel file. In your grub.conf file, the kernel line for the kernel file references this link. You also need to include a line for the RAM disk, initrd.

  kernel /boot/vmlinuz-2.4.22-1.2115.npt1 ro root=/dev/hda 3   initrd /boot/initrd-2.4.22-1.2115.npt1.img
Tip 

Although it is not included with Red Hat 10, user-mode Linux (UML) is an optional version of the kernel designed to run as a standalone program separate from the kernel. In effect, it creates a virtual machine with disk storage implemented on a user file. UML is often used to test software or experiment with kernel configurations, without harming the real system. You can also use UML to implement virtual hosting, by running several virtual machines on one physical host. With a virtual machine, you can control the access to the host system, providing greater security. You can find out more about user-mode Linux at user-mode-linux.sourceforge.net.



 < Day Day Up > 



Red Hat(c) The Complete Reference
Red Hat Enterprise Linux & Fedora Edition (DVD): The Complete Reference
ISBN: 0072230754
EAN: 2147483647
Year: 2004
Pages: 328

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net