Skip to content

Commit

Permalink
generic: Kconfig: exit on unset symbol
Browse files Browse the repository at this point in the history
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@david-bauer.net>
  • Loading branch information
blocktrron committed Aug 10, 2021
1 parent 29a3967 commit eaa9c94
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/kernel-build.mk
Expand Up @@ -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 $$@
Expand Down
11 changes: 11 additions & 0 deletions 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 '?':
11 changes: 11 additions & 0 deletions 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 '?':

0 comments on commit eaa9c94

Please sign in to comment.