Appendix A. Building a Custom Kernel

Many people new to Linux often ask, "Why should I build my own kernel?" Given the advances that have been made in the use of kernel modules, the most accurate response to that question is, "Unless you already know why you need to build your own kernel, you probably do not need to."

The kernel provided with Red Hat Linux and via the Red Hat Linux Errata system provides support for most modern hardware and kernel features. For most users, it does not need to be recompiled. This appendix is provided as a guide for users who want to recompile their kernel to learn more about it, for users who want to compile an experimental feature into the kernel, and so on.

To upgrade the kernel using the kernel packages distributed by Red Hat, Inc., refer to Chapter 30 Upgrading the Kernel.

WarningWarning
 

Building a custom kernel is not supported by the Red Hat Linux Installation Support Team. For more information on upgrading the kernel using the RPM packages distributed by Red Hat, Inc., refer to Chapter 30 Upgrading the Kernel.

A.1. Preparing to Build

Before building a custom kernel, it is extremely important to make sure that a working emergency boot diskette exists in case a mistake is made. To make a boot diskette that will boot using the currently running kernel, execute the following command:

/sbin/mkbootdisk `uname -r`

After making the diskette, test it to make sure that it will boot the system.

To recompile the kernel, the kernel-source package must be installed. Issue the command

rpm -q kernel-source 

to determine if it is installed. If it is not installed, install it from the Red Hat Linux CD-ROMs, the Red Hat FTP site available at ftp://ftp.redhat.com (a list of mirrors is available at http://www.redhat.com/mirrors.html), or Red Hat Network. For more information on installing RPM packages, refer to Part V Package Management.