[RFC PATCH 1/3] kconfig: support an environment variable for non-interactive syncconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When Kconfig files are updated, or build environments etc. are changed,
'make syncconfig' is invoked, which will show prompts if new config
options are available.  Users must explicitly input values for all
new symbols.  This is the conventional behavior for the kernel build.

However, it would be useful to process this non-interactively in such
cases as package building.

Package maintainers create source packages with the .config configured
on their machines.  Package builders may work on different machine
environments, where different compilers are installed.

With the recent changes in Kconfig, the .config contents depend on
the compiler.  During package building, it is not sensible to show
prompts for new symbols; it would be just annoys script automation.

Add a new switch, KCONFIG_NONINTERACTIVE_UPDATE.  If this environment
variable is set, Kconfig will sync the configuration non-interactively.
All new symbols are silently set to their default values.

Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
---

 Documentation/kbuild/kconfig.txt | 6 ++++++
 scripts/kconfig/conf.c           | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index 68c8291..5c29c3f 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -129,6 +129,12 @@ KCONFIG_NOSILENTUPDATE
 If this variable has a non-blank value, it prevents silent kernel
 config updates (requires explicit updates).
 
+KCONFIG_NONINTERACTIVE_UPDATE
+--------------------------------------------------
+If this variable has a non-blank value, it prevents user input prompts
+from showing up even when new symbols are available.  All new symbols
+are silently set to their default values.
+
 KCONFIG_AUTOCONFIG
 --------------------------------------------------
 This environment variable can be set to specify the path & name of the
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 7b2b372..b64bbc0 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -680,6 +680,11 @@ int main(int ac, char **av)
 	case oldconfig:
 	case listnewconfig:
 	case syncconfig:
+		if (input_mode == syncconfig) {
+			name = getenv("KCONFIG_NONINTERACTIVE_UPDATE");
+			if (name && *name)
+				break;
+		}
 		/* Update until a loop caused no more changes */
 		do {
 			conf_cnt = 0;
-- 
2.7.4




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux