* [PATCH] Allow kconfig to accept overrides
@ 2007-10-12 21:44 Jan Engelhardt
2007-10-12 21:49 ` Randy Dunlap
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-12 21:44 UTC (permalink / raw)
To: zippel; +Cc: Linux Kernel Mailing List, randy.dunlap, sam
Allow config variables in .config to override earlier ones in the same
file. In other words,
# CONFIG_SECURITY is not defined
CONFIG_SECURITY=y
will activate it. This makes it a bit easier to do
(cat original-config myconfig myconfig2 ... >.config)
and run menuconfig as expected.
Previously sent:
http://lkml.org/lkml/2006/10/25/81
http://lkml.org/lkml/2007/4/1/175
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
---
scripts/kconfig/confdata.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
#
# Applies cleanly to 2.6.22/23/git.
#
Index: linux-2.6.22.1/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6.22.1.orig/scripts/kconfig/confdata.c
+++ linux-2.6.22.1/scripts/kconfig/confdata.c
@@ -170,8 +170,7 @@ load:
sym->type = S_BOOLEAN;
}
if (sym->flags & def_flags) {
- conf_warning("trying to reassign symbol %s", sym->name);
- break;
+ conf_warning("override: reassigning to symbol %s", sym->name);
}
switch (sym->type) {
case S_BOOLEAN:
@@ -210,8 +209,7 @@ load:
sym->type = S_OTHER;
}
if (sym->flags & def_flags) {
- conf_warning("trying to reassign symbol %s", sym->name);
- break;
+ conf_warning("override: reassigning to symbol %s", sym->name);
}
switch (sym->type) {
case S_TRISTATE:
@@ -288,11 +286,9 @@ load:
}
break;
case yes:
- if (cs->def[def].tri != no) {
- conf_warning("%s creates inconsistent choice state", sym->name);
- cs->flags &= ~def_flags;
- } else
- cs->def[def].val = sym;
+ if(cs->def[def].tri != no)
+ conf_warning("override: %s turns state choice", sym->name);
+ cs->def[def].val = sym;
break;
}
cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 21:44 [PATCH] Allow kconfig to accept overrides Jan Engelhardt
@ 2007-10-12 21:49 ` Randy Dunlap
2007-10-12 22:10 ` Jan Engelhardt
2007-10-12 22:57 ` Randy Dunlap
2007-10-16 4:29 ` Sam Ravnborg
2 siblings, 1 reply; 17+ messages in thread
From: Randy Dunlap @ 2007-10-12 21:49 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: zippel, Linux Kernel Mailing List, sam
Jan Engelhardt wrote:
> Allow config variables in .config to override earlier ones in the same
> file. In other words,
>
> # CONFIG_SECURITY is not defined
> CONFIG_SECURITY=y
>
> will activate it. This makes it a bit easier to do
>
> (cat original-config myconfig myconfig2 ... >.config)
>
> and run menuconfig as expected.
This is a feature that we want IMO, but I already do this without having
a patch for it (although to a lesser degree than full config files;
I just cat a few entries to the end of a config file then run oldconfig)...
so are there some cases where it works and some cases
where it doesn't work? Do you know what those cases are?
> Previously sent:
> http://lkml.org/lkml/2006/10/25/81
> http://lkml.org/lkml/2007/4/1/175
>
> Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Roman Zippel <zippel@linux-m68k.org>
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
>
> ---
> scripts/kconfig/confdata.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> #
> # Applies cleanly to 2.6.22/23/git.
> #
> Index: linux-2.6.22.1/scripts/kconfig/confdata.c
> ===================================================================
> --- linux-2.6.22.1.orig/scripts/kconfig/confdata.c
> +++ linux-2.6.22.1/scripts/kconfig/confdata.c
> @@ -170,8 +170,7 @@ load:
> sym->type = S_BOOLEAN;
> }
> if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", sym->name);
> - break;
> + conf_warning("override: reassigning to symbol %s", sym->name);
> }
> switch (sym->type) {
> case S_BOOLEAN:
> @@ -210,8 +209,7 @@ load:
> sym->type = S_OTHER;
> }
> if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", sym->name);
> - break;
> + conf_warning("override: reassigning to symbol %s", sym->name);
> }
> switch (sym->type) {
> case S_TRISTATE:
> @@ -288,11 +286,9 @@ load:
> }
> break;
> case yes:
> - if (cs->def[def].tri != no) {
> - conf_warning("%s creates inconsistent choice state", sym->name);
> - cs->flags &= ~def_flags;
> - } else
> - cs->def[def].val = sym;
> + if(cs->def[def].tri != no)
> + conf_warning("override: %s turns state choice", sym->name);
> + cs->def[def].val = sym;
> break;
> }
> cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
>
--
~Randy
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 21:49 ` Randy Dunlap
@ 2007-10-12 22:10 ` Jan Engelhardt
0 siblings, 0 replies; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-12 22:10 UTC (permalink / raw)
To: Randy Dunlap; +Cc: zippel, Linux Kernel Mailing List, sam
On Oct 12 2007 14:49, Randy Dunlap wrote:
> Jan Engelhardt wrote:
>> Allow config variables in .config to override earlier ones in the same
>> file. In other words,
>>
>> # CONFIG_SECURITY is not defined
>> CONFIG_SECURITY=y
>>
>> will activate it. This makes it a bit easier to do
>>
>> (cat original-config myconfig myconfig2 ... >.config)
>>
>> and run menuconfig as expected.
>
> This is a feature that we want IMO, but I already do this without having
> a patch for it (although to a lesser degree than full config files;
> I just cat a few entries to the end of a config file then run oldconfig)...
> so are there some cases where it works and some cases
> where it doesn't work? Do you know what those cases are?
$ echo "CONFIG_CRC7=m" >>../obj-2.6.23/.config
$ make O=/ws/linux/obj-2.6.23 menuconfig
GEN /ws/linux/obj-2.6.23/Makefile
scripts/kconfig/mconf arch/i386/Kconfig
.config:3669:warning: trying to reassign symbol CRC7
(Just save+exit)
$ grep CONFIG_CRC7 ../obj-2.6.23/.config
# CONFIG_CRC7 is not set
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 21:44 [PATCH] Allow kconfig to accept overrides Jan Engelhardt
2007-10-12 21:49 ` Randy Dunlap
@ 2007-10-12 22:57 ` Randy Dunlap
2007-10-12 23:29 ` Jan Engelhardt
2007-10-16 4:29 ` Sam Ravnborg
2 siblings, 1 reply; 17+ messages in thread
From: Randy Dunlap @ 2007-10-12 22:57 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: zippel, Linux Kernel Mailing List, sam
On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:
> Allow config variables in .config to override earlier ones in the same
> file. In other words,
>
> # CONFIG_SECURITY is not defined
> CONFIG_SECURITY=y
>
> will activate it. This makes it a bit easier to do
>
> (cat original-config myconfig myconfig2 ... >.config)
>
> and run menuconfig as expected.
>
> Previously sent:
> http://lkml.org/lkml/2006/10/25/81
> http://lkml.org/lkml/2007/4/1/175
>
> Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Roman Zippel <zippel@linux-m68k.org>
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
>
> ---
> scripts/kconfig/confdata.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> #
> # Applies cleanly to 2.6.22/23/git.
> #
> Index: linux-2.6.22.1/scripts/kconfig/confdata.c
> ===================================================================
> --- linux-2.6.22.1.orig/scripts/kconfig/confdata.c
> +++ linux-2.6.22.1/scripts/kconfig/confdata.c
> @@ -170,8 +170,7 @@ load:
> sym->type = S_BOOLEAN;
> }
> if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", sym->name);
> - break;
> + conf_warning("override: reassigning to symbol %s", sym->name);
> }
> switch (sym->type) {
> case S_BOOLEAN:
> @@ -210,8 +209,7 @@ load:
> sym->type = S_OTHER;
> }
> if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", sym->name);
> - break;
> + conf_warning("override: reassigning to symbol %s", sym->name);
> }
> switch (sym->type) {
> case S_TRISTATE:
> @@ -288,11 +286,9 @@ load:
> }
> break;
> case yes:
> - if (cs->def[def].tri != no) {
> - conf_warning("%s creates inconsistent choice state", sym->name);
> - cs->flags &= ~def_flags;
> - } else
> - cs->def[def].val = sym;
> + if(cs->def[def].tri != no)
if (
> + conf_warning("override: %s turns state choice", sym->name);
What does that warning message mean? I can't decipher it.
Other than that, it works for me. Thanks.
> + cs->def[def].val = sym;
> break;
> }
> cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
---
~Randy
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 22:57 ` Randy Dunlap
@ 2007-10-12 23:29 ` Jan Engelhardt
2007-10-12 23:32 ` Randy Dunlap
2007-10-13 8:16 ` Stefan Richter
0 siblings, 2 replies; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-12 23:29 UTC (permalink / raw)
To: Randy Dunlap; +Cc: zippel, Linux Kernel Mailing List, sam
On Oct 12 2007 15:57, Randy Dunlap wrote:
>On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:
>
>> warning("override: %s turns state choice", sym->name);
>
>What does that warning message mean? I can't decipher it.
It is when the value of a "choice" kconfig object is changed, for example
this .config excerpt:
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
# CONFIG_PREEMPT_BKL is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_REEMPT_VOLUNTARY=y
>Other than that, it works for me. Thanks.
/What/ works, the patch, or the tree without the patch? (Note I was
testing that on 2.6.23.1, not the git head, so if someone silently
merged things behind me, I might have missed it. Then again, that
would have probably caused an offset, fuzz or reject, which was not
the case.)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 23:29 ` Jan Engelhardt
@ 2007-10-12 23:32 ` Randy Dunlap
2007-10-13 8:16 ` Stefan Richter
1 sibling, 0 replies; 17+ messages in thread
From: Randy Dunlap @ 2007-10-12 23:32 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: zippel, Linux Kernel Mailing List, sam
Jan Engelhardt wrote:
> On Oct 12 2007 15:57, Randy Dunlap wrote:
>> On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:
>>
>>> warning("override: %s turns state choice", sym->name);
>> What does that warning message mean? I can't decipher it.
>
> It is when the value of a "choice" kconfig object is changed, for example
> this .config excerpt:
>
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT is not set
> # CONFIG_PREEMPT_BKL is not set
> # CONFIG_PREEMPT_NONE is not set
> CONFIG_REEMPT_VOLUNTARY=y
>
>> Other than that, it works for me. Thanks.
>
> /What/ works, the patch, or the tree without the patch? (Note I was
> testing that on 2.6.23.1, not the git head, so if someone silently
> merged things behind me, I might have missed it. Then again, that
> would have probably caused an offset, fuzz or reject, which was not
> the case.)
The patch and me modifying the .config file by hand to cause overrides.
--
~Randy
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 23:29 ` Jan Engelhardt
2007-10-12 23:32 ` Randy Dunlap
@ 2007-10-13 8:16 ` Stefan Richter
2007-10-13 11:39 ` Jan Engelhardt
1 sibling, 1 reply; 17+ messages in thread
From: Stefan Richter @ 2007-10-13 8:16 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Randy Dunlap, zippel, Linux Kernel Mailing List, sam
Jan Engelhardt wrote:
> On Oct 12 2007 15:57, Randy Dunlap wrote:
>>On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:
>>
>>> warning("override: %s turns state choice", sym->name);
>>
>>What does that warning message mean? I can't decipher it.
>
> It is when the value of a "choice" kconfig object is changed, for example
> this .config excerpt:
>
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT is not set
> # CONFIG_PREEMPT_BKL is not set
> # CONFIG_PREEMPT_NONE is not set
> CONFIG_REEMPT_VOLUNTARY=y
Perhaps say
warning("override: switching to choice %s", sym->name);
if sym->name is [CONFIG_]PREEMPT_VOLUNTARY. Or what is it?
--
Stefan Richter
-=====-=-=== =-=- -==-=
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 8:16 ` Stefan Richter
@ 2007-10-13 11:39 ` Jan Engelhardt
2007-10-13 14:01 ` Stefan Richter
0 siblings, 1 reply; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-13 11:39 UTC (permalink / raw)
To: Stefan Richter; +Cc: Randy Dunlap, zippel, Linux Kernel Mailing List, sam
On Oct 13 2007 10:16, Stefan Richter wrote:
>>>> warning("override: %s turns state choice", sym->name);
>>>
>>>What does that warning message mean? I can't decipher it.
>>
>> It is when the value of a "choice" kconfig object is changed, for example
>> this .config excerpt:
>>
>> CONFIG_PREEMPT_NONE=y
>> # CONFIG_PREEMPT_VOLUNTARY is not set
>> # CONFIG_PREEMPT is not set
>> # CONFIG_PREEMPT_BKL is not set
>> # CONFIG_PREEMPT_NONE is not set
>> CONFIG_REEMPT_VOLUNTARY=y
>
>Perhaps say
>
> warning("override: switching to choice %s", sym->name);
>
>if sym->name is [CONFIG_]PREEMPT_VOLUNTARY. Or what is it?
.config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
.config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
Which seems correct, as PREEMPT_VOLUNTARY=y will overturn
the previous decision.
Perhaps it should be "%s overturns state choice" ?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 11:39 ` Jan Engelhardt
@ 2007-10-13 14:01 ` Stefan Richter
2007-10-13 14:15 ` Jan Engelhardt
0 siblings, 1 reply; 17+ messages in thread
From: Stefan Richter @ 2007-10-13 14:01 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Randy Dunlap, zippel, Linux Kernel Mailing List, sam
Jan Engelhardt wrote:
> On Oct 13 2007 10:16, Stefan Richter wrote:
>> Perhaps say
>>
>> warning("override: switching to choice %s", sym->name);
>>
>> if sym->name is [CONFIG_]PREEMPT_VOLUNTARY. Or what is it?
>
> .config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
> .config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
Try to make it a single warning.
> Which seems correct, as PREEMPT_VOLUNTARY=y will overturn
> the previous decision.
>
> Perhaps it should be "%s overturns state choice" ?
Sounds like "overthrows government".
--
Stefan Richter
-=====-=-=== =-=- -==-=
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 14:01 ` Stefan Richter
@ 2007-10-13 14:15 ` Jan Engelhardt
2007-10-13 16:25 ` Randy Dunlap
0 siblings, 1 reply; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-13 14:15 UTC (permalink / raw)
To: Stefan Richter; +Cc: Randy Dunlap, zippel, Linux Kernel Mailing List, sam
On Oct 13 2007 16:01, Stefan Richter wrote:
>>
>> .config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
>> .config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
>
>Try to make it a single warning.
Patches welcome. Even without the patch, i.e. original kconfig
behavior, spews two warnings. One for the symbol, and one for the choiec
object. I do not see anything wrong with that; adding extra checks
would perhaps only increase the code size.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 14:15 ` Jan Engelhardt
@ 2007-10-13 16:25 ` Randy Dunlap
2007-10-13 16:36 ` Jan Engelhardt
0 siblings, 1 reply; 17+ messages in thread
From: Randy Dunlap @ 2007-10-13 16:25 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Stefan Richter, zippel, Linux Kernel Mailing List, sam
Jan Engelhardt wrote:
> On Oct 13 2007 16:01, Stefan Richter wrote:
>>> .config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
>>> .config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
.config:176:warning: override: PREEMPT_VOLUNTARY modifies state choice
"turns" is just odd there.
>> Try to make it a single warning.
>
> Patches welcome. Even without the patch, i.e. original kconfig
> behavior, spews two warnings. One for the symbol, and one for the choiec
> object. I do not see anything wrong with that; adding extra checks
> would perhaps only increase the code size.
--
~Randy
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 16:25 ` Randy Dunlap
@ 2007-10-13 16:36 ` Jan Engelhardt
2007-10-18 13:29 ` Sam Ravnborg
0 siblings, 1 reply; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-13 16:36 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Stefan Richter, zippel, Linux Kernel Mailing List, sam
On Oct 13 2007 09:25, Randy Dunlap wrote:
> Jan Engelhardt wrote:
>> On Oct 13 2007 16:01, Stefan Richter wrote:
>> > > .config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
>> > > .config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
>
> .config:176:warning: override: PREEMPT_VOLUNTARY modifies state choice
>
> "turns" is just odd there.
Yeah, I've put in
("override: %s changes choice state", sym->name);
this morning.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-12 21:44 [PATCH] Allow kconfig to accept overrides Jan Engelhardt
2007-10-12 21:49 ` Randy Dunlap
2007-10-12 22:57 ` Randy Dunlap
@ 2007-10-16 4:29 ` Sam Ravnborg
2007-10-16 5:14 ` Rob Landley
2007-10-16 14:44 ` Jan Engelhardt
2 siblings, 2 replies; 17+ messages in thread
From: Sam Ravnborg @ 2007-10-16 4:29 UTC (permalink / raw)
To: Jan Engelhardt, Rob Landley
Cc: zippel, Linux Kernel Mailing List, randy.dunlap
Hi Rob & Jan.
On Fri, Oct 12, 2007 at 11:44:08PM +0200, Jan Engelhardt wrote:
>
> Allow config variables in .config to override earlier ones in the same
> file. In other words,
>
> # CONFIG_SECURITY is not defined
> CONFIG_SECURITY=y
>
> will activate it. This makes it a bit easier to do
>
> (cat original-config myconfig myconfig2 ... >.config)
>
> and run menuconfig as expected.
How far is this from the miniconfig functionality?
Is it the same or can we achieve the miniconfig support
by extending Jan's patch?
See: http://lkml.org/lkml/2007/10/12/391
Sam
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-16 4:29 ` Sam Ravnborg
@ 2007-10-16 5:14 ` Rob Landley
2007-10-16 14:44 ` Jan Engelhardt
1 sibling, 0 replies; 17+ messages in thread
From: Rob Landley @ 2007-10-16 5:14 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Jan Engelhardt, zippel, Linux Kernel Mailing List, randy.dunlap
On Monday 15 October 2007 11:29:58 pm Sam Ravnborg wrote:
> Hi Rob & Jan.
>
> On Fri, Oct 12, 2007 at 11:44:08PM +0200, Jan Engelhardt wrote:
> > Allow config variables in .config to override earlier ones in the same
> > file. In other words,
> >
> > # CONFIG_SECURITY is not defined
> > CONFIG_SECURITY=y
> >
> > will activate it. This makes it a bit easier to do
> >
> > (cat original-config myconfig myconfig2 ... >.config)
> >
> > and run menuconfig as expected.
>
> How far is this from the miniconfig functionality?
> Is it the same or can we achieve the miniconfig support
> by extending Jan's patch?
>
> See: http://lkml.org/lkml/2007/10/12/391
Way way back (2.6.10 or thereabouts) I first did a miniconfig via running
allnoconfig, concatenating a miniconfig to the result, and running "make
oldconfig" on that. This concatenation method had two main problems:
1) Around 2.6.15 the kconfig infrastructure changed so the first instance
symbol won rather than the last symbol. It looks like this patch just sets
the behavior back to what we had in 2.6.14 and earlier.
2) When a symbol activates new subsymbols (opening a new menu, for example),
those dependant symbols would be activated at their oldconfig default values,
not their allnoconfig default values. This meant there might be a valid
configuration that you couldn't specify without saying "symbol=n" to turn
some of them off in your miniconfig, which is something a miniconfig should
never have to do. (This happens when allnoconfig and oldconfig are run in
two separate passes. The oldconfig pass uses the wrong default values for
newly enabled symbols. Menuconfig has the same defaults as oldconfig, which
are _not_ the same defaults as allnoconfig.)
Note that the infrastructure I'm using to _read_ miniconfig files is just a
repurpose of the existing KCONFIG_ALLCONFIG as applied to allnoconfig.
That's in kconfig already, has been since 2.6.15-ish, and works fine. The
syntax is nonobvious (two patches from me to improve said syntax and add some
error checking were rejected), but the functionality is there and easy enough
to trigger:
make allnoconfig KCONFIG_ALLCONFIG=mini.conf
That expands a mini.conf into a .config, and does the other setup necessary.
(You can feed that O= to build out of tree, or ARCH= to build another
architecture... Anything you can currently do with allnoconfig.)
It's the "shrinking a .config into a mini.conf" side of things that uses a
hideous shell script that's not in the tree:
http://landley.net/hg/firmware/raw-file/tip/sources/toys/miniconfig.sh
To use it:
make ARCH=arm defconfig
mv .config tempname
ARCH=arm ./miniconfig.sh tempname
ls -l mini.config
(Obviously, the ARCH=arm is optional and you don't have to start with
defconfig.)
If I had unlimited spare time I might teach kconfig to automatically write a
mini.conf every time it writes a .config, and have it use whichever was newer
in the update commands (oldconfig/menuconfig/etc). But after two rejected
patches on this topic already, with the shell script meeting my needs, that's
impressively far down on my todo list.
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-16 4:29 ` Sam Ravnborg
2007-10-16 5:14 ` Rob Landley
@ 2007-10-16 14:44 ` Jan Engelhardt
1 sibling, 0 replies; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-16 14:44 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Rob Landley, zippel, Linux Kernel Mailing List, randy.dunlap
Hi Sam,
On Oct 16 2007 06:29, Sam Ravnborg wrote:
>On Fri, Oct 12, 2007 at 11:44:08PM +0200, Jan Engelhardt wrote:
>>
>> Allow config variables in .config to override earlier ones in the same
>> file. In other words,
>>
>> # CONFIG_SECURITY is not defined
>> CONFIG_SECURITY=y
>>
>> will activate it. This makes it a bit easier to do
>>
>> (cat original-config myconfig myconfig2 ... >.config)
>>
>> and run menuconfig as expected.
>
>
>How far is this from the miniconfig functionality?
>Is it the same or can we achieve the miniconfig support
>by extending Jan's patch?
>
>See: http://lkml.org/lkml/2007/10/12/391
miniconfig actually does something completely different as far as I
understand: miniconfig creates a minimal config that does not contain
default choices for CONFIG_ files, while the patch that I was trying
to submit here allows to override entries in a .config by just
appending them to the file. I already have a miniconfig, so to speak,
and want to merge it with the previous .config so as to produce a
fullconfig. (Something like the exact opposite)
thanks,
Jan
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-13 16:36 ` Jan Engelhardt
@ 2007-10-18 13:29 ` Sam Ravnborg
2007-10-18 13:31 ` Jan Engelhardt
0 siblings, 1 reply; 17+ messages in thread
From: Sam Ravnborg @ 2007-10-18 13:29 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Randy Dunlap, Stefan Richter, zippel, Linux Kernel Mailing List
On Sat, Oct 13, 2007 at 06:36:29PM +0200, Jan Engelhardt wrote:
>
> On Oct 13 2007 09:25, Randy Dunlap wrote:
> > Jan Engelhardt wrote:
> >> On Oct 13 2007 16:01, Stefan Richter wrote:
> >> > > .config:176:warning: override: reassigning to symbol PREEMPT_VOLUNTARY
> >> > > .config:176:warning: override: PREEMPT_VOLUNTARY turns state choice
> >
> > .config:176:warning: override: PREEMPT_VOLUNTARY modifies state choice
> >
> > "turns" is just odd there.
>
> Yeah, I've put in
> ("override: %s changes choice state", sym->name);
> this morning.
Care to send me the updated patch.
Thanks,
Sam
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] Allow kconfig to accept overrides
2007-10-18 13:29 ` Sam Ravnborg
@ 2007-10-18 13:31 ` Jan Engelhardt
0 siblings, 0 replies; 17+ messages in thread
From: Jan Engelhardt @ 2007-10-18 13:31 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Randy Dunlap, Stefan Richter, zippel, Linux Kernel Mailing List
On Oct 18 2007 15:29, Sam Ravnborg wrote:
>> Yeah, I've put in
>> ("override: %s changes choice state", sym->name);
>> this morning.
>Care to send me the updated patch.
>
===
Allow config variables in .config to override earlier ones in the same
file. In other words,
# CONFIG_SECURITY is not defined
CONFIG_SECURITY=y
will activate it. This makes it a bit easier to do
(cat original-config myconfig myconfig2 ... >.config)
and run menuconfig as expected.
Posted at:
http://lkml.org/lkml/2006/10/25/81
http://lkml.org/lkml/2007/4/1/175
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
---
scripts/kconfig/confdata.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
Index: linux-2.6.23.1/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6.23.1.orig/scripts/kconfig/confdata.c
+++ linux-2.6.23.1/scripts/kconfig/confdata.c
@@ -170,8 +170,7 @@ load:
sym->type = S_BOOLEAN;
}
if (sym->flags & def_flags) {
- conf_warning("trying to reassign symbol %s", sym->name);
- break;
+ conf_warning("override: reassigning to symbol %s", sym->name);
}
switch (sym->type) {
case S_BOOLEAN:
@@ -210,8 +209,7 @@ load:
sym->type = S_OTHER;
}
if (sym->flags & def_flags) {
- conf_warning("trying to reassign symbol %s", sym->name);
- break;
+ conf_warning("override: reassigning to symbol %s", sym->name);
}
switch (sym->type) {
case S_TRISTATE:
@@ -288,11 +286,9 @@ load:
}
break;
case yes:
- if (cs->def[def].tri != no) {
- conf_warning("%s creates inconsistent choice state", sym->name);
- cs->flags &= ~def_flags;
- } else
- cs->def[def].val = sym;
+ if(cs->def[def].tri != no)
+ conf_warning("override: %s changes choice state", sym->name);
+ cs->def[def].val = sym;
break;
}
cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2007-10-18 13:32 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 21:44 [PATCH] Allow kconfig to accept overrides Jan Engelhardt
2007-10-12 21:49 ` Randy Dunlap
2007-10-12 22:10 ` Jan Engelhardt
2007-10-12 22:57 ` Randy Dunlap
2007-10-12 23:29 ` Jan Engelhardt
2007-10-12 23:32 ` Randy Dunlap
2007-10-13 8:16 ` Stefan Richter
2007-10-13 11:39 ` Jan Engelhardt
2007-10-13 14:01 ` Stefan Richter
2007-10-13 14:15 ` Jan Engelhardt
2007-10-13 16:25 ` Randy Dunlap
2007-10-13 16:36 ` Jan Engelhardt
2007-10-18 13:29 ` Sam Ravnborg
2007-10-18 13:31 ` Jan Engelhardt
2007-10-16 4:29 ` Sam Ravnborg
2007-10-16 5:14 ` Rob Landley
2007-10-16 14:44 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox