Skip to contentSkip to conversation

Kconfig no longer outputs a .config with freshly updated defconfigs

DISCUSSION Josh Boyer 4 participants 9 messages Aug 2, 2008 – Aug 9, 2008

Subsystems (2)
lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

josh

#1 lore raw
Quoted 30 lines · Josh Boyer

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#
Quoted 7 lines

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

Thanks for your bug report, this should have worked.

@Sam:
I've bisected this and it is caused by
commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
(kconfig: speed up all*config + randconfig).

Minimal example for reproducing it:

make x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
rm .config
make x86_64_defconfig
ls .config

Quoted 1 line

josh

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#2 lore raw
Quoted 39 lines · On Sat, 2 Aug 2008 22:26:47 +0300 Adrian Bunk <[email protected]> wrote:
Quoted 30 lines · Josh Boyer

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#
Quoted 7 lines

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

Quoted 6 lines

Thanks for your bug report, this should have worked.

@Sam:
I've bisected this and it is caused by
commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
(kconfig: speed up all*config + randconfig).

Thanks Adrian. I had intended to bisect it this evening, but you beat me to the punch.

josh

#3 lore raw
In reply to Adrian Bunk
Quoted 46 lines · Adrian Bunk
Quoted 30 lines · Josh Boyer

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#
Quoted 7 lines

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

Thanks for your bug report, this should have worked.

@Sam:
I've bisected this and it is caused by
commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
(kconfig: speed up all*config + randconfig).

Quoted 7 lines

Minimal example for reproducing it:

make x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
rm .config
make x86_64_defconfig
ls .config

Thanks Adrian.

The code has started to check if anything changed and if not - then do not write out a new config. So in your sample above we would not see any changes compared to what we read in autoconf.h so we did nto write out a new autoconf.h (and thus no .config).

The right fix seems to check for .config and for changes and in both cases to write a new config.

Patch below.

Sam

scripts/kconfig/conf.c +16 -1
index 9fba838..7c938c2 100644
@@ -464,6 +464,21 @@ static int conf_update(void)
 	return 0;
 }
 
+/* Write out config if config has changed or .config is missing */
+static int conf_do_write(void)
+{
+	struct stat tmpstat;
+
+	/* Any config changes */
+	if (conf_get_changed())
+		return 1;
+	/* .config missing */
+	if (stat(conf_get_configname(), &tmpstat))
+		return 1;
+
+	return 0;
+}
+
 int main(int ac, char **av)
 {
 	int opt;
@@ -596,7 +611,7 @@ int main(int ac, char **av)
 		break;
 	}
 
-	if (conf_get_changed() && conf_write(NULL)) {
+	if (conf_do_write() && conf_write(NULL)) {
 		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
 		exit(1);
 	}
#4 lore raw
Quoted 63 lines · Sam Ravnborg
Quoted 46 lines · Adrian Bunk
Quoted 30 lines · Josh Boyer

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#
Quoted 7 lines

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

Thanks for your bug report, this should have worked.

@Sam:
I've bisected this and it is caused by
commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
(kconfig: speed up all*config + randconfig).

Quoted 7 lines

Minimal example for reproducing it:

make x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
rm .config
make x86_64_defconfig
ls .config

Thanks Adrian.

The code has started to check if anything changed and if not - then do not write out a new config. So in your sample above we would not see any changes compared to what we read in autoconf.h so we did nto write out a new autoconf.h (and thus no .config).

Quoted 4 lines

The right fix seems to check for .config and for changes and in both cases to write a new config.

Patch below.

This breaks with:

make ARCH=x86 x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
make ARCH=x86 i386_defconfig
make ARCH=x86 x86_64_defconfig

Why can't we simply always write the .config?

Quoted 2 lines

Sam
...

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
Quoted 69 lines · Adrian Bunk
Quoted 63 lines · Sam Ravnborg
Quoted 46 lines · Adrian Bunk
Quoted 30 lines · Josh Boyer

I was going through the somewhat tedious task of updating the 4xx defconfigs today, and I noticed some odd behavior from Kconfig. Basically, I would do:

	make ppc44x_defconfig
	make oldconfig
	<build>
	cp .config arch/powerpc/configs/ppc44x_defconfig
	make distclean

I did this for a number of configs. Then I went back and tried to build ppc44x_defconfig again and I got this result:

[jwboyer@localhost linux-2.6]$ make ppc44x_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
HOSTLD scripts/kconfig/conf
[jwboyer@localhost linux-2.6]$ make oldconfig scripts/kconfig/conf -o arch/powerpc/Kconfig
#

# using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
#
Quoted 7 lines

There was no .config file present after the initial 'make ppc44x_defconfig', so it defaulted to using something in /boot. I'm a bit baffled here, but that seems to be common to any newly updated defconfig I've done.

Was there a change to Kconfig recently that won't copy the defconfig file to .config if there are no symbol changes or something like that?

Thanks for your bug report, this should have worked.

@Sam:
I've bisected this and it is caused by
commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
(kconfig: speed up all*config + randconfig).

Quoted 7 lines

Minimal example for reproducing it:

make x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
rm .config
make x86_64_defconfig
ls .config

Thanks Adrian.

The code has started to check if anything changed and if not - then do not write out a new config. So in your sample above we would not see any changes compared to what we read in autoconf.h so we did nto write out a new autoconf.h (and thus no .config).

Quoted 4 lines

The right fix seems to check for .config and for changes and in both cases to write a new config.

Patch below.

Quoted 8 lines

This breaks with:

make ARCH=x86 x86_64_defconfig
cp .config arch/x86/configs/x86_64_defconfig
make ARCH=x86 i386_defconfig
make ARCH=x86 x86_64_defconfig

Why can't we simply always write the .config?

Hi Adrian.

I just pushed a patch that does this.

Thanks,
Sam

#6 lore raw

Hi,

Quoted 5 lines · Sam Ravnborg
Quoted 1 line

Why can't we simply always write the .config?

Hi Adrian.

I just pushed a patch that does this.

If I see it correctly that's not quite correct either. The old silentoldconfig does a few things differently than a normal config target, because it's a special target called by Kbuild when needed:

- bail out if input is needed but stdio is not a tty
- silent mode
- update .config only as needed
- always update autoconf

With the change to make the silent mode the default, the "silent" name has become a little obsolete and should probably be renamed, but whatever the name above actions should still be done if called by Kbuild internally.

bye, Roman

#7 lore raw
Quoted 14 lines · Roman Zippel

Hi,

Quoted 5 lines · Sam Ravnborg
Quoted 1 line

Why can't we simply always write the .config?

Hi Adrian.

I just pushed a patch that does this.

If I see it correctly that's not quite correct either. The old silentoldconfig does a few things differently than a normal config target, because it's a special target called by Kbuild when needed:

Quoted 8 lines

- bail out if input is needed but stdio is not a tty
- silent mode
- update .config only as needed
- always update autoconf

With the change to make the silent mode the default, the "silent" name has become a little obsolete and should probably be renamed, but whatever the name above actions should still be done if called by Kbuild internally.

silentoldconfig now always update .config - and that a bug. I was too hasty ghere - sorry.
Will fix it during the weekend.

Sam

#8 lore raw

Hi,

Quoted 3 lines · Sam Ravnborg

silentoldconfig now always update .config - and that a bug. I was too hasty ghere - sorry.
Will fix it during the weekend.

I looked over it a bit more carefully and a few other things. KCONFIG_NOSILENTUPDATE wasn't quite working anymore - it should only be checked during the kbuild config call.
Removing the warning in confdata.c had the side effect, that the change counter was incremented anymore.
To make things more explicit, I added a new syncconfig target and silentoldconfig and oldconfig are doing now the same. In conf.c it should also be more obvious now, what belongs to the user config update and the kbuild config update.

bye, Roman

---
 Makefile                   |    2 
 scripts/kconfig/Makefile   |   11 ++-
 scripts/kconfig/conf.c     |  126 +++++++++++++++++++++------------------------
 scripts/kconfig/confdata.c |    8 ++
 4 files changed, 74 insertions(+), 73 deletions(-)
Makefile +1 -1
Index: linux-2.6/Makefile
===================================================================
@@ -481,7 +481,7 @@ $(KCONFIG_CONFIG) include/config/auto.co
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
-	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
 else
 # external modules needs include/linux/autoconf.h and include/config/auto.conf
 # but do not care if they are up-to-date. Use auto.conf to trigger the test
scripts/kconfig/Makefile +7 -4
Index: linux-2.6/scripts/kconfig/Makefile
===================================================================
@@ -2,7 +2,7 @@
 # Kernel configuration targets
 # These targets are used from top-level makefile
 
-PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
+PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig syncconfig update-po-config
 
 Kconfig := arch/$(SRCARCH)/Kconfig
 
@@ -18,12 +18,15 @@ menuconfig: $(obj)/mconf
 config: $(obj)/conf
 	$< $(Kconfig)
 
-oldconfig: $(obj)/conf
-	$< -o $(Kconfig)
-
 silentoldconfig: $(obj)/conf
 	$< -s $(Kconfig)
 
+oldconfig: $(obj)/conf
+	$< -s $(Kconfig)
+
+syncconfig: $(obj)/conf
+	$< -k $(Kconfig)
+
 # Create new linux.pot file
 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
 # The symlink is used to repair a deficiency in arch/um
scripts/kconfig/conf.c +60 -66

191 lines not on this page · raw message

scripts/kconfig/confdata.c +6 -2
Index: linux-2.6/scripts/kconfig/confdata.c
===================================================================
@@ -222,8 +222,10 @@ load:
 				continue;
 			if (def == S_DEF_USER) {
 				sym = sym_find(line + 9);
-				if (!sym)
+				if (!sym) {
+					sym_add_change_count(1);
 					break;
+				}
 			} else {
 				sym = sym_lookup(line + 9, 0);
 				if (sym->type == S_UNKNOWN)
@@ -259,8 +261,10 @@ load:
 			}
 			if (def == S_DEF_USER) {
 				sym = sym_find(line + 7);
-				if (!sym)
+				if (!sym) {
+					sym_add_change_count(1);
 					break;
+				}
 			} else {
 				sym = sym_lookup(line + 7, 0);
 				if (sym->type == S_UNKNOWN)