From: Christoph Hellwig <hch@lst.de>
To: zippel@linux-m68k.org
Cc: linux-kernel@vger.kernel.org
Subject: RH's noninteractive config patch
Date: Mon, 31 May 2004 11:20:44 +0200 [thread overview]
Message-ID: <20040531092044.GA14091@lst.de> (raw)
Hi Roman,
Arjan said you some objections against RH's current noninteractive
config patch? I'd really love to see something like it included
because it greatly helps packagaing the kernel. Patch from their
current RPM is below:
diff -urNp linux-1/scripts/kconfig/conf.c linux-500/scripts/kconfig/conf.c
--- linux-1/scripts/kconfig/conf.c
+++ linux-500/scripts/kconfig/conf.c
@@ -20,6 +20,7 @@ enum {
ask_all,
ask_new,
ask_silent,
+ dont_ask,
set_default,
set_yes,
set_mod,
@@ -36,6 +37,8 @@ static struct menu *rootEntry;
static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
+static int return_value = 0;
+
static void strip(char *str)
{
char *p = str;
@@ -93,6 +96,12 @@ static void conf_askvalue(struct symbol
fflush(stdout);
fgets(line, 128, stdin);
return;
+ case dont_ask:
+ if (!sym_has_value(sym)) {
+ fprintf(stderr,"CONFIG_%s\n",sym->name);
+ return_value++;
+ }
+ return;
case set_default:
printf("%s\n", def);
return;
@@ -339,6 +348,7 @@ static int conf_choice(struct menu *menu
switch (input_mode) {
case ask_new:
case ask_silent:
+ case dont_ask:
if (!is_new) {
cnt = def;
printf("%d\n", cnt);
@@ -472,7 +482,10 @@ static void check_conf(struct menu *menu
if (!conf_cnt++)
printf("*\n* Restart config...\n*\n");
rootEntry = menu_get_parent_menu(menu);
- conf(rootEntry);
+ if (input_mode == dont_ask)
+ fprintf(stderr,"CONFIG_%s\n",sym->name);
+ else
+ conf(rootEntry);
}
if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
return;
@@ -493,6 +506,9 @@ int main(int ac, char **av)
case 'o':
input_mode = ask_new;
break;
+ case 'b':
+ input_mode = dont_ask;
+ break;
case 's':
input_mode = ask_silent;
valid_stdin = isatty(0) && isatty(1) && isatty(2);
@@ -557,6 +573,7 @@ int main(int ac, char **av)
}
case ask_all:
case ask_new:
+ case dont_ask:
conf_read(NULL);
break;
default:
@@ -574,10 +591,10 @@ int main(int ac, char **av)
do {
conf_cnt = 0;
check_conf(&rootmenu);
- } while (conf_cnt);
+ } while ((conf_cnt) && (input_mode != dont_ask));
if (conf_write(NULL)) {
fprintf(stderr, "\n*** Error during writing of the kernel configuration.\n\n");
return 1;
}
- return 0;
+ return return_value;
}
--- linux-2.6.3/scripts/kconfig/Makefile.orig 2004-02-25 16:59:55.934625904 +0100
+++ linux-2.6.3/scripts/kconfig/Makefile 2004-02-25 17:02:37.076128672 +0100
@@ -23,6 +23,10 @@
silentoldconfig: $(obj)/conf
$< -s arch/$(ARCH)/Kconfig
+nonint_oldconfig: scripts/kconfig/conf
+ ./scripts/kconfig/conf -b arch/$(ARCH)/Kconfig
+
+
.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
randconfig: $(obj)/conf
@@ -68,7 +72,7 @@
libkconfig-objs := zconf.tab.o
host-progs := conf mconf qconf gconf
-conf-objs := conf.o libkconfig.so
+conf-objs := conf.o
mconf-objs := mconf.o libkconfig.so
ifeq ($(MAKECMDGOALS),xconfig)
@@ -95,13 +99,15 @@
HOSTCFLAGS_lex.zconf.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src)
+HOSTLOADLIBES_conf = -Wl,-rpath,\$$ORIGIN -Lscripts/kconfig -lkconfig
+
HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include
HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
-$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
+$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h $(obj)/libkconfig.so
$(obj)/qconf.o: $(obj)/.tmp_qtcheck
next reply other threads:[~2004-05-31 9:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-31 9:20 Christoph Hellwig [this message]
2004-06-01 18:14 ` Roman Zippel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040531092044.GA14091@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®