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