Kernel Configuration

Optimize you OS that better choice than change your OS, and about linux server maybe upgrade kernel is the better choice, because if you not upgrade your kernel, attacker can take over your OS so this is critical problem and should to give more attention. And don't think upgrade kernel is not important, better do not upgrade your application than kernel. Now local exploit to take over your server there are lot of kind on internet.
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=value
If an option is not set, then the file contains a line of this form:
# CONFIG_NAME is not set
In 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.
The configuration options that were used to build the currently running kernel are viewable via the /proc/config.gz virtual file, a compressed file whose contents are the same as the .config file that was used to build the kernel. This file can be viewed using zcat(1) and searched using zgrep(1).



From Book The Linux Programming inTerface

0 comments:

Post a Comment