From dd4659963a4d2dde9756e31ffe5d7c639bcaa26e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 14 Mar 2021 04:48:33 +0900 Subject: 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 --- Makefile | 3 --- 1 file changed, 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a28bb374663d..f1093b972708 100644 --- a/Makefile +++ b/Makefile @@ -396,9 +396,6 @@ 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 -- cgit v1.2.3 From f02aa48dde8b96eef5998b049ad11547bfc16080 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 10 Apr 2021 23:31:58 +0900 Subject: 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 --- Makefile | 5 +++++ scripts/kconfig/Makefile | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f1093b972708..697eaf6c550e 100644 --- a/Makefile +++ b/Makefile @@ -393,6 +393,11 @@ ifeq ($(ARCH),sh64) SRCARCH := sh endif +export cross_compiling := +ifneq ($(SRCARCH),$(SUBARCH)) +cross_compiling := 1 +endif + KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 46f2465177f0..1d1a7f83ee8d 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -18,14 +18,14 @@ silent := -s endif export KCONFIG_DEFCONFIG_LIST := -ifneq ($(SRCARCH),um) +ifndef cross_compiling kernel-release := $(shell uname -r) -KCONFIG_DEFCONFIG_LIST := \ +KCONFIG_DEFCONFIG_LIST += \ /lib/modules/$(kernel-release)/.config \ /etc/kernel-config \ - /boot/config-$(kernel-release) \ - arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) + /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_ -- cgit v1.2.3