xref: /linux/Documentation/kbuild/kconfig.rst (revision fab183d632628381b466a41479489541ac0e29a0)
1=================================
2Configuration targets and editors
3=================================
4
5This file contains some assistance for using ``make *config``.
6
7Use ``make help`` to list all of the possible configuration targets.
8
9The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
10programs also have embedded help text.  Be sure to check that for
11navigation, search, and other general help text.
12
13The gconfig ('gconf') program has limited help text.
14
15
16General
17=======
18
19New kernel releases often introduce new config symbols.  Often more
20important, new kernel releases may rename config symbols.  When
21this happens, using a previously working .config file and running
22"make oldconfig" won't necessarily produce a working new kernel
23for you, so you may find that you need to see what NEW kernel
24symbols have been introduced.
25
26To see a list of new config symbols, use::
27
28    cp user/some/old.config .config
29    make listnewconfig
30
31and the config program will list any new symbols, one per line.
32
33Alternatively, you can use the brute force method::
34
35    make oldconfig
36    scripts/diffconfig .config.old .config | less
37
38
39Environment variables
40=====================
41
42Environment variables for ``*config``:
43
44``KCONFIG_CONFIG``
45    This environment variable can be used to specify a default kernel config
46    file name to override the default name of ".config".
47
48``KCONFIG_DEFCONFIG_LIST``
49    This environment variable specifies a list of config files which can be
50    used as a base configuration in case the .config does not exist yet.
51    Entries in the list are separated with whitespaces to each other, and
52    the first one that exists is used.
53
54``KCONFIG_OVERWRITECONFIG``
55    If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
56    break symlinks when .config is a symlink to somewhere else.
57
58``KCONFIG_WARN_UNKNOWN_SYMBOLS``
59    This environment variable makes Kconfig warn about all unrecognized
60    symbols in the config input.
61
62``KCONFIG_WARN_CHANGED_INPUT``
63    If set to a non-blank value, Kconfig prints optional warnings for
64    user-provided values that change after Kconfig resolves dependencies
65    or applies other constraints such as ranges.
66
67``KCONFIG_WERROR``
68    If set, Kconfig treats warnings as errors.
69
70``CONFIG_``
71    If you set ``CONFIG_`` in the environment, Kconfig will prefix all symbols
72    with its value when saving the configuration, instead of using the
73    default, ``CONFIG_``.
74
75Environment variables for ``{allyes/allmod/allno/alldef/rand}config``:
76
77``KCONFIG_ALLCONFIG``
78    The allyesconfig/allmodconfig/alldefconfig/allnoconfig/randconfig variants
79    can also use the environment variable KCONFIG_ALLCONFIG as a flag or a
80    filename that contains config symbols that the user requires to be set to a
81    specific value.  If KCONFIG_ALLCONFIG is used without a filename where
82    KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", ``make *config``
83    checks for a file named "all{yes/mod/no/def/random}.config"
84    (corresponding to the ``*config`` command that was used) for symbol values
85    that are to be forced.  If this file is not found, it checks for a
86    file named "all.config" to contain forced values.
87
88    This enables you to create "miniature" config (miniconfig) or custom
89    config files containing just the config symbols that you are interested
90    in.  Then the kernel config system generates the full .config file,
91    including symbols of your miniconfig file.
92
93    This ``KCONFIG_ALLCONFIG`` file is a config file which contains
94    (usually a subset of all) preset config symbols.  These variable
95    settings are still subject to normal dependency checks.
96
97    Examples::
98
99        KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig
100
101    or::
102
103        KCONFIG_ALLCONFIG=mini.config make allnoconfig
104
105    or::
106
107        make KCONFIG_ALLCONFIG=mini.config allnoconfig
108
109    These examples will disable most options (allnoconfig) but enable or
110    disable the options that are explicitly listed in the specified
111    mini-config files.
112
113Environment variables for ``randconfig``:
114
115``KCONFIG_SEED``
116    You can set this to the integer value used to seed the RNG, if you want
117    to somehow debug the behaviour of the kconfig parser/frontends.
118    If not set, the current time will be used.
119
120``KCONFIG_PROBABILITY``
121    This variable can be used to skew the probabilities. This variable can
122    be unset or empty, or set to three different formats:
123
124    =======================     ==================  =====================
125    KCONFIG_PROBABILITY         y:n split           y:m:n split
126    =======================     ==================  =====================
127    unset or empty              50  : 50            33  : 33  : 34
128    N                            N  : 100-N         N/2 : N/2 : 100-N
129    [1] N:M                     N+M : 100-(N+M)      N  :  M  : 100-(N+M)
130    [2] N:M:L                    N  : 100-N          M  :  L  : 100-(M+L)
131    =======================     ==================  =====================
132
133where N, M and L are integers (in base 10) in the range [0,100], and so
134that:
135
136    [1] N+M is in the range [0,100]
137
138    [2] M+L is in the range [0,100]
139
140Examples::
141
142    KCONFIG_PROBABILITY=10
143        10% of booleans will be set to 'y', 90% to 'n'
144        5% of tristates will be set to 'y', 5% to 'm', 90% to 'n'
145    KCONFIG_PROBABILITY=15:25
146        40% of booleans will be set to 'y', 60% to 'n'
147        15% of tristates will be set to 'y', 25% to 'm', 60% to 'n'
148    KCONFIG_PROBABILITY=10:15:15
149        10% of booleans will be set to 'y', 90% to 'n'
150        15% of tristates will be set to 'y', 15% to 'm', 70% to 'n'
151
152Environment variables for ``syncconfig``:
153
154``KCONFIG_NOSILENTUPDATE``
155    If this variable has a non-blank value, it prevents silent kernel
156    config updates (requires explicit updates).
157
158``KCONFIG_AUTOCONFIG``
159    This environment variable can be set to specify the path & name of the
160    "auto.conf" file.  Its default value is "include/config/auto.conf".
161
162``KCONFIG_AUTOHEADER``
163    This environment variable can be set to specify the path & name of the
164    "autoconf.h" (header) file.
165    Its default value is "include/generated/autoconf.h".
166
167
168menuconfig
169==========
170
171Searching in menuconfig:
172
173    The Search function searches for kernel configuration symbol
174    names, so you have to know something close to what you are
175    looking for.
176
177    Example::
178
179        /hotplug
180        This lists all config symbols that contain "hotplug",
181        e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
182
183    For search help, enter / followed by TAB-TAB (to highlight
184    <Help>) and Enter.  This will tell you that you can also use
185    regular expressions (regexes) in the search string, so if you
186    are not interested in MEMORY_HOTPLUG, you could try::
187
188        /^hotplug
189
190    When searching, symbols are sorted thus:
191
192    - first, exact matches, sorted alphabetically (an exact match
193      is when the search matches the complete symbol name);
194    - then, other matches, sorted alphabetically.
195
196    For example, ^ATH.K matches:
197
198        ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG
199        [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...]
200
201    of which only ATH5K and ATH9K match exactly and so are sorted
202    first (and in alphabetical order), then come all other symbols,
203    sorted in alphabetical order.
204
205    In this menu, pressing the key in the (#) prefix will jump
206    directly to that location. You will be returned to the current
207    search results after exiting this new menu.
208
209User interface options for 'menuconfig':
210
211``MENUCONFIG_COLOR``
212    It is possible to select different color themes using the variable
213    MENUCONFIG_COLOR.  To select a theme use::
214
215        make MENUCONFIG_COLOR=<theme> menuconfig
216
217    Available themes are::
218
219      - mono       => selects colors suitable for monochrome displays
220      - blackbg    => selects a color scheme with black background
221      - classic    => theme with blue background. The classic look
222      - bluetitle  => a LCD friendly version of classic. (default)
223
224``MENUCONFIG_MODE``
225    This mode shows all sub-menus in one large tree.
226
227    Example::
228
229        make MENUCONFIG_MODE=single_menu menuconfig
230
231
232nconfig
233=======
234
235nconfig is an alternate text-based configurator.  It lists function
236keys across the bottom of the terminal (window) that execute commands.
237You can also just use the corresponding numeric key to execute the
238commands unless you are in a data entry window.  E.g., instead of F6
239for Save, you can just press 6.
240
241Use F1 for Global help or F3 for the Short help menu.
242
243Searching in nconfig:
244
245    You can search either in the menu entry "prompt" strings
246    or in the configuration symbols.
247
248    Use / to begin a search through the menu entries.  This does
249    not support regular expressions.  Use <Down> or <Up> for
250    Next hit and Previous hit, respectively.  Use <Esc> to
251    terminate the search mode.
252
253    F8 (SymSearch) searches the configuration symbols for the
254    given string or regular expression (regex).
255
256    In the SymSearch, pressing the key in the (#) prefix will
257    jump directly to that location. You will be returned to the
258    current search results after exiting this new menu.
259
260Environment variables:
261
262``NCONFIG_MODE``
263    This mode shows all sub-menus in one large tree.
264
265    Example::
266
267        make NCONFIG_MODE=single_menu nconfig
268
269
270xconfig
271=======
272
273Searching in xconfig:
274
275    The Search function searches for kernel configuration symbol
276    names, so you have to know something close to what you are
277    looking for.
278
279    Example::
280
281        Ctrl-F hotplug
282
283    or::
284
285        Menu: File, Search, hotplug
286
287    lists all config symbol entries that contain "hotplug" in
288    the symbol name.  In this Search dialog, you may change the
289    config setting for any of the entries that are not grayed out.
290    You can also enter a different search string without having
291    to return to the main menu.
292
293
294gconfig
295=======
296
297Searching in gconfig:
298
299    There is no search command in gconfig.  However, gconfig does
300    have several different viewing choices, modes, and options.
301