* [RFC/POC] multiple CONFIG y/m/n
@ 2006-04-07 5:41 Randy.Dunlap
2006-04-07 15:04 ` OGAWA Hirofumi
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-07 5:41 UTC (permalink / raw)
To: lkml; +Cc: zippel
In doing lots of kernel build testing, I often want to enable all options
in a sub-menu and their sub-sub-menus. Sound is one of the worst^W longest
of these, so I chose a shorter (easier) one to practice on: parport.
For PARPORT, this isn't terribly needed; it's just being a guinea pig
for me. The point is to be able to enable all applicable options at
one time (one line or one click).
So if no (top-level of a CONFIG, like CONFIG_PARPORT) options are enabled,
you can step thru the entire menu and sub-menus, taking a few minutes
sometimes (see SOUND or USB), or the kconfig system could enable some
way to do this for us. For version 1, all that I have done is modify
driver/parport/Kconfig -- no code changes. I haven't even looked at the
source code to see if that would be the right thing to do. I'm just
taken liberties with the famous Kconfig "select" to make it work.
I can already see that I find this useful, but is there a good (better)
way to implement this in kconfig?
As it is here, PARPORT_ENABLE_ALL tracks PARPORT (y/m/n) when the former
is enabled/configured. The downside of this Kconfig usage is that almost
all lines of "depends" are duplicated as "select" (and that it uses "select").
It would be good if there was some way to automate this.
Comments?
---
~Randy
---
drivers/parport/Kconfig | 17 +++++++++++++++++
1 files changed, 17 insertions(+)
--- linux-2617-rc1.orig/drivers/parport/Kconfig
+++ linux-2617-rc1/drivers/parport/Kconfig
@@ -151,5 +151,22 @@ config PARPORT_1284
transfer modes. Also say Y if you want device ID information to
appear in /proc/sys/dev/parport/*/autoprobe*. It is safe to say N.
+config PARPORT_ENABLE_ALL
+ tristate "Enable all (non-BROKEN) PARPORT options"
+ depends on PARPORT
+ select PARPORT_PC if (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV
+ select PARPORT_SERIAL if SERIAL_8250 && PARPORT_PC && PCI
+ select PARPORT_PC_FIFO if PARPORT_PC && EXPERIMENTAL
+ select PARPORT_PC_SUPERIO if PARPORT_PC && EXPERIMENTAL
+ select PARPORT_PC_PCMCIA if PCMCIA && PARPORT_PC
+ select PARPORT_ARC if ARM && PARPORT
+ select PARPORT_IP32 if SGI_IP32 && PARPORT && EXPERIMENTAL
+ select PARPORT_AMIGA if AMIGA && PARPORT
+ select PARPORT_MFC3 if ZORRO && PARPORT
+ select PARPORT_ATARI if ATARI && PARPORT
+ select PARPORT_GSC if PARPORT && GSC
+ select PARPORT_SUNBPP if SBUS && PARPORT && EXPERIMENTAL
+ select PARPORT_1284 if PARPORT
+
endmenu
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 5:41 [RFC/POC] multiple CONFIG y/m/n Randy.Dunlap
@ 2006-04-07 15:04 ` OGAWA Hirofumi
2006-04-07 15:45 ` Randy.Dunlap
2006-04-10 5:04 ` Randy.Dunlap
2006-04-07 18:44 ` [RFC/POC] multiple CONFIG y/m/n Sam Ravnborg
2006-04-11 11:05 ` Jan Engelhardt
2 siblings, 2 replies; 13+ messages in thread
From: OGAWA Hirofumi @ 2006-04-07 15:04 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: lkml, zippel
"Randy.Dunlap" <rdunlap@xenotime.net> writes:
> As it is here, PARPORT_ENABLE_ALL tracks PARPORT (y/m/n) when the former
> is enabled/configured. The downside of this Kconfig usage is that almost
> all lines of "depends" are duplicated as "select" (and that it uses "select").
> It would be good if there was some way to automate this.
>
> Comments?
Umm... Oh, how about the following? It seems work...
$ perl -spi -e 's/CONFIG_SND.*//' .config
$ KCONFIG_ALLCONFIG=.config make allmodconfig or allyesconfig
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 15:04 ` OGAWA Hirofumi
@ 2006-04-07 15:45 ` Randy.Dunlap
2006-04-10 5:04 ` Randy.Dunlap
1 sibling, 0 replies; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-07 15:45 UTC (permalink / raw)
To: OGAWA Hirofumi; +Cc: linux-kernel, zippel
On Sat, 08 Apr 2006 00:04:26 +0900 OGAWA Hirofumi wrote:
> "Randy.Dunlap" <rdunlap@xenotime.net> writes:
>
> > As it is here, PARPORT_ENABLE_ALL tracks PARPORT (y/m/n) when the former
> > is enabled/configured. The downside of this Kconfig usage is that almost
> > all lines of "depends" are duplicated as "select" (and that it uses "select").
> > It would be good if there was some way to automate this.
> >
> > Comments?
>
> Umm... Oh, how about the following? It seems work...
>
> $ perl -spi -e 's/CONFIG_SND.*//' .config
> $ KCONFIG_ALLCONFIG=.config make allmodconfig or allyesconfig
Yes, that seems to do what I want to do.
Very nice, thanks.
---
~Randy
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 15:04 ` OGAWA Hirofumi
2006-04-07 15:45 ` Randy.Dunlap
@ 2006-04-10 5:04 ` Randy.Dunlap
2006-04-12 11:00 ` Roman Zippel
1 sibling, 1 reply; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-10 5:04 UTC (permalink / raw)
To: OGAWA Hirofumi; +Cc: linux-kernel, zippel, sam
On Sat, 08 Apr 2006 00:04:26 +0900 OGAWA Hirofumi wrote:
> "Randy.Dunlap" <rdunlap@xenotime.net> writes:
>
> > Comments?
>
> Umm... Oh, how about the following? It seems work...
>
> $ perl -spi -e 's/CONFIG_SND.*//' .config
> $ KCONFIG_ALLCONFIG=.config make allmodconfig or allyesconfig
Hrm, that points out a lack of documentation for this feature.
Would the kconfig/kbuild people prefer this documentation in the source
code (see below) or in Documentation/kbuild/somefile ?
---
---
scripts/kconfig/conf.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
--- linux-2617-rc1.orig/scripts/kconfig/conf.c
+++ linux-2617-rc1/scripts/kconfig/conf.c
@@ -504,6 +504,24 @@ static void check_conf(struct menu *menu
check_conf(child);
}
+void usage(char *progname)
+{
+ printf("%s [-o|-s|-d|-D|-n|-m|-y|-r] Kconfig_filename\n", progname);
+ printf(" -o: oldconfig: ask only about new config symbols\n");
+ printf(" -s: silentoldconfig: don't ask about any symbol values\n");
+ printf(" -d: defconfig: use default symbol values\n");
+ printf(" -D: use default symbol values from the specified config file\n");
+ printf(" -n: set unknown symbol values to 'n'\n");
+ printf(" -m: set unknown symbol values to 'm'\n");
+ printf(" -y: set unknown symbol values to 'y'\n");
+ printf(" -r: set unknown symbol values randomly to one of y/m/n\n");
+ printf("The n/m/y/r options can also use the environment variable KCONFIG_ALLCONFIG\n");
+ printf(" to specify a filename that contains config options that are\n");
+ printf(" to be set to a specific value. Otherwise config checks for\n");
+ printf(" all{no,mod,yes,random}.config and all.config\n");
+ exit(0);
+}
+
int main(int ac, char **av)
{
int i = 1;
@@ -546,8 +564,8 @@ int main(int ac, char **av)
break;
case 'h':
case '?':
- printf("%s [-o|-s] config\n", av[0]);
- exit(0);
+ usage(av[0]);
+ break;
}
}
name = av[i];
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-10 5:04 ` Randy.Dunlap
@ 2006-04-12 11:00 ` Roman Zippel
2006-04-12 16:17 ` Randy.Dunlap
0 siblings, 1 reply; 13+ messages in thread
From: Roman Zippel @ 2006-04-12 11:00 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: OGAWA Hirofumi, linux-kernel, sam
Hi,
On Sun, 9 Apr 2006, Randy.Dunlap wrote:
> +void usage(char *progname)
> +{
> + printf("%s [-o|-s|-d|-D|-n|-m|-y|-r] Kconfig_filename\n", progname);
|-D <config>|
> + printf(" -o: oldconfig: ask only about new config symbols\n");
> + printf(" -s: silentoldconfig: don't ask about any symbol values\n");
It does ask about them, but suppresses a lot of prints.
> + printf(" -d: defconfig: use default symbol values\n");
To be precise it uses arch/$ARCH/defconfig as default values.
> + printf(" -n: set unknown symbol values to 'n'\n");
> + printf(" -m: set unknown symbol values to 'm'\n");
> + printf(" -y: set unknown symbol values to 'y'\n");
It actually tries to set all values to n/m/y.
> @@ -546,8 +564,8 @@ int main(int ac, char **av)
> break;
> case 'h':
> case '?':
> - printf("%s [-o|-s] config\n", av[0]);
> - exit(0);
> + usage(av[0]);
> + break;
That's indeed a little obsolete. :-)
bye, Roman
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-12 11:00 ` Roman Zippel
@ 2006-04-12 16:17 ` Randy.Dunlap
2006-04-12 16:59 ` Sam Ravnborg
0 siblings, 1 reply; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-12 16:17 UTC (permalink / raw)
To: Roman Zippel; +Cc: hirofumi, linux-kernel, sam
On Wed, 12 Apr 2006 13:00:22 +0200 (CEST) Roman Zippel wrote:
> Hi,
>
> On Sun, 9 Apr 2006, Randy.Dunlap wrote:
>
> > +void usage(char *progname)
> > +{
> > + printf("%s [-o|-s|-d|-D|-n|-m|-y|-r] Kconfig_filename\n", progname);
>
> |-D <config>|
>
> > + printf(" -o: oldconfig: ask only about new config symbols\n");
> > + printf(" -s: silentoldconfig: don't ask about any symbol values\n");
>
> It does ask about them, but suppresses a lot of prints.
>
> > + printf(" -d: defconfig: use default symbol values\n");
>
> To be precise it uses arch/$ARCH/defconfig as default values.
>
> > + printf(" -n: set unknown symbol values to 'n'\n");
> > + printf(" -m: set unknown symbol values to 'm'\n");
> > + printf(" -y: set unknown symbol values to 'y'\n");
>
> It actually tries to set all values to n/m/y.
>
> > @@ -546,8 +564,8 @@ int main(int ac, char **av)
> > break;
> > case 'h':
> > case '?':
> > - printf("%s [-o|-s] config\n", av[0]);
> > - exit(0);
> > + usage(av[0]);
> > + break;
>
> That's indeed a little obsolete. :-)
IMO the main points/questions are:
- where to document the command-line options and environment variables
(including the recent KCONFIG_CONFIG): in a usage() function or in
Documentation/kbuild/usage.txt file?
- if the answer above is in a usage() function, how does a user invoke
that help request? Doing "make config -h" doesn't work: 'make' sees
the -h and spits out its own help text. Would a special case of
'make config help' be acceptable or is this a good reason to use
a usage.txt file instead?
- or have you already taken care of all of this? 8;)
Thanks.
---
~Randy
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-12 16:17 ` Randy.Dunlap
@ 2006-04-12 16:59 ` Sam Ravnborg
2006-04-12 18:56 ` [PATCH] config: update usage/help info Randy.Dunlap
0 siblings, 1 reply; 13+ messages in thread
From: Sam Ravnborg @ 2006-04-12 16:59 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: Roman Zippel, hirofumi, linux-kernel
> IMO the main points/questions are:
>
> - where to document the command-line options and environment variables
> (including the recent KCONFIG_CONFIG): in a usage() function or in
> Documentation/kbuild/usage.txt file?
The latter...
make help was the other alternative and it is too big already.
For kbuild I also need to add some stuff.
Sam
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] config: update usage/help info
2006-04-12 16:59 ` Sam Ravnborg
@ 2006-04-12 18:56 ` Randy.Dunlap
2006-04-12 20:44 ` Sam Ravnborg
0 siblings, 1 reply; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-12 18:56 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: zippel, hirofumi, linux-kernel, akpm
On Wed, 12 Apr 2006 18:59:29 +0200 Sam Ravnborg wrote:
> > IMO the main points/questions are:
> >
> > - where to document the command-line options and environment variables
> > (including the recent KCONFIG_CONFIG): in a usage() function or in
> > Documentation/kbuild/usage.txt file?
>
> The latter...
> make help was the other alternative and it is too big already.
>
> For kbuild I also need to add some stuff.
Here's a shot at it, although it seemed that top-level README was
sufficient for the make *config additions. We can move whatever you
think should be moved to a new file.
(This is missing a recent KCONFIG_OVERWRITECONFIG environment variable
that I think Roman just added.)
---
From: Randy Dunlap <rdunlap@xenotime.net>
Replace outdated help message with a reference to README.
Update README for make *config variants and environment
variable info.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
README | 23 ++++++++++++++++++++++-
scripts/kconfig/conf.c | 3 ++-
2 files changed, 24 insertions(+), 2 deletions(-)
--- linux-2617-rc1.orig/scripts/kconfig/conf.c
+++ linux-2617-rc1/scripts/kconfig/conf.c
@@ -5,6 +5,7 @@
#include <ctype.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
@@ -546,7 +547,7 @@ int main(int ac, char **av)
break;
case 'h':
case '?':
- printf("%s [-o|-s] config\n", av[0]);
+ fprintf(stderr, "See README for usage info\n");
exit(0);
}
}
--- linux-2617-rc1.orig/README
+++ linux-2617-rc1/README
@@ -165,10 +165,31 @@ CONFIGURING the kernel:
"make xconfig" X windows (Qt) based configuration tool.
"make gconfig" X windows (Gtk) based configuration tool.
"make oldconfig" Default all questions based on the contents of
- your existing ./.config file.
+ your existing ./.config file and asking about
+ new config symbols.
"make silentoldconfig"
Like above, but avoids cluttering the screen
with questions already answered.
+ "make defconfig" Create a ./.config file by using the default
+ symbol values from arch/$ARCH/defconfig.
+ "make allyesconfig"
+ Create a ./.config file by setting symbol
+ values to 'y' as much as possible.
+ "make allmodconfig"
+ Create a ./.config file by setting symbol
+ values to 'm' as much as possible.
+ "make allnoconfig" Create a ./.config file by setting symbol
+ values to 'n' as much as possible.
+ "make randconfig" Create a ./.config file by setting symbol
+ values to random values.
+
+ The allyesconfig/allmodconfig/allnoconfig/randconfig variants can
+ also use the environment variable KCONFIG_ALLCONFIG to specify a
+ filename that contains config options that the user requires to be
+ set to a specific value. If KCONFIG_ALLCONFIG=filename is not used,
+ "make *config" checks for a file named "all{yes/mod/no/random}.config"
+ for symbol values that are to be forced. If this file is not found,
+ it checks for a file named "all.config" to contain forced values.
NOTES on "make config":
- having unnecessary drivers will make the kernel bigger, and can
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 5:41 [RFC/POC] multiple CONFIG y/m/n Randy.Dunlap
2006-04-07 15:04 ` OGAWA Hirofumi
@ 2006-04-07 18:44 ` Sam Ravnborg
2006-04-07 21:24 ` Roman Zippel
2006-04-11 11:05 ` Jan Engelhardt
2 siblings, 1 reply; 13+ messages in thread
From: Sam Ravnborg @ 2006-04-07 18:44 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: lkml, zippel
On Thu, Apr 06, 2006 at 10:41:34PM -0700, Randy.Dunlap wrote:
>
> In doing lots of kernel build testing, I often want to enable all options
> in a sub-menu and their sub-sub-menus. Sound is one of the worst^W longest
> of these, so I chose a shorter (easier) one to practice on: parport.
If there is a general need for this we shal enhance kconfig with this.
We shall not clutter the Kconfig files with this.
On the other hand the perl solutions posted seems also to do the trick
so lets see if that does the trick for now.
Sam
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 18:44 ` [RFC/POC] multiple CONFIG y/m/n Sam Ravnborg
@ 2006-04-07 21:24 ` Roman Zippel
2006-04-07 21:36 ` Randy.Dunlap
0 siblings, 1 reply; 13+ messages in thread
From: Roman Zippel @ 2006-04-07 21:24 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Randy.Dunlap, lkml
Hi,
On Fri, 7 Apr 2006, Sam Ravnborg wrote:
> > In doing lots of kernel build testing, I often want to enable all options
> > in a sub-menu and their sub-sub-menus. Sound is one of the worst^W longest
> > of these, so I chose a shorter (easier) one to practice on: parport.
> If there is a general need for this we shal enhance kconfig with this.
> We shall not clutter the Kconfig files with this.
I agree.
>From a general perspective I still like to add some basic command line
tool, which can be used for queries or simple manipulations. Here it also
would be less a problem to add experimental or distribution specific
functionality instead of overloading conf.c.
At some point I even had script bindings (via swig), so one could do even
weirder stuff.
bye, Roman
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 21:24 ` Roman Zippel
@ 2006-04-07 21:36 ` Randy.Dunlap
0 siblings, 0 replies; 13+ messages in thread
From: Randy.Dunlap @ 2006-04-07 21:36 UTC (permalink / raw)
To: Roman Zippel; +Cc: sam, linux-kernel
On Fri, 7 Apr 2006 23:24:44 +0200 (CEST) Roman Zippel wrote:
> Hi,
>
> On Fri, 7 Apr 2006, Sam Ravnborg wrote:
>
> > > In doing lots of kernel build testing, I often want to enable all options
> > > in a sub-menu and their sub-sub-menus. Sound is one of the worst^W longest
> > > of these, so I chose a shorter (easier) one to practice on: parport.
> > If there is a general need for this we shal enhance kconfig with this.
> > We shall not clutter the Kconfig files with this.
>
> I agree.
> >From a general perspective I still like to add some basic command line
> tool, which can be used for queries or simple manipulations. Here it also
> would be less a problem to add experimental or distribution specific
> functionality instead of overloading conf.c.
> At some point I even had script bindings (via swig), so one could do even
> weirder stuff.
Yep, no problem with Sam's or your reply. Thanks for looking.
---
~Randy
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFC/POC] multiple CONFIG y/m/n
2006-04-07 5:41 [RFC/POC] multiple CONFIG y/m/n Randy.Dunlap
2006-04-07 15:04 ` OGAWA Hirofumi
2006-04-07 18:44 ` [RFC/POC] multiple CONFIG y/m/n Sam Ravnborg
@ 2006-04-11 11:05 ` Jan Engelhardt
2 siblings, 0 replies; 13+ messages in thread
From: Jan Engelhardt @ 2006-04-11 11:05 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: lkml, zippel
>
>In doing lots of kernel build testing, I often want to enable all options
>in a sub-menu and their sub-sub-menus. Sound is one of the worst^W longest
>of these, so I chose a shorter (easier) one to practice on: parport.
>[..]
>I can already see that I find this useful, but is there a good (better)
>way to implement this in kconfig?
>[..]
>Comments?
I would like this one, for menuconfig (ncurses):
'y', 'm' and 'n' have their usual behavior
'Y', 'M' and 'N' affect the current item plus any subparts (if any)
That is, press *Shift*-Y/M/N for the "deep change".
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-04-12 20:44 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-07 5:41 [RFC/POC] multiple CONFIG y/m/n Randy.Dunlap
2006-04-07 15:04 ` OGAWA Hirofumi
2006-04-07 15:45 ` Randy.Dunlap
2006-04-10 5:04 ` Randy.Dunlap
2006-04-12 11:00 ` Roman Zippel
2006-04-12 16:17 ` Randy.Dunlap
2006-04-12 16:59 ` Sam Ravnborg
2006-04-12 18:56 ` [PATCH] config: update usage/help info Randy.Dunlap
2006-04-12 20:44 ` Sam Ravnborg
2006-04-07 18:44 ` [RFC/POC] multiple CONFIG y/m/n Sam Ravnborg
2006-04-07 21:24 ` Roman Zippel
2006-04-07 21:36 ` Randy.Dunlap
2006-04-11 11:05 ` Jan Engelhardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.