B23 Processing Configuration Information

The configuration information is processed in following steps:

1. The kernel is first configured by the user. This presupposes that a list of all possible options has been prepared and presented in text or graphical form (the available configurations are already limited by the choice of architecture without the user having to intervene).

2. The user selection is then stored in a separate file to ensure that the information is retained until the next (re)configuration and to make it available to the tools employed.

3. The selected configuration symbols must be present, both for the build system implemented by a series of Makefiles and for pre-processor statements in the kernel sources.

There are various make destinations (make destconfig) to initiate kernel configuration. Each serves a different purpose.

□ menuconfig provides a console-driven front end, while xconfig and gconfig feature a graphical user interface that builds on various X11 toolkits (Qt or GTK).

□ oldconfig analyzes configuration options already stored in .config and issues prompts that may have been added after a kernel update and have not yet been assigned to a selection.

□ defconfig applies the default configuration defined by the architecture maintainer (the relevant information is held in arch/arch/defconfig).

□ allyesconfig creates a new configuration file in which all selections are set to y (where this is supported). allmodconfig also sets all selections to y but uses m if this is a possible alternative. allnoconfig generates a minimum configuration from which additional options not needed to compile the key kernel components have been removed.

These three targets are used for test purposes when new kernel releases are being created. Normally, they cannot be sensibly used by end users.

All configuration options must analyze the configuration information in the diverse Kconfig files. The resulting configuration must also be saved. The kernel sources provide the libkconfig library for this purpose. It holds the routines needed to perform the appropriate tasks. (This appendix does not discuss the implementation of the parser that employs the Bison and Flex parser and scanner generators. For that, refer to the relevant sources in scripts/kconfig/zconf.y and zconf.l.)

The user-defined configuration options are held in .config, as shown in this example:

[email protected]> cat .config #

# Automatically generated make config: don't edit

# Linux kernel version: 2.6.24

# Thu Mar 20 00:09:15 2008


# CONFIG_X8 6_32 is not set CONFIG_X86_64=y CONFIG_X86=y


# General setup







All configuration symbols are prefixed with the config_ string. =y or =n is appended if the entry is set. Options that are not set are commented out using a number sign (#).

The <config.h> file must be linked in to make the selected configuration visible in the kernel sources. In turn, this file incorporates <autoconf.h> into the source text. The latter contains configuration information in a form that the pre-processor can easily digest, as shown here:

Continue reading here: Info

Was this article helpful?

0 0