* [PATCH] Add 'make no2modconfig' config generation target
@ 2008-05-31 7:05 Clifford Wolf
2008-05-31 8:30 ` Sam Ravnborg
0 siblings, 1 reply; 4+ messages in thread
From: Clifford Wolf @ 2008-05-31 7:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Clifford Wolf
The new 'make no2modconfig' make target creates a new kernel
config based on the current one, switching all tristate options
from 'n' to 'm'.
Signed-off-by: Clifford Wolf <clifford@clifford.at>
---
scripts/kconfig/Makefile | 6 +++++-
scripts/kconfig/conf.c | 17 ++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fa1a7d5..66570bf 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -47,7 +47,7 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
$(Q)rm -f arch/um/Kconfig.arch
$(Q)rm -f $(obj)/config.pot
-PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
+PHONY += randconfig allyesconfig allnoconfig allmodconfig no2modconfig defconfig
randconfig: $(obj)/conf
$< -r $(Kconfig)
@@ -61,6 +61,9 @@ allnoconfig: $(obj)/conf
allmodconfig: $(obj)/conf
$< -m $(Kconfig)
+no2modconfig: scripts/kconfig/conf
+ $< -M $(Kconfig)
+
defconfig: $(obj)/conf
ifeq ($(KBUILD_DEFCONFIG),)
$< -d $(Kconfig)
@@ -83,6 +86,7 @@ help:
@echo ' randconfig - New config with random answer to all options'
@echo ' defconfig - New config with default answer to all options'
@echo ' allmodconfig - New config selecting modules when possible'
+ @echo ' no2modconfig - New config selecting modules for disabled options'
@echo ' allyesconfig - New config where all options are accepted with yes'
@echo ' allnoconfig - New config where all options are answered with no'
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fda6313..d5770bd 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -22,6 +22,7 @@ enum {
ask_all,
ask_new,
ask_silent,
+ ask_no2mod,
set_default,
set_yes,
set_mod,
@@ -101,6 +102,15 @@ static int conf_askvalue(struct symbol *sym, const char *def)
return 0;
}
break;
+ case ask_no2mod:
+ if (type == S_TRISTATE &&
+ sym_get_tristate_value(sym) == no) {
+ fprintf(stderr, "Setting %s to 'm'.\n", sym->name);
+ line[0] = 'm';
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ }
case ask_new:
case ask_silent:
if (sym_has_value(sym)) {
@@ -359,6 +369,7 @@ static int conf_choice(struct menu *menu)
break;
}
check_stdin();
+ case ask_no2mod:
case ask_all:
fflush(stdout);
fgets(line, 128, stdin);
@@ -504,7 +515,7 @@ 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:nmMyrh")) != -1) {
switch (opt) {
case 'o':
input_mode = ask_new;
@@ -526,6 +537,9 @@ int main(int ac, char **av)
case 'm':
input_mode = set_mod;
break;
+ case 'M':
+ input_mode = ask_no2mod;
+ break;
case 'y':
input_mode = set_yes;
break;
@@ -573,6 +587,7 @@ int main(int ac, char **av)
}
case ask_all:
case ask_new:
+ case ask_no2mod:
conf_read(NULL);
break;
case set_no:
--
1.5.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add 'make no2modconfig' config generation target
2008-05-31 7:05 [PATCH] Add 'make no2modconfig' config generation target Clifford Wolf
@ 2008-05-31 8:30 ` Sam Ravnborg
2008-06-01 16:34 ` Clifford Wolf
0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2008-05-31 8:30 UTC (permalink / raw)
To: Clifford Wolf; +Cc: linux-kernel
On Sat, May 31, 2008 at 09:05:07AM +0200, Clifford Wolf wrote:
> The new 'make no2modconfig' make target creates a new kernel
> config based on the current one, switching all tristate options
> from 'n' to 'm'.
Hi Clifford.
In what situations do we need this functionality?
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add 'make no2modconfig' config generation target
2008-05-31 8:30 ` Sam Ravnborg
@ 2008-06-01 16:34 ` Clifford Wolf
2008-06-01 17:42 ` Sam Ravnborg
0 siblings, 1 reply; 4+ messages in thread
From: Clifford Wolf @ 2008-06-01 16:34 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel
Hi,
On Sat, May 31, 2008 at 10:30:34AM +0200, Sam Ravnborg wrote:
> On Sat, May 31, 2008 at 09:05:07AM +0200, Clifford Wolf wrote:
> > The new 'make no2modconfig' make target creates a new kernel
> > config based on the current one, switching all tristate options
> > from 'n' to 'm'.
>
> In what situations do we need this functionality?
I'm using this patch (respectively its predecessors) since many years in
ROCK Linux to auto-generate our general purpose kernel configurations, by
copying the default kernel config, forcing some variables to yes or no and
then setting all tristate options which are on 'n' to 'm' using this patch.
the only alternative would be to manually check the kernel configurtion for
each new kernel and setting all new tristate options to 'm' by hand. what a
waste of energy that would have been for the last couple of years.. ;-)
yours,
- clifford
--
For extra security, this message has been encrypted with double-ROT13.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add 'make no2modconfig' config generation target
2008-06-01 16:34 ` Clifford Wolf
@ 2008-06-01 17:42 ` Sam Ravnborg
0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2008-06-01 17:42 UTC (permalink / raw)
To: Clifford Wolf; +Cc: linux-kernel
On Sun, Jun 01, 2008 at 06:34:39PM +0200, Clifford Wolf wrote:
> Hi,
>
> On Sat, May 31, 2008 at 10:30:34AM +0200, Sam Ravnborg wrote:
> > On Sat, May 31, 2008 at 09:05:07AM +0200, Clifford Wolf wrote:
> > > The new 'make no2modconfig' make target creates a new kernel
> > > config based on the current one, switching all tristate options
> > > from 'n' to 'm'.
> >
> > In what situations do we need this functionality?
>
> I'm using this patch (respectively its predecessors) since many years in
> ROCK Linux to auto-generate our general purpose kernel configurations, by
> copying the default kernel config, forcing some variables to yes or no and
> then setting all tristate options which are on 'n' to 'm' using this patch.
>
> the only alternative would be to manually check the kernel configurtion for
> each new kernel and setting all new tristate options to 'm' by hand. what a
> waste of energy that would have been for the last couple of years.. ;-)
I have a set of patched in works that will allow this in
a more general way.
It allows you to specify a base config when you do allmodconfig.
Syntax is:
make K=rock-config allmodconfig
This will result in exactly what you want.
I will try to find time during next week to polish them and submit them
for 2nd review.
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-01 17:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-31 7:05 [PATCH] Add 'make no2modconfig' config generation target Clifford Wolf
2008-05-31 8:30 ` Sam Ravnborg
2008-06-01 16:34 ` Clifford Wolf
2008-06-01 17:42 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®