Installation guide

248 Appendix A. Building a Custom Kernel
will remove any configuration files along with the remains of any previous builds that
may be scattered around the source tree. If you already have an existing configuration
file that works (/usr/src/linux-2.4/.config) that you want to use, back it up to a
different directory before running this command and copy it back afterward. If you use
an existing configuration file, skip the next step.
5. Now you must create a configuration file that will determine which components to
include in your new kernel.
If you are running the X Window System, the recommended method is to use the
command make xconfig. Components are listed in different levels of menus and are
selected using a mouse. You can select Y (yes), N (no), or M (module). After choos-
ing your components, click the Save and Exit button to create the configuration file
/usr/src/linux-2.4/.config and exit the Linux Kernel Configuration program.
If you want to use the settings of a default Red Hat Linux kernel, copy the
the configuration file from the /usr/src/linux-2.4/configs directory to
/usr/src/linux-2.4/.config. Then, run the make xconfig command and only
make the desired changes. Be sure to save your changes to the configuration file.
Other available methods for kernel configuration are listed below:
make config An interactive text program. Components are presented in a linear
format and you answer them one at a time. This method does not require the X Win-
dow System and does not allow you to change your answers to previous questions.
make menuconfig A text mode, menu driven program. Components are pre-
sented in a menu of categories; you select the desired components in the same man-
ner used in the text mode Red Hat Linux installation program. Toggle the tag corre-
sponding to the item you want included: [*] (built-in), [ ] (exclude),
M (module),
or
(module capable). This method does not require the X Window System.
make oldconfig This is a non-interactive script that will set up your configura-
tion file to contain the default settings. If you are using the default Red Hat Linux
kernel, it will create a configuration file for the kernel that shipped with Red Hat
Linux for your architecture. This is useful for setting up your kernel to known work-
ing defaults and then turning off features that you do not want.
Note
To use kmod (see Chapter 24 for details) and kernel modules you must answer Yes to kmod
support and module version (CONFIG_MODVERSIONS) support during the configuration.
6. After creating a /usr/src/linux-2.4/.config file, use the command make dep to set
up all the dependencies correctly.
7. Use the command make clean to prepare the source tree for the build.
8. Edit /usr/src/linux-2.4/Makefile so that you do not overwrite your existing
kernel. The method described here is the easiest to recover from in the event of
a mishap. If you are interested in other possibilities, details can be found at
http://www.redhat.com/mirrors/LDP/HOWTO/Kernel-HOWTO.html or in the
Makefile in /usr/src/linux-2.4 on your Linux system.
Edit /usr/src/linux-2.4/Makefile and modify the line beginning with EXTRAVER-
SION = to match a "unique" name by appending the date to the end of the string. For
example, if you are compiling kernel version 2.4.18-0.12 you can append the flag to