Many features of the Linux kernel are components that can be optionally config-
ured. Before compiling the kernel, these components can be disabled, enabled, or,
in many cases, enabled as loadable kernel modules. One reason to disable an
unneeded component is to reduce the size of the kernel binary, and thus save
memory, if the component is not required. Enabling a component as a loadable
module means that it will be loaded into memory only if it is required at run time.
This likewise can save memory.
Kernel configuration is done by executing one of a few different make commands
in the root directory of the kernel source tree—for example, make menuconfig, which
provides a curses-style configuration menu, or, more comfortably, make xconfig,
which provides a graphical configuration menu. These commands produce a
.config file in the root directory of the kernel source tree that is then used during
kernel compilation. This file contains the settings of all configuration options.
The value of each option that is enabled is shown in the .config file in a line of
the following form:
CONFIG_NAME=valueIf an option is not set, then the file contains a line of this form:
# CONFIG_NAME is not setIn the .config file, lines beginning with a # character are comments.
Throughout this book, when we describe kernel options, we won’t describe pre-
cisely where in the menuconfig or xconfig menu the option can be found. There are a few reasons for this:
- The location can often be determined fairly intuitively by navigating through
the menu hierarchy. - The location of configuration options does change over time, as the menu hierarchy is restructured across kernel versions.
- If we can’t find the location of a particular option within the menu hierarchy,
then both make menuconfig and make xconfig provide search facilities. For example, we can search for the string CONFIG_INOTIFY to find the option for configuring support for the inotify API.
From Book The Linux Programming inTerface
0 comments:
Post a Comment