Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp02.tex V2 - 09/04/2008 6:09pm Page 1148

Appendix B: Working with the Source Code


wherestringis the name of the menu. All entries betweenmenuandendmenuare interpreted as subitems
of the menu and automatically inherit the dependencies of the menu item (these are added to the existing
dependencies of the subitems).

The keywordmenuconfigis used to define a configuration symbol and a submenu together. Instead of
writing this:

menu "Bit bucket compression support"

config BIT_BUCKET_ZLIB
tristate "Bit bucket compression support"

you can also specify the shorter form as follows:

menuconfig BIT_BUCKET_ZLIB
tristate "Bit bucket compression support"

Another keyword,mainmenu, may occur only at the top of the configuration hierarchy (and then once
only) to specify a title for the entire hierarchy. The entry is therefore used only inarch/arch/Kconfig
because these files represent the starting point of theconfiguration hierarchy. For example, the version
for Sparc64 processors includes the following entry:

mainmenu "Linux/UltraSPARC Kernel Configuration"

ConfigurationOptions


Configuration options are introduced by the keywordconfigthat must be followed by a configuration
symbol.

config <symbol>
<type-name> "Description"
<attributes>

The type name indicates the option type. As mentioned earlier, the tristate type has one of the following
states:y,n,orm. Additional option types include the following:

❑ boolpermits a Boolean query that returns eitheryorn— in other words, the entry may be
selected or not.
❑ stringqueries a string.
❑ hexandintegerread hexadecimal and decimal numbers respectively.

The following syntax can be used instead of the type name:

config <symbol>
<type-name>
prompt "Description"

In functional terms, this is identical to the previous, shorter alternative.
Free download pdf