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