#
1f937a4b |
| 10-Dec-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: suppress stdout from merge_config for silent builds
merge_config does not respect the Make's -s (--silent) option.
Let's sink the stdout from merge_config for silent builds.
This commit do
kbuild: suppress stdout from merge_config for silent builds
merge_config does not respect the Make's -s (--silent) option.
Let's sink the stdout from merge_config for silent builds.
This commit does not cater to the direct invocation of merge_config.sh (e.g. arch/mips/Makefile).
Reported-by: Leon Romanovsky <leon@kernel.org> Closes: https://lore.kernel.org/all/e534ce33b0e1060eb85ece8429810f087b034c88.1733234008.git.leonro@nvidia.com/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Leon Romanovsky <leon@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
show more ...
|
#
b1992c37 |
| 27-Apr-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: use $(src) instead of $(srctree)/$(src) for source directory
Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for checked-in source files. It is merely a convention withou
kbuild: use $(src) instead of $(srctree)/$(src) for source directory
Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for checked-in source files. It is merely a convention without any functional difference. In fact, $(obj) and $(src) are exactly the same, as defined in scripts/Makefile.build:
src := $(obj)
When the kernel is built in a separate output directory, $(src) does not accurately reflect the source directory location. While Kbuild resolves this discrepancy by specifying VPATH=$(srctree) to search for source files, it does not cover all cases. For example, when adding a header search path for local headers, -I$(srctree)/$(src) is typically passed to the compiler.
This introduces inconsistency between upstream and downstream Makefiles because $(src) is used instead of $(srctree)/$(src) for the latter.
To address this inconsistency, this commit changes the semantics of $(src) so that it always points to the directory in the source tree.
Going forward, the variables used in Makefiles will have the following meanings:
$(obj) - directory in the object tree $(src) - directory in the source tree (changed by this commit) $(objtree) - the top of the kernel object tree $(srctree) - the top of the kernel source tree
Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced with $(src).
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
ac14947c |
| 05-Dec-2023 |
Markus Schneider-Pargmann <msp@baylibre.com> |
kconfig: Use KCONFIG_CONFIG instead of .config
When using a custom location for kernel config files this merge config command fails as it doesn't use the configuration set with KCONFIG_CONFIG.
Sign
kconfig: Use KCONFIG_CONFIG instead of .config
When using a custom location for kernel config files this merge config command fails as it doesn't use the configuration set with KCONFIG_CONFIG.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
6c07fd84 |
| 03-Dec-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: factor out common code shared by mconf and nconf
Separate out the duplicated code to mnconf-common.c.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
92ef432f |
| 23-Nov-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: support W=c and W=e shorthands for Kconfig
KCONFIG_WARN_UNKNOWN_SYMBOLS=1 and KCONFIG_WERROR=1 are descriptive and suitable in scripting, but typing them from the command line can be tedious
kbuild: support W=c and W=e shorthands for Kconfig
KCONFIG_WARN_UNKNOWN_SYMBOLS=1 and KCONFIG_WERROR=1 are descriptive and suitable in scripting, but typing them from the command line can be tedious.
Associate them with KBUILD_EXTRA_WARN (and the W= shorthand).
Support a new letter 'c' to enable extra checks in Kconfig. You can still manage compiler warnings (W=1) and Kconfig warnings (W=c) independently.
Reuse the letter 'e' to turn Kconfig warnings into errors.
As usual, you can combine multiple letters in KCONFIG_EXTRA_WARN.
$ KCONFIG_WARN_UNKNOWN_SYMBOLS=1 KCONFIG_WERROR=1 make defconfig
can be shortened to:
$ KBUILD_EXTRA_WARN=ce make defconfig
or, even shorter:
$ make W=ce defconfig
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
show more ...
|
#
feec5e1f |
| 31-Aug-2023 |
Kees Cook <keescook@chromium.org> |
kbuild: Show marked Kconfig fragments in "help"
Currently the Kconfig fragments in kernel/configs and arch/*/configs that aren't used internally aren't discoverable through "make help", which consis
kbuild: Show marked Kconfig fragments in "help"
Currently the Kconfig fragments in kernel/configs and arch/*/configs that aren't used internally aren't discoverable through "make help", which consists of hard-coded lists of config fragments. Instead, list all the fragment targets that have a "# Help: " comment prefix so the targets can be generated dynamically.
Add logic to the Makefile to search for and display the fragment and comment. Add comments to fragments that are intended to be direct targets.
Signed-off-by: Kees Cook <keescook@chromium.org> Co-developed-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
aedee9e8 |
| 13-Jan-2023 |
Peter Foley <pefoley2@pefoley.com> |
kconfig: Update all declared targets
Currently qconf-cfg.sh is the only script that touches the "-bin" target, even though all of the conf_cfg rules declare that they do. Make the recipe uncondition
kconfig: Update all declared targets
Currently qconf-cfg.sh is the only script that touches the "-bin" target, even though all of the conf_cfg rules declare that they do. Make the recipe unconditionally touch all declared targets to avoid incompatibilities with upcoming versions of GNU make: https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html
e.g. scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/nconf-bin'. scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/mconf-bin'. scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/gconf-bin'.
Signed-off-by: Peter Foley <pefoley2@pefoley.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
3122c844 |
| 11-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: refactor Makefile to reduce process forks
Refactor Makefile and use read-file macro. For Make >= 4.2, it can read out a file by using the built-in function.
Signed-off-by: Masahiro Yamada
kconfig: refactor Makefile to reduce process forks
Refactor Makefile and use read-file macro. For Make >= 4.2, it can read out a file by using the built-in function.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
c39afe62 |
| 17-Oct-2021 |
Josh Triplett <josh@joshtriplett.org> |
kconfig: Add `make mod2noconfig` to disable module options
When converting a modular kernel to a monolithic kernel, once the kernel works without loading any modules, this helps to quickly disable a
kconfig: Add `make mod2noconfig` to disable module options
When converting a modular kernel to a monolithic kernel, once the kernel works without loading any modules, this helps to quickly disable all the modules before turning off module support entirely.
Refactor conf_rewrite_mod_or_yes to a more general conf_rewrite_tristates that accepts an old and new state.
Signed-off-by: Josh Triplett <josh@joshtriplett.org> Tested-by: Björn Töpel <bjorn@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
a77a05dc |
| 13-Apr-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: split menu.c out of parser.y
Compile menu.c as an independent compilation unit.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
f02aa48d |
| 10-Apr-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build
When the .config file is missing, 'make config', 'make menuconfig', etc. uses a file listed in DEFCONFIG_LIST, if found, as b
kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build
When the .config file is missing, 'make config', 'make menuconfig', etc. uses a file listed in DEFCONFIG_LIST, if found, as base configuration.
Ususally, /boot/config-$(uname -r) exists, and is used as default.
However, when you are cross-compiling the kernel, it does not make sense to use /boot/config-* on the build host. It should default to arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG).
UML previously did not use DEFCONFIG_LIST at all, but it should be able to use arch/um/configs/$(KBUILD_DEFCONFIG) as a base config file.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
f8f0d064 |
| 13-Mar-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: do not use allnoconfig_y option
allnoconfig_y is an ugly hack that sets a symbol to 'y' by allnoconfig.
allnoconfig does not mean a minimal set of CONFIG options because a bunch of prompts
kconfig: do not use allnoconfig_y option
allnoconfig_y is an ugly hack that sets a symbol to 'y' by allnoconfig.
allnoconfig does not mean a minimal set of CONFIG options because a bunch of prompts are hidden by 'if EMBEDDED' or 'if EXPERT', but I do not like to hack Kconfig this way.
Use the pre-existing feature, KCONFIG_ALLCONFIG, to provide a one liner config fragment. CONFIG_EMBEDDED=y is still forced when allnoconfig is invoked as a part of tinyconfig.
No change in the .config file produced by 'make tinyconfig'.
The output of 'make allnoconfig' will be changed; we will get CONFIG_EMBEDDED=n because allnoconfig literally sets all symbols to n.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
dd465996 |
| 13-Mar-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: move default KBUILD_DEFCONFIG back to scripts/kconfig/Makefile
This is a partial revert of commit 2a86f6612164 ("kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST").
Now that
kconfig: move default KBUILD_DEFCONFIG back to scripts/kconfig/Makefile
This is a partial revert of commit 2a86f6612164 ("kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST").
Now that the reference to $(DEFCONFIG_LIST) was removed from init/Kconfig, the default KBUILD_DEFCONFIG can go back home.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
b75b0a81 |
| 13-Mar-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: change defconfig_list option to environment variable
"defconfig_list" is a weird option that defines a static symbol that declares the list of base config files in case the .config does not
kconfig: change defconfig_list option to environment variable
"defconfig_list" is a weird option that defines a static symbol that declares the list of base config files in case the .config does not exist yet.
This is quite different from other normal symbols; we just abused the "string" type and the "default" properties to list out the input files. They must be fixed values since these are searched for and loaded in the parse stage.
It is an ugly hack, and should not exist in the first place. Providing this feature as an environment variable is a saner approach.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
f91e46b1 |
| 21-Feb-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
Unify the similar build rules.
This supports 'make build_config', which builds scripts/kconfig/conf but does not invoke it.
Sig
kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
Unify the similar build rules.
This supports 'make build_config', which builds scripts/kconfig/conf but does not invoke it.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
ae8da72b |
| 21-Feb-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: omit --oldaskconfig option for 'make config'
scripts/kconfig/conf.c line 39 defines the default of input_mode as oldaskconfig. Hence, 'make config' works in the same way even without the --
kconfig: omit --oldaskconfig option for 'make config'
scripts/kconfig/conf.c line 39 defines the default of input_mode as oldaskconfig. Hence, 'make config' works in the same way even without the --oldaskconfig option given. Note this in the help message.
This will be helpful to unify build rules in Makefile in the next commit.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
9bba03d4 |
| 23-Dec-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: remove 'kvmconfig' and 'xenconfig' shorthands
Linux 5.10 is out. Remove the 'kvmconfig' and 'xenconfig' shorthands as previously announced.
Signed-off-by: Masahiro Yamada <masahiroy@kernel
kconfig: remove 'kvmconfig' and 'xenconfig' shorthands
Linux 5.10 is out. Remove the 'kvmconfig' and 'xenconfig' shorthands as previously announced.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
23cd88c9 |
| 21-Aug-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: hide commands to run Kconfig, and show short log for syncconfig
Some targets (localyesconfig, localmodconfig, defconfig) hide the command running, but the others do not.
Users know which Kc
kbuild: hide commands to run Kconfig, and show short log for syncconfig
Some targets (localyesconfig, localmodconfig, defconfig) hide the command running, but the others do not.
Users know which Kconfig flavor they are running, so it is OK to hide the command. Add $(Q) to all commands consistently. If you want to see the full command running, pass V=1 from the command line.
syncconfig is the exceptional case, which occurs without explicit command invocation by the user. Display the Kbuild-style log for it. The ugly bare log will go away.
[Before]
scripts/kconfig/conf --syncconfig Kconfig
[After]
SYNC include/config/auto.conf
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
0e912c03 |
| 29-Jul-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: qconf: compile moc object separately
Currently, qconf.moc is included from qconf.cc but they can be compiled independently.
When you modify qconf.cc, qconf.moc does not need recompiling.
kconfig: qconf: compile moc object separately
Currently, qconf.moc is included from qconf.cc but they can be compiled independently.
When you modify qconf.cc, qconf.moc does not need recompiling.
Rename qconf.moc to qconf-moc.cc, and split it out as an independent compilation unit.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
c3cd7cfa |
| 29-Jul-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: qconf: use if_changed for qconf.moc rule
Regenerate qconf.moc when the moc command is changed.
This also allows 'make mrproper' to clean it up. Previously, it was not cleaned up because 'c
kconfig: qconf: use if_changed for qconf.moc rule
Regenerate qconf.moc when the moc command is changed.
This also allows 'make mrproper' to clean it up. Previously, it was not cleaned up because 'clean-files += qconf.moc' was missing. Now 'make mrproper' correctly cleans it up because files listed in 'targets' are cleaned.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
bcfefb61 |
| 30-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: announce removal of 'kvmconfig' and 'xenconfig' shorthands
kvmconfig' is a shorthand for kvm_guest.config to save 7 character typing.
xenconfig' is a shorthand for xen.config to save 1 cha
kconfig: announce removal of 'kvmconfig' and 'xenconfig' shorthands
kvmconfig' is a shorthand for kvm_guest.config to save 7 character typing.
xenconfig' is a shorthand for xen.config to save 1 character typing.
There is nothing more than that.
There are more files in kernel/configs/, so it is not maintainable to wire-up every config fragment to the Kconfig Makefile. Hence, we should not do this at all.
These will be removed after Linux 5.10. Meanwhile, the following warning message will be displayed if they are used.
WARNING: 'make kvmconfig' will be removed after Linux 5.10 Please use 'make kvm_guest.config' instead.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
c027b02d |
| 12-May-2020 |
Changbin Du <changbin.du@gmail.com> |
streamline_config.pl: add LMC_KEEP to preserve some kconfigs
Sometimes it is useful to preserve batches of configs when making localmodconfig. For example, I usually don't want any usb and fs module
streamline_config.pl: add LMC_KEEP to preserve some kconfigs
Sometimes it is useful to preserve batches of configs when making localmodconfig. For example, I usually don't want any usb and fs modules to be disabled. Now we can do it by:
$ make LMC_KEEP="drivers/usb:fs" localmodconfig
Signed-off-by: Changbin Du <changbin.du@gmail.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
2a86f661 |
| 28-Feb-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
Most of the Kconfig commands (except defconfig and all*config) read the .config file as a base set of CONFIG options.
When it does no
kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
Most of the Kconfig commands (except defconfig and all*config) read the .config file as a base set of CONFIG options.
When it does not exist, the files in DEFCONFIG_LIST are searched in this order and loaded if found.
I do not see much sense in the last two lines in DEFCONFIG_LIST.
[1] ARCH_DEFCONFIG
The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should be a fixed string because the base config file is loaded before the symbol evaluation stage.
Using KBUILD_DEFCONFIG makes more sense because it is fixed before Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
[2] arch/$(ARCH)/defconfig
This file path is no longer valid. The defconfig files are always located in the arch configs/ directories.
$ find arch -name defconfig | sort arch/alpha/configs/defconfig arch/arm64/configs/defconfig arch/csky/configs/defconfig arch/nds32/configs/defconfig arch/riscv/configs/defconfig arch/s390/configs/defconfig arch/unicore32/configs/defconfig
The path arch/*/configs/defconfig is already covered by "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is not necessary.
I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise, the 7 architectures listed above would end up with endless loop of syncconfig.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
5f2fb52f |
| 01-Feb-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: rename hostprogs-y/always to hostprogs/always-y
In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004.
It is typica
kbuild: rename hostprogs-y/always to hostprogs/always-y
In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004.
It is typically useful in scripts/Makefile because it allows Kbuild to selectively compile host programs based on the kernel configuration.
This commit renames like follows:
always -> always-y hostprogs-y -> hostprogs
So, scripts/Makefile will look like this:
always-$(CONFIG_BUILD_BIN2C) += ... always-$(CONFIG_KALLSYMS) += ... ... hostprogs := $(always-y) $(always-m)
I think this makes more sense because a host program is always a host program, irrespective of the kernel configuration. We want to specify which ones to compile by CONFIG options, so always-y will be handier.
The "always", "hostprogs-y", "hostprogs-m" will be kept for backward compatibility for a while.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
89b90609 |
| 17-Dec-2019 |
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> |
kconfig: Add yes2modconfig and mod2yesconfig targets.
Since kernel configs provided by syzbot are close to "make allyesconfig", it takes long time to rebuild. This is especially waste of time when w
kconfig: Add yes2modconfig and mod2yesconfig targets.
Since kernel configs provided by syzbot are close to "make allyesconfig", it takes long time to rebuild. This is especially waste of time when we need to rebuild for many times (e.g. doing manual printk() inspection, bisect operations).
We can save time if we can exclude modules which are irrelevant to each problem. But "make localmodconfig" cannot exclude modules which are built into vmlinux because /sbin/lsmod output is used as the source of modules.
Therefore, this patch adds "make yes2modconfig" which converts from =y to =m if possible. After confirming that the interested problem is still reproducible, we can try "make localmodconfig" (and/or manually tune based on "Modules linked in:" line) in order to exclude modules which are irrelevant to the interested problem. While we are at it, this patch also adds "make mod2yesconfig" which converts from =m to =y in case someone wants to convert from =m to =y after "make localmodconfig".
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|