Skip to content

Commit 8ca5297

Browse files
committed
Merge tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kconfig updates from Masahiro Yamada: - Change 'option defconfig' to the environment variable KCONFIG_DEFCONFIG_LIST - Refactor tinyconfig without using allnoconfig_y - Remove 'option allnoconfig_y' syntax - Change 'option modules' to 'modules' - Do not use /boot/config-* etc. as base config for cross-compilation - Fix a search bug in nconf - Various code cleanups * tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kconfig: refactor .gitignore kconfig: highlight xconfig 'comment' lines with '***' kconfig: highlight gconfig 'comment' lines with '***' kconfig: gconf: remove unused code kconfig: remove unused PACKAGE definition kconfig: nconf: stop endless search loops kconfig: split menu.c out of parser.y kconfig: nconf: refactor in print_in_middle() kconfig: nconf: remove meaningless wattrset() call from show_menu() kconfig: nconf: change set_config_filename() to void function kconfig: nconf: refactor attributes setup code kconfig: nconf: remove unneeded default for menu prompt kconfig: nconf: get rid of (void) casts from wattrset() calls kconfig: nconf: fix NORMAL attributes kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf() kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build kconfig: change sym_change_count to a boolean flag kconfig: nconf: fix core dump when searching in empty menu kconfig: lxdialog: A spello fix and a punctuation added kconfig: streamline_config.pl: Couple of typo fixes ...
2 parents b0030af + 8ac27f2 commit 8ca5297

File tree

29 files changed

+578
-668
lines changed

29 files changed

+578
-668
lines changed

Documentation/kbuild/kconfig-language.rst

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -223,25 +223,10 @@ applicable everywhere (see syntax).
223223
the indentation level, this means it ends at the first line which has
224224
a smaller indentation than the first line of the help text.
225225

226-
- misc options: "option" <symbol>[=<value>]
227-
228-
Various less common options can be defined via this option syntax,
229-
which can modify the behaviour of the menu entry and its config
230-
symbol. These options are currently possible:
231-
232-
- "defconfig_list"
233-
This declares a list of default entries which can be used when
234-
looking for the default configuration (which is used when the main
235-
.config doesn't exists yet.)
236-
237-
- "modules"
238-
This declares the symbol to be used as the MODULES symbol, which
239-
enables the third modular state for all config symbols.
240-
At most one symbol may have the "modules" option set.
241-
242-
- "allnoconfig_y"
243-
This declares the symbol as one that should have the value y when
244-
using "allnoconfig". Used for symbols that hide other symbols.
226+
- module attribute: "modules"
227+
This declares the symbol to be used as the MODULES symbol, which
228+
enables the third modular state for all config symbols.
229+
At most one symbol may have the "modules" option set.
245230

246231
Menu dependencies
247232
-----------------

Documentation/kbuild/kconfig.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ KCONFIG_CONFIG
4141
This environment variable can be used to specify a default kernel config
4242
file name to override the default name of ".config".
4343

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+
4452
KCONFIG_OVERWRITECONFIG
4553
-----------------------
4654
If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,14 @@ ifeq ($(ARCH),sh64)
404404
SRCARCH := sh
405405
endif
406406

407+
export cross_compiling :=
408+
ifneq ($(SRCARCH),$(SUBARCH))
409+
cross_compiling := 1
410+
endif
411+
407412
KCONFIG_CONFIG ?= .config
408413
export KCONFIG_CONFIG
409414

410-
# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
411-
export KBUILD_DEFCONFIG := defconfig
412-
413415
# SHELL used by kbuild
414416
CONFIG_SHELL := sh
415417

init/Kconfig

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
config DEFCONFIG_LIST
3-
string
4-
depends on !UML
5-
option defconfig_list
6-
default "/lib/modules/$(shell,uname -r)/.config"
7-
default "/etc/kernel-config"
8-
default "/boot/config-$(shell,uname -r)"
9-
default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
10-
112
config CC_VERSION_TEXT
123
string
134
default "$(CC_VERSION_TEXT)"
@@ -1805,7 +1796,6 @@ config DEBUG_RSEQ
18051796

18061797
config EMBEDDED
18071798
bool "Embedded system"
1808-
option allnoconfig_y
18091799
select EXPERT
18101800
help
18111801
This option should be enabled if compiling the kernel for
@@ -2080,7 +2070,7 @@ config MODULE_SIG_FORMAT
20802070

20812071
menuconfig MODULES
20822072
bool "Enable loadable module support"
2083-
option modules
2073+
modules
20842074
help
20852075
Kernel modules are small pieces of compiled code which can
20862076
be inserted in the running kernel, rather than being

kernel/configs/tiny-base.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_EMBEDDED=y

scripts/kconfig/.gitignore

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
/conf
3+
/[gmnq]conf
4+
/[gmnq]conf-cfg
25
/qconf-moc.cc
3-
*conf-cfg
4-
5-
#
6-
# configuration programs
7-
#
8-
conf
9-
mconf
10-
nconf
11-
qconf
12-
gconf

scripts/kconfig/Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,24 @@ else
99
Kconfig := Kconfig
1010
endif
1111

12+
ifndef KBUILD_DEFCONFIG
13+
KBUILD_DEFCONFIG := defconfig
14+
endif
15+
1216
ifeq ($(quiet),silent_)
1317
silent := -s
1418
endif
1519

20+
export KCONFIG_DEFCONFIG_LIST :=
21+
ifndef cross_compiling
22+
kernel-release := $(shell uname -r)
23+
KCONFIG_DEFCONFIG_LIST += \
24+
/lib/modules/$(kernel-release)/.config \
25+
/etc/kernel-config \
26+
/boot/config-$(kernel-release)
27+
endif
28+
KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)
29+
1630
# We need this, in case the user has it in its environment
1731
unexport CONFIG_
1832

@@ -88,7 +102,8 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/c
88102

89103
PHONY += tinyconfig
90104
tinyconfig:
91-
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
105+
$(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig
106+
$(Q)$(MAKE) -f $(srctree)/Makefile tiny.config
92107

93108
# CHECK: -o cache_dir=<path> working?
94109
PHONY += testconfig
@@ -128,8 +143,8 @@ help:
128143

129144
# ===========================================================================
130145
# object files used by all kconfig flavours
131-
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
132-
symbol.o util.o
146+
common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
147+
preprocess.o symbol.o util.o
133148

134149
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
135150
HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)

0 commit comments

Comments
 (0)