Attributes

Attributes are used to more precisely specify the effect of configuration options. The following excerpt from the kernel sources makes use of attributes:

config SWAP

bool "Support for paging of anonymous memory (swap)" depends on MMU & BLOCK default y depends on specifies that swap may be chosen only if the kernel is compiled for a system with MMU, and if the block layer is compiled in. default indicates that y is selected by default — if users do not change the setting, this value is automatically assigned to the swap symbol.

Before moving on to deal with how the dependency specification is used (described in the next subsection), take a look at the following attributes:

□ default specifies the default setting for the config entry. For bool queries, the possible defaults are y or n. m is a third alternative for tristate. Modified defaults must be specified for the other option types: strings for string, and numbers for integer and hex.

□ range limits the possible value range for numeric options. The first argument specifies the lower limit; the second argument specifies the upper limit.

□ select is used to automatically select other configuration options if the entry is selected using the select statement. This reverse dependency mechanism can be used only with tristates and bool.

□ help and - -help— introduce help text, as demonstrated previously.

All these attributes may also be followed by an if clause, which specifies the conditions in which the attribute applies. As with depends on, this is done by linking the symbols on which the attribute depends by means of logical operators, as shown in the following (fictitious) example:

config ENABLE_ACCEL

bool "Enable device acceleration" default n config HYPERCARD_SPEEDUP

integer "HyperCard Speedup" default 20 if ENABLE_ACCEL range 1 20

Continue reading here: Dependencies

Was this article helpful?

0 0