bd5c54d4b8b73b36c9f5b809447a8e76fce19e5d
[openwrt/openwrt.git] / target / linux / generic / hack-5.10 / 205-kconfig-abort-configuration-on-unset-symbol.patch
1 From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Fri, 11 Nov 2022 13:33:44 +0100
4 Subject: [PATCH] kconfig: abort configuration on unset symbol
5
6 When a target configuration has unset Kconfig symbols, the build will
7 fail when OpenWrt is compiled with V=s and stdin is connected to a tty.
8
9 In case OpenWrt is compiled without either of these preconditions, the
10 build will succeed with the symbols in question being unset.
11
12 Modify the kernel configuration in a way it fails on unset symbols
13 regardless of the aforementioned preconditions.
14
15 Signed-off-by: David Bauer <mail@david-bauer.net>
16 ---
17 scripts/kconfig/conf.c | 6 ++++++
18 1 file changed, 6 insertions(+)
19
20 --- a/scripts/kconfig/conf.c
21 +++ b/scripts/kconfig/conf.c
22 @@ -109,6 +109,9 @@ static int conf_askvalue(struct symbol *
23 }
24 /* fall through */
25 case oldaskconfig:
26 + if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
27 + exit(1);
28 + }
29 fflush(stdout);
30 xfgets(line, sizeof(line), stdin);
31 return 1;
32 @@ -303,6 +306,9 @@ static int conf_choice(struct menu *menu
33 }
34 /* fall through */
35 case oldaskconfig:
36 + if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) {
37 + exit(1);
38 + }
39 fflush(stdout);
40 xfgets(line, sizeof(line), stdin);
41 strip(line);