2008-08-02 16:03:52

by Josh Boyer

[permalink] [raw]
Subject: Kconfig no longer outputs a .config with freshly updated defconfigs

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


2008-08-02 19:28:07

by Adrian Bunk

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> 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?

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

> josh

cu
Adrian

--

"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

2008-08-02 23:58:39

by Josh Boyer

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Sat, 2 Aug 2008 22:26:47 +0300
Adrian Bunk <[email protected]> wrote:

> On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> > 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?
>
> 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

2008-08-03 08:02:33

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Sat, Aug 02, 2008 at 10:26:47PM +0300, Adrian Bunk wrote:
> On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> > 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?
>
> 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

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


diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9fba838..7c938c2 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -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);
}

2008-08-03 10:08:53

by Adrian Bunk

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Sun, Aug 03, 2008 at 10:00:19AM +0200, Sam Ravnborg wrote:
> On Sat, Aug 02, 2008 at 10:26:47PM +0300, Adrian Bunk wrote:
> > On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> > > 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?
> >
> > 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
>
> 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.

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?

> Sam
>...

cu
Adrian

--

"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

2008-08-04 21:08:36

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Sun, Aug 03, 2008 at 01:07:32PM +0300, Adrian Bunk wrote:
> On Sun, Aug 03, 2008 at 10:00:19AM +0200, Sam Ravnborg wrote:
> > On Sat, Aug 02, 2008 at 10:26:47PM +0300, Adrian Bunk wrote:
> > > On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> > > > 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?
> > >
> > > 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
> >
> > 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.
>
> 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

2008-08-05 02:53:30

by Roman Zippel

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

Hi,

On Mon, 4 Aug 2008, Sam Ravnborg wrote:

> > 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

2008-08-05 20:51:26

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

On Tue, Aug 05, 2008 at 04:50:16AM +0200, Roman Zippel wrote:
> Hi,
>
> On Mon, 4 Aug 2008, Sam Ravnborg wrote:
>
> > > 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.

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

Sam

2008-08-09 05:29:19

by Roman Zippel

[permalink] [raw]
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs

Hi,

On Tue, 5 Aug 2008, Sam Ravnborg wrote:

> 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

Signed-off-by: Roman Zippel <[email protected]>

---
Makefile | 2
scripts/kconfig/Makefile | 11 ++-
scripts/kconfig/conf.c | 126 +++++++++++++++++++++------------------------
scripts/kconfig/confdata.c | 8 ++
4 files changed, 74 insertions(+), 73 deletions(-)

Index: linux-2.6/Makefile
===================================================================
--- linux-2.6.orig/Makefile
+++ 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
Index: linux-2.6/scripts/kconfig/Makefile
===================================================================
--- linux-2.6.orig/scripts/kconfig/Makefile
+++ 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
Index: linux-2.6/scripts/kconfig/conf.c
===================================================================
--- linux-2.6.orig/scripts/kconfig/conf.c
+++ linux-2.6/scripts/kconfig/conf.c
@@ -32,6 +32,7 @@ char *defconfig_file;

static int indent = 1;
static int valid_stdin = 1;
+static int sync_kconfig;
static int conf_cnt;
static char line[128];
static struct menu *rootEntry;
@@ -65,7 +66,7 @@ static void strip(char *str)

static void check_stdin(void)
{
- if (!valid_stdin && input_mode == ask_silent) {
+ if (!valid_stdin) {
printf(_("aborted!\n\n"));
printf(_("Console input/output is redirected. "));
printf(_("Run 'make oldconfig' to update configuration.\n\n"));
@@ -427,43 +428,6 @@ static void check_conf(struct menu *menu
check_conf(child);
}

-static void conf_do_update(void)
-{
- /* Update until a loop caused no more changes */
- do {
- conf_cnt = 0;
- check_conf(&rootmenu);
- } while (conf_cnt);
-}
-
-static int conf_silent_update(void)
-{
- const char *name;
-
- if (conf_get_changed()) {
- name = getenv("KCONFIG_NOSILENTUPDATE");
- if (name && *name) {
- fprintf(stderr,
- _("\n*** Kernel configuration requires explicit update.\n\n"));
- return 1;
- }
- conf_do_update();
- }
- return 0;
-}
-
-static int conf_update(void)
-{
- rootEntry = &rootmenu;
- conf(&rootmenu);
- if (input_mode == ask_all) {
- input_mode = ask_silent;
- valid_stdin = 1;
- }
- conf_do_update();
- return 0;
-}
-
int main(int ac, char **av)
{
int opt;
@@ -474,14 +438,13 @@ int main(int ac, char **av)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);

- while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
+ while ((opt = getopt(ac, av, "osdD:nmyrhk")) != -1) {
switch (opt) {
case 'o':
input_mode = ask_new;
break;
case 's':
input_mode = ask_silent;
- valid_stdin = isatty(0) && isatty(1) && isatty(2);
break;
case 'd':
input_mode = set_default;
@@ -507,6 +470,10 @@ int main(int ac, char **av)
printf(_("See README for usage info\n"));
exit(0);
break;
+ case 'k':
+ input_mode = ask_silent;
+ sync_kconfig = 1;
+ break;
default:
fprintf(stderr, _("See README for usage info\n"));
exit(1);
@@ -519,6 +486,19 @@ int main(int ac, char **av)
name = av[optind];
conf_parse(name);
//zconfdump(stdout);
+ if (sync_kconfig) {
+ if (stat(".config", &tmpstat)) {
+ fprintf(stderr, _("***\n"
+ "*** You have not yet configured your kernel!\n"
+ "*** (missing kernel .config file)\n"
+ "***\n"
+ "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
+ "*** \"make menuconfig\" or \"make xconfig\").\n"
+ "***\n"));
+ exit(1);
+ }
+ }
+
switch (input_mode) {
case set_default:
if (!defconfig_file)
@@ -531,16 +511,6 @@ int main(int ac, char **av)
}
break;
case ask_silent:
- if (stat(".config", &tmpstat)) {
- printf(_("***\n"
- "*** You have not yet configured your kernel!\n"
- "*** (missing kernel .config file)\n"
- "***\n"
- "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
- "*** \"make menuconfig\" or \"make xconfig\").\n"
- "***\n"));
- exit(1);
- }
case ask_all:
case ask_new:
conf_read(NULL);
@@ -569,6 +539,19 @@ int main(int ac, char **av)
default:
break;
}
+
+ if (sync_kconfig) {
+ if (conf_get_changed()) {
+ name = getenv("KCONFIG_NOSILENTUPDATE");
+ if (name && *name) {
+ fprintf(stderr,
+ _("\n*** Kernel configuration requires explicit update.\n\n"));
+ return 1;
+ }
+ }
+ valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ }
+
switch (input_mode) {
case set_no:
conf_set_all_new_symbols(def_no);
@@ -585,27 +568,38 @@ int main(int ac, char **av)
case set_default:
conf_set_all_new_symbols(def_default);
break;
- case ask_silent:
case ask_new:
- if (conf_silent_update())
- exit(1);
- break;
case ask_all:
- if (conf_update())
- exit(1);
+ rootEntry = &rootmenu;
+ conf(&rootmenu);
+ input_mode = ask_silent;
+ /* fall through */
+ case ask_silent:
+ /* Update until a loop caused no more changes */
+ do {
+ conf_cnt = 0;
+ check_conf(&rootmenu);
+ } while (conf_cnt);
break;
}

- if (conf_write(NULL)) {
- fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
- exit(1);
- }
- /* ask_silent is used during the build so we shall update autoconf.
- * All other commands are only used to generate a config.
- */
- if (input_mode == ask_silent && conf_write_autoconf()) {
- fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
- return 1;
+ if (sync_kconfig) {
+ /* sync_kconfig is used during the build so we shall update autoconf.
+ * All other commands are only used to generate a config.
+ */
+ if (conf_get_changed() && conf_write(NULL)) {
+ fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
+ exit(1);
+ }
+ if (conf_write_autoconf()) {
+ fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n"));
+ return 1;
+ }
+ } else {
+ if (conf_write(NULL)) {
+ fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
+ exit(1);
+ }
}
return 0;
}
Index: linux-2.6/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6.orig/scripts/kconfig/confdata.c
+++ 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)