lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  2 May 2008 22:49:16 +0200
From:	sam@...nborg.org
To:	linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org
Cc:	Sam Ravnborg <sam@...nus.ravnborg.org>,
	Sam Ravnborg <sam@...nborg.org>
Subject: [PATCH] kconfig: conf is less chatty

From: Sam Ravnborg <sam@...nus.ravnborg.org>

No one really used the output generated during a
oldconfig run. So drop it and behave like the
old 'silentoldconfig' always did.

Signed-off-by: Sam Ravnborg <sam@...nborg.org>
---
 Makefile                 |    2 +-
 scripts/kconfig/Makefile |    5 +----
 scripts/kconfig/conf.c   |   42 ++++++++++++++----------------------------
 3 files changed, 16 insertions(+), 33 deletions(-)

diff --git a/Makefile b/Makefile
index d3634cd..99fcf12 100644
--- a/Makefile
+++ b/Makefile
@@ -473,7 +473,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 # 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 oldconfig
 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
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 47d5df8..1ccd584 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -18,12 +18,9 @@ menuconfig: $(obj)/mconf
 config: $(obj)/conf
 	$< $(Kconfig)
 
-oldconfig: $(obj)/conf
+oldconfig silentoldconfig: $(obj)/conf
 	$< -o $(Kconfig)
 
-silentoldconfig: $(obj)/conf
-	$< -s $(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
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 7aabe0b..263165d 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -21,7 +21,6 @@ static void check_conf(struct menu *menu);
 enum {
 	ask_all,
 	ask_new,
-	ask_silent,
 } input_mode = ask_all;
 
 static int indent = 1;
@@ -59,12 +58,12 @@ static void strip(char *str)
 
 static void check_stdin(void)
 {
-	if (!valid_stdin && input_mode == ask_silent) {
-		printf(_("aborted!\n\n"));
-		printf(_("Console input/output is redirected. "));
-		printf(_("Run 'make oldconfig' to update configuration.\n\n"));
-		exit(1);
-	}
+	if (valid_stdin)
+		return;
+	fprintf(stderr, _("aborted!\n\n"));
+	fprintf(stderr, _("Console input/output is redirected. "));
+	fprintf(stderr, _("Run 'make oldconfig' to update configuration.\n\n"));
+	exit(1);
 }
 
 static int conf_askvalue(struct symbol *sym, const char *def)
@@ -84,20 +83,17 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 		return 0;
 	}
 
+	check_stdin();
 	switch (input_mode) {
 	case ask_new:
-	case ask_silent:
 		if (sym_has_value(sym)) {
 			printf("%s\n", def);
 			return 0;
 		}
-		check_stdin();
 	case ask_all:
 		fflush(stdout);
 		fgets(line, 128, stdin);
 		return 1;
-	default:
-		break;
 	}
 
 	switch (type) {
@@ -287,7 +283,6 @@ static int conf_choice(struct menu *menu)
 		printf("]: ");
 		switch (input_mode) {
 		case ask_new:
-		case ask_silent:
 			if (!is_new) {
 				cnt = def;
 				printf("%d\n", cnt);
@@ -350,7 +345,7 @@ static void conf(struct menu *menu)
 
 		switch (prop->type) {
 		case P_MENU:
-			if (input_mode == ask_silent && rootEntry != menu) {
+			if (input_mode != ask_all && rootEntry != menu) {
 				check_conf(menu);
 				return;
 			}
@@ -429,15 +424,13 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
-	while ((opt = getopt(ac, av, "osh")) != -1) {
+	valid_stdin = isatty(0) && isatty(1) && isatty(2);
+
+	while ((opt = getopt(ac, av, "oh")) != -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 'h':
 			printf(_("See README for usage info\n"));
 			exit(0);
@@ -455,7 +448,7 @@ int main(int ac, char **av)
 	conf_parse(name);
 	//zconfdump(stdout);
 	switch (input_mode) {
-	case ask_silent:
+	case ask_new:
 		if (stat(".config", &tmpstat)) {
 			printf(_("***\n"
 				"*** You have not yet configured your kernel!\n"
@@ -467,20 +460,13 @@ int main(int ac, char **av)
 			exit(1);
 		}
 	case ask_all:
-	case ask_new:
 		conf_read(NULL);
 		break;
-	default:
-		break;
 	}
 
-	if (input_mode != ask_silent) {
+	if (input_mode == ask_all) {
 		rootEntry = &rootmenu;
 		conf(&rootmenu);
-		if (input_mode == ask_all) {
-			input_mode = ask_silent;
-			valid_stdin = 1;
-		}
 	} else if (conf_get_changed()) {
 		name = getenv("KCONFIG_NOSILENTUPDATE");
 		if (name && *name) {
@@ -499,7 +485,7 @@ int main(int ac, char **av)
 		return 1;
 	}
 skip_check:
-	if (input_mode == ask_silent && conf_write_autoconf()) {
+	if (conf_write_autoconf()) {
 		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
 		return 1;
 	}
-- 
1.5.4.1.143.ge7e51

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ