2
0

205-kconfig-abort-configuration-on-unset-symbol.patch 1.3 KB

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