[openwrt/openwrt] kconfig: abort configuration on unset symbol

LEDE Commits lede-commits at lists.infradead.org
Sun Nov 13 07:49:46 PST 2022


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

commit fdcd383919e9ba6a8f6558a1eff9abf7175e872e
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Fri Nov 11 13:37:07 2022 +0100

    kconfig: abort configuration on unset symbol
    
    This fixes the initial patch to cover all cases where unset symbols are
    handled in the code.
    
    Fixes commit eaa9c94c7574 ("generic: Kconfig: exit on unset symbol")
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 ...onfig-abort-configuration-on-unset-symbol.patch | 41 ++++++++++++++++++++++
 .../linux/generic/hack-5.10/205-kconfig-exit.patch | 28 ---------------
 ...onfig-abort-configuration-on-unset-symbol.patch | 41 ++++++++++++++++++++++
 .../linux/generic/hack-5.15/205-kconfig-exit.patch | 20 -----------
 4 files changed, 82 insertions(+), 48 deletions(-)

diff --git a/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch b/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch
new file mode 100644
index 0000000000..bd5c54d4b8
--- /dev/null
+++ b/target/linux/generic/hack-5.10/205-kconfig-abort-configuration-on-unset-symbol.patch
@@ -0,0 +1,41 @@
+From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Fri, 11 Nov 2022 13:33:44 +0100
+Subject: [PATCH] kconfig: abort configuration on unset symbol
+
+When a target configuration has unset 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 succeed with the symbols in question being unset.
+
+Modify the kernel configuration in a way it fails on unset symbols
+regardless of the aforementioned preconditions.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ scripts/kconfig/conf.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/scripts/kconfig/conf.c
++++ b/scripts/kconfig/conf.c
+@@ -109,6 +109,9 @@ static int conf_askvalue(struct symbol *
+ 		}
+ 		/* fall through */
+ 	case oldaskconfig:
++		if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
++			exit(1);
++		}
+ 		fflush(stdout);
+ 		xfgets(line, sizeof(line), stdin);
+ 		return 1;
+@@ -303,6 +306,9 @@ static int conf_choice(struct menu *menu
+ 			}
+ 			/* fall through */
+ 		case oldaskconfig:
++			if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
++				exit(1);
++			}
+ 			fflush(stdout);
+ 			xfgets(line, sizeof(line), stdin);
+ 			strip(line);
diff --git a/target/linux/generic/hack-5.10/205-kconfig-exit.patch b/target/linux/generic/hack-5.10/205-kconfig-exit.patch
deleted file mode 100644
index 591daf624a..0000000000
--- a/target/linux/generic/hack-5.10/205-kconfig-exit.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: David Bauer <mail at david-bauer.net>
-Subject: Kconfig: exit on unset symbol
-
-When a target configuration has unset 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 succeed with the symbols in question being unset.
-
-Modify the kernel configuration in a way it fails on unset symbols
-regardless of the aforementioned preconditions.
-
-Submitted-by: David Bauer <mail at david-bauer.net>
----
- scripts/kconfig/conf.c                                |  2 +
- 1 files changed, 2 insertions(+)
-
---- a/scripts/kconfig/conf.c
-+++ b/scripts/kconfig/conf.c
-@@ -215,6 +215,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.15/205-kconfig-abort-configuration-on-unset-symbol.patch b/target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch
new file mode 100644
index 0000000000..a87c7a5116
--- /dev/null
+++ b/target/linux/generic/hack-5.15/205-kconfig-abort-configuration-on-unset-symbol.patch
@@ -0,0 +1,41 @@
+From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Fri, 11 Nov 2022 13:33:44 +0100
+Subject: [PATCH] kconfig: abort configuration on unset symbol
+
+When a target configuration has unset 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 succeed with the symbols in question being unset.
+
+Modify the kernel configuration in a way it fails on unset symbols
+regardless of the aforementioned preconditions.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ scripts/kconfig/conf.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/scripts/kconfig/conf.c
++++ b/scripts/kconfig/conf.c
+@@ -341,6 +341,9 @@ static int conf_askvalue(struct symbol *
+ 		}
+ 		/* fall through */
+ 	default:
++		if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
++			exit(1);
++		}
+ 		fflush(stdout);
+ 		xfgets(line, sizeof(line), stdin);
+ 		break;
+@@ -523,6 +526,9 @@ static int conf_choice(struct menu *menu
+ 			}
+ 			/* fall through */
+ 		case oldaskconfig:
++			if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
++				exit(1);
++			}
+ 			fflush(stdout);
+ 			xfgets(line, sizeof(line), stdin);
+ 			strip(line);
diff --git a/target/linux/generic/hack-5.15/205-kconfig-exit.patch b/target/linux/generic/hack-5.15/205-kconfig-exit.patch
deleted file mode 100644
index 9f3bb8f311..0000000000
--- a/target/linux/generic/hack-5.15/205-kconfig-exit.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From 300d26562ce4dc427154cb247beb75db4b1f0774 Mon Sep 17 00:00:00 2001
-From: OpenWrt community <openwrt-devel at lists.openwrt.org>
-Date: Wed, 13 Jul 2022 13:29:57 +0200
-Subject: [PATCH] scripts/Kconfig: Kconfig exit
-
----
- scripts/kconfig/conf.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/scripts/kconfig/conf.c
-+++ b/scripts/kconfig/conf.c
-@@ -435,6 +435,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