https://docs.kernel.org/admin-guide/README.html#configuring-the-kernel
https://docs.kernel.org/kbuild/kconfig.html
The former link contains a more detailed explanation.
config - Update current config utilising a line-oriented program
nconfig - Update current config utilising a ncurses menu based program
menuconfig - Update current config utilising a menu based program
xconfig - Update current config utilising a Qt based front-end
gconfig - Update current config utilising a GTK+ based front-end
===============================================================================
oldconfig - Update current config utilising a provided .config as base
- Default all questions based on the contents of
your existing ./.config file and asking about
new config symbols.
olddefconfig - Same as oldconfig but sets new symbols to their
default value without prompting
- Like above, but sets new symbols to their default
values without prompting.
===============================================================================
localmodconfig - Update current config disabling modules not loaded
except those preserved by LMC_KEEP environment variable
localyesconfig - Update current config converting local mods to core
except those preserved by LMC_KEEP environment variable
defconfig - New config with default from ARCH supplied defconfig
savedefconfig - Save current config as ./defconfig (minimal config)
allnoconfig - New config where all options are answered with no
allyesconfig - New config where all options are accepted with yes
allmodconfig - New config selecting modules when possible
alldefconfig - New config with all symbols set to default
randconfig - New config with random answer to all options
yes2modconfig - Change answers from yes to mod if possible
mod2yesconfig - Change answers from mod to yes if possible
mod2noconfig - Change answers from mod to no if possible
listnewconfig - List new options
helpnewconfig - List new options and help text
tinyconfig - Configure the tiniest possible kernel
testconfig - Run Kconfig unit tests (requires python3 and pytest)
-
When is a symbol visible
有 prompt 才能 visible。对于没有 dependency 的 symbol,不管它的 default,一定会显示出来。对于有 dependency 的 symbol,该 symbol 会不会显示要看 parent symbol 的值,parent symbol 要是 m 或者 y,该 symbol 才会显示。
Any child entry is only visible if its parent entry is also visible.
A menu entry becomes visible when its (家长) expression evaluates to ‘m’ or ‘y’.
-
Non-visible symbol
If a prompt is not present, the config option is a non-visible symbol, meaning its value cannot be directly changed by the user (such as altering the value in
.config) and the option will not appear in any config menus.Its value can only be set via “default” and “select” (see below).
-
Default value
The default value is only assigned to the config symbol if no other value was set by the user (via the input prompt above).
If an input prompt is visible the default value is presented to the user and can be overridden by him.
-
Value
n m y is 0, 1, 2 respectively.
-
Depends on
depend on 决定两件事:一是当前 symbol 的取值范围;二是决定有 prompt 的当前 symbol 是否会显示出来。
normal dependencies reduce the upper limit of a symbol.
config A depends on B如果 B 是 2,A 可以取 0,1,2;如果 B 是 1,A 可以取 0,1;如果 B 是 0,A 可以取 0。
-
Select
reverse dependencies can be used to force a lower limit of another symbol.
The value of the current menu symbol is used as the minimal value
<symbol>can be set to.If
<symbol>is selected multiple times, the limit is set to the largest selection.Reverse dependencies can only be used with boolean or tristate symbols.
select will force a symbol to a value without visiting the dependencies.
By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set.
In general use select only for non-visible symbols (no prompts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over.
config A select B如果 A 是 2,B 可以取 2;如果 A 是 1,B 可以取 1,2;如果 A 是 0,B 可以取 0,1,2。
-
Kconfig syntax
"config" <symbol> <config options> "menuconfig" <symbol> <config options> menuconfig M if M config C1 config C2 endif "choice" <choice options> <choice block> "endchoice" "comment" <prompt> <comment options> "menu" <prompt> <menu options> <menu block> "endmenu" menu "Network device support" depends on NET config NETDEVICES ... endmenu "if" <expr> <if block> "endif" "source" <prompt> "mainmenu" <prompt>
entry 数量是一样的,内容也是一样的,只是呈现形式不一样。