[openwrt/openwrt] generic: Kconfig: exit on unset symbol

LEDE Commits lede-commits at lists.infradead.org
Tue Aug 10 04:14:57 PDT 2021


blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/eaa9c94c75748265b9260691d5f59c9d3711f7d4

commit eaa9c94c75748265b9260691d5f59c9d3711f7d4
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Fri Jul 23 01:32:38 2021 +0200

    generic: Kconfig: exit on unset symbol
    
    When a target configuration has unser Kconfig symbols, the build will
    fail when OpenWrt is compiled with V=s and stdin is connected to a tty.
    
    In case OpenWrt is compiled without either of these preconditions, the
    build will uscceed with the symbols in question being unset.
    
    Modify the kernel configuration in a way it fails on unset symbols
    regardless of the aformentioned preconditions.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 include/kernel-build.mk                               |  1 +
 target/linux/generic/hack-5.10/205-kconfig-exit.patch | 11 +++++++++++
 target/linux/generic/hack-5.4/205-kconfig-exit.patch  | 11 +++++++++++
 3 files changed, 23 insertions(+)

diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 66a9f64c80..80da4455bc 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -132,6 +132,7 @@ define BuildKernel
   $(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
   $(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
   $(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
+  $(LINUX_DIR)/.modules: export FAIL_ON_UNCONFIGURED=1
   $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
 	$(Kernel/CompileModules)
 	touch $$@
diff --git a/target/linux/generic/hack-5.10/205-kconfig-exit.patch b/target/linux/generic/hack-5.10/205-kconfig-exit.patch
new file mode 100644
index 0000000000..8931ad3270
--- /dev/null
+++ b/target/linux/generic/hack-5.10/205-kconfig-exit.patch
@@ -0,0 +1,11 @@
+--- a/scripts/kconfig/conf.c
++++ b/scripts/kconfig/conf.c
+@@ -212,6 +212,8 @@ static int conf_sym(struct menu *menu)
+ 				break;
+ 			continue;
+ 		case 0:
++			if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED"))
++				exit(1);
+ 			newval = oldval;
+ 			break;
+ 		case '?':
diff --git a/target/linux/generic/hack-5.4/205-kconfig-exit.patch b/target/linux/generic/hack-5.4/205-kconfig-exit.patch
new file mode 100644
index 0000000000..8931ad3270
--- /dev/null
+++ b/target/linux/generic/hack-5.4/205-kconfig-exit.patch
@@ -0,0 +1,11 @@
+--- a/scripts/kconfig/conf.c
++++ b/scripts/kconfig/conf.c
+@@ -212,6 +212,8 @@ static int conf_sym(struct menu *menu)
+ 				break;
+ 			continue;
+ 		case 0:
++			if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED"))
++				exit(1);
+ 			newval = oldval;
+ 			break;
+ 		case '?':



More information about the lede-commits mailing list