|Lesson 8||Configuring the kernel |
|Objective||Configure Linux Kernel Options before Compilation |
Configure Linux Kernel Options before Compilation
Configuring your kernel correctly is crucial. Not only must you decide what kernel options to include, you must also decide if they are modular or built into the kernel.
Linux makes it easy to set kernel options, but you must make sure you choose your options wisely.
When choosing kernel options, consider the specific hardware on your system and your need for protocols and services. Here are some general guidelines to follow.
- Under Code Maturity Level Options, check Prompt for development and/or incomplete code/drivers. If you do not check this option, certain essential services (most notably
rpc.nfsd) may not work correctly.
- Optimize for your computer's processor family.
- Turn off math emulation when your system has a dedicated math coprocessor. Intel 386 and 486 systems with a coprocessor, Pentiums, and Alphas all have on-processor math coprocessors.
- Turn off SMP (Symmetric Multi-Processor) support when your system only has a single CPU.
- Modularize as much hardware support as possible.
- Turn off ISDN  IrDA, and old CD-ROM drivers support, unless you have these capabilities or devices.
- Don't change the default sound configuration.
Configuring the kernel
To configure the kernel, follow the following four steps.
- Change to the
make mrproper to restore the sources to a clean state.
- Copy one of Red Hat's default configuration files from the
configs/ directory to
arch/i386/defconfig. Red Hat provides these default configurations for a variety of hardware platforms. The settings inside of each make configuring the kernel easier.
make oldconfig to create a starting Linux kernel configuration file from the default configuration copied in the previous step.
- Create the kernel configuration file using one of the standard configuration utilities:
make xconfig, make menuconfig, or make config.
- Update the
EXTRAVERSION= line in
make dep to create the source dependencies and propagate configuration information to all makefiles in the development tree.
make clean to remove old object files.
Pre Compilation Kernel
- Step one: change into the /usr/src/linux directory. All subsequent commands will run relative to this directory.
- Step two: type make mrproper to restore the kernel sources to a clean state.
- Step three: copy a default configuration file to the arch/i386/defconfig file
- Step four: create a starting Linux kernel configuration file by typing make oldconfig.
- Step five: create the kernel configuration file using one of the standard configuration utilities: make xconfig, make menuconfig, or make config.
- The colorized menu interface for make menuconfig is very useful. You can use the arrow keys to move up and down, and the Enter key to move into submenus.
- Save your changes before you exit the configuration program.
- Once you are outside of make menuconfig, you see that it prompts you for the next steps.
- Step six: update the EXTRAVERSION variable in the Linux kernel configuration makefile.
- Step seven: type make dep to create the source dependencies and propagate configuration information to all makefiles in the development tree.
- Step eight: type make clean to remove old object files.
If you build the kernel in the future and use the same configuration, you do not need to perform steps two, three, and four.
You need to do these steps only the first time you are rebuilding a Red Hat Linux kernel. The next lesson presents the kernel and modules build and install procedures.
An acronym for Integrated Services Digital Network, ISDN is a standards specification for data transmission over telephone wires and other land-based media.
An acronym for Infrared Data Association, IrDA is an international standards body that plans the hardware and software requirements for wireless, infrared data communication.