Download Red Hat Enterprise Linux 3 System Administration Guide

Transcript
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 Enterprise Linux and via the Red Hat Enterprise 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 39
Upgrading the Kernel.
Warning
Building a custom kernel is not supported by the Installation Support Team. For more information
on upgrading the kernel using the RPM packages distributed by Red Hat, Inc., refer to Chapter 39
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 boots 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 Enterprise Linux CDROMs or Red Hat Network. For more information on installing RPM packages, refer to Part III
Package Management.
A.2. Building the Kernel
To build a custom kernel (perform all these steps as root):
Note
This example uses 2.4.21-1.1931.2.399.ent as the kernel version (the kernel version might differ). To
determine the kernel version, type the command uname -r and replace 2.4.21-1.1931.2.399.ent with
the kernel version that is returned.