Skip to content

Commit

Permalink
Merge tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  ...
  • Loading branch information
torvalds committed Apr 29, 2021
2 parents b0030af + 8ac27f2 commit 8ca5297
Show file tree
Hide file tree
Showing 29 changed files with 578 additions and 668 deletions.
23 changes: 4 additions & 19 deletions Documentation/kbuild/kconfig-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,25 +223,10 @@ applicable everywhere (see syntax).
the indentation level, this means it ends at the first line which has
a smaller indentation than the first line of the help text.

- misc options: "option" <symbol>[=<value>]

Various less common options can be defined via this option syntax,
which can modify the behaviour of the menu entry and its config
symbol. These options are currently possible:

- "defconfig_list"
This declares a list of default entries which can be used when
looking for the default configuration (which is used when the main
.config doesn't exists yet.)

- "modules"
This declares the symbol to be used as the MODULES symbol, which
enables the third modular state for all config symbols.
At most one symbol may have the "modules" option set.

- "allnoconfig_y"
This declares the symbol as one that should have the value y when
using "allnoconfig". Used for symbols that hide other symbols.
- module attribute: "modules"
This declares the symbol to be used as the MODULES symbol, which
enables the third modular state for all config symbols.
At most one symbol may have the "modules" option set.

Menu dependencies
-----------------
Expand Down
8 changes: 8 additions & 0 deletions Documentation/kbuild/kconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ KCONFIG_CONFIG
This environment variable can be used to specify a default kernel config
file name to override the default name of ".config".

KCONFIG_DEFCONFIG_LIST
----------------------

This environment variable specifies a list of config files which can be used
as a base configuration in case the .config does not exist yet. Entries in
the list are separated with whitespaces to each other, and the first one
that exists is used.

KCONFIG_OVERWRITECONFIG
-----------------------
If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,14 @@ ifeq ($(ARCH),sh64)
SRCARCH := sh
endif

export cross_compiling :=
ifneq ($(SRCARCH),$(SUBARCH))
cross_compiling := 1
endif

KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG

# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
export KBUILD_DEFCONFIG := defconfig

# SHELL used by kbuild
CONFIG_SHELL := sh

Expand Down
12 changes: 1 addition & 11 deletions init/Kconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
config DEFCONFIG_LIST
string
depends on !UML
option defconfig_list
default "/lib/modules/$(shell,uname -r)/.config"
default "/etc/kernel-config"
default "/boot/config-$(shell,uname -r)"
default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"

config CC_VERSION_TEXT
string
default "$(CC_VERSION_TEXT)"
Expand Down Expand Up @@ -1805,7 +1796,6 @@ config DEBUG_RSEQ

config EMBEDDED
bool "Embedded system"
option allnoconfig_y
select EXPERT
help
This option should be enabled if compiling the kernel for
Expand Down Expand Up @@ -2080,7 +2070,7 @@ config MODULE_SIG_FORMAT

menuconfig MODULES
bool "Enable loadable module support"
option modules
modules
help
Kernel modules are small pieces of compiled code which can
be inserted in the running kernel, rather than being
Expand Down
1 change: 1 addition & 0 deletions kernel/configs/tiny-base.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_EMBEDDED=y
13 changes: 3 additions & 10 deletions scripts/kconfig/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
/conf
/[gmnq]conf
/[gmnq]conf-cfg
/qconf-moc.cc
*conf-cfg

#
# configuration programs
#
conf
mconf
nconf
qconf
gconf
21 changes: 18 additions & 3 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ else
Kconfig := Kconfig
endif

ifndef KBUILD_DEFCONFIG
KBUILD_DEFCONFIG := defconfig
endif

ifeq ($(quiet),silent_)
silent := -s
endif

export KCONFIG_DEFCONFIG_LIST :=
ifndef cross_compiling
kernel-release := $(shell uname -r)
KCONFIG_DEFCONFIG_LIST += \
/lib/modules/$(kernel-release)/.config \
/etc/kernel-config \
/boot/config-$(kernel-release)
endif
KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)

# We need this, in case the user has it in its environment
unexport CONFIG_

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

PHONY += tinyconfig
tinyconfig:
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
$(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig
$(Q)$(MAKE) -f $(srctree)/Makefile tiny.config

# CHECK: -o cache_dir=<path> working?
PHONY += testconfig
Expand Down Expand Up @@ -128,8 +143,8 @@ help:

# ===========================================================================
# object files used by all kconfig flavours
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
symbol.o util.o
common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
preprocess.o symbol.o util.o

$(obj)/lexer.lex.o: $(obj)/parser.tab.h
HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
Expand Down
Loading

0 comments on commit 8ca5297

Please sign in to comment.