aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-07-20 03:46:30 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-07-25 10:25:30 -0400
commit16952b77d8b542fe5f3d73065a50842885b2ba0b (patch)
tree281436ade4ea8d90303413601e42f50759da19de /scripts/kconfig
parent79123b1389cc775d8e60cb026256f79f0daef173 (diff)
kconfig: make syncconfig update .config regardless of sym_change_count
syncconfig updates the .config only when sym_change_count > 0, i.e. any change in config symbols has been detected. Not only symbols but also comments are contained in the .config file. If only comments are updated, they are not fed back to the .config, then the stale comments are left-over. Of course, this is just a matter of comments, but why not fix it. I see some scenarios where this happens. Scenario A: 1. You have a source tree that has already been configured. 2. Linus increments the version number in the top-level Makefile (i.e. he commits a new release) 3. You pull it, and run 'make' 4. syncconfig is invoked because the environment variable, KERNELVERSION is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains a kernel version in the top line: # Automatically generated file; DO NOT EDIT. # Linux/arm64 4.18.0-rc2 Kernel Configuration ... which points to a previous version. Scenario B: 1. You have a source tree that has already been configured. 2. You upgrade the compiler, but it still has the same version number. This may happen if you regularly build the latest compiler from the source code. 3. You run 'make' 4. syncconfig is invoked because the environment variable, CC_VERSION_TEXT is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains the version string of the compiler: # # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental) # ... which carries the information of the old compiler. If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update the .config file. Otherwise, it is fine to update it regardless of sym_change_count. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/conf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 671ff5364497..5af899112cae 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -496,6 +496,7 @@ int main(int ac, char **av)
496 int opt; 496 int opt;
497 const char *name, *defconfig_file = NULL /* gcc uninit */; 497 const char *name, *defconfig_file = NULL /* gcc uninit */;
498 struct stat tmpstat; 498 struct stat tmpstat;
499 int no_conf_write = 0;
499 500
500 tty_stdio = isatty(0) && isatty(1); 501 tty_stdio = isatty(0) && isatty(1);
501 502
@@ -633,13 +634,14 @@ int main(int ac, char **av)
633 } 634 }
634 635
635 if (sync_kconfig) { 636 if (sync_kconfig) {
636 if (conf_get_changed()) { 637 name = getenv("KCONFIG_NOSILENTUPDATE");
637 name = getenv("KCONFIG_NOSILENTUPDATE"); 638 if (name && *name) {
638 if (name && *name) { 639 if (conf_get_changed()) {
639 fprintf(stderr, 640 fprintf(stderr,
640 "\n*** The configuration requires explicit update.\n\n"); 641 "\n*** The configuration requires explicit update.\n\n");
641 return 1; 642 return 1;
642 } 643 }
644 no_conf_write = 1;
643 } 645 }
644 } 646 }
645 647
@@ -688,7 +690,7 @@ int main(int ac, char **av)
688 /* syncconfig is used during the build so we shall update autoconf. 690 /* syncconfig is used during the build so we shall update autoconf.
689 * All other commands are only used to generate a config. 691 * All other commands are only used to generate a config.
690 */ 692 */
691 if (conf_get_changed() && conf_write(NULL)) { 693 if (!no_conf_write && conf_write(NULL)) {
692 fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); 694 fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
693 exit(1); 695 exit(1);
694 } 696 }