public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andres Salomon <dilinger@queued.net>
To: sam@ravnborg.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: [PATCH 4/4] kconfig: add *_silentdefconfig feature for config targets
Date: Fri, 25 Apr 2008 22:35:30 -0400	[thread overview]
Message-ID: <20080425223530.10b9d50d@ephemeral> (raw)


Being able to run 'silentoldconfig' with an existing .config has been
immensely useful, especially for automated builds.  If the kernel code
changes in an incompatible manner without the associated .config being
updated, the build will fail and call attention to the need for an update.

AFAICT, there is nothing similar when using *_defconfig; one must copy
a .config manually, and then run silentoldconfig.  Simply running the
associated _defconfig will quietly update the config (which may silently
drop config options).  This patch adds a *_silentdefconfig target, with
semantics similar to silentoldconfig.  It will take the defconfig from
arch/$(SRCARCH)/configs/$x_defconfig, check for changes, and if there are
none, write out a .config.  If there have been changes and stdin is
valid, it will prompt for updates.  If there have been changes and
stdin is not valid, it will bail out with an error.

Signed-off-by: Andres Salomon <dilinger@debian.org>
---
 Makefile                 |    4 ++++
 scripts/kconfig/Makefile |    3 +++
 scripts/kconfig/conf.c   |   13 +++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index e77149e..c264f7f 100644
--- a/Makefile
+++ b/Makefile
@@ -1225,6 +1225,10 @@ help:
 		$(foreach b, $(boards), \
 		printf "  %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
 		echo '')
+	@$(if $(boards), \
+		$(foreach b, $(boards), \
+		printf "  %-24s - Quiet Build for %s\\n" $(subst _defconfig,_silentdefconfig,$(b)) $(subst _defconfig,,$(b));) \
+		echo '')
 
 	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
 	@echo  '  make V=2   [targets] 2 => give reason for rebuild of target'
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index ce7d754..19ba562 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -72,6 +72,9 @@ endif
 %_defconfig: $(obj)/conf
 	$(Q)$< -d -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
+%_silentdefconfig: $(obj)/conf
+	$(Q)$< -s -o -D arch/$(SRCARCH)/configs/$(subst _silentdefconfig,_defconfig,$@) $(Kconfig)
+
 # Help text used by make help
 help:
 	@echo  '  config	  - Update current config utilising a line-oriented program'
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9a27638..264eee9 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -558,7 +558,8 @@ int main(int ac, char **av)
 		}
 		break;
 	case ask_new:
-		if (silent_mode && stat(".config", &tmpstat)) {
+		if (!defconfig_file && silent_mode &&
+				stat(".config", &tmpstat)) {
 			printf(_("***\n"
 				"*** You have not yet configured your kernel!\n"
 				"*** (missing kernel .config file)\n"
@@ -570,7 +571,15 @@ int main(int ac, char **av)
 		}
 		/* fall through */
 	case ask_all:
-		conf_read(NULL);
+		if (defconfig_file) {
+			if (conf_read(defconfig_file)) {
+				printf(_("***\n*** Can't find default "
+					 "configuration \"%s\"!\n***\n"),
+					 defconfig_file);
+				exit(1);
+			}
+		} else
+			conf_read(NULL);
 		break;
 	case set_no:
 	case set_mod:
-- 
1.5.5


             reply	other threads:[~2008-04-26  2:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-26  2:35 Andres Salomon [this message]
2008-04-27 20:47 ` [PATCH 4/4] kconfig: add *_silentdefconfig feature for config targets Sam Ravnborg
2008-04-28  1:43   ` Andres Salomon
2008-04-28 21:34     ` Sam Ravnborg
2008-04-28 21:48       ` Andres Salomon

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=20080425223530.10b9d50d@ephemeral \
    --to=dilinger@queued.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.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