public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Roman Zippel <zippel@linux-m68k.org>, linux-kbuild@vger.kernel.org
Subject: [PATCH] Add ``cloneconfig'' target
Date: Thu, 24 Feb 2011 21:35:02 -0500	[thread overview]
Message-ID: <4D671556.80607@suse.com> (raw)

Cloneconfig takes the first configuration it finds which appears
to belong to the running kernel, and configures the kernel sources
to match this configuration as closely as possible.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 scripts/kconfig/Makefile |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -99,6 +99,23 @@ PHONY += allnoconfig allyesconfig allmod
 
 allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
 	$< --$@ $(Kconfig)
+ 
+UNAME_RELEASE := $(shell uname -r)
+CLONECONFIG := $(firstword $(wildcard /proc/config.gz \
+				      /lib/modules/$(UNAME_RELEASE)/.config \
+				      /etc/kernel-config \
+				      /boot/config-$(UNAME_RELEASE)))
+cloneconfig: $(obj)/conf
+	$(Q)case "$(CLONECONFIG)" in				\
+	'')	echo -e "The configuration of the running"	\
+			"kernel could not be determined\n";	\
+		false ;;					\
+	*.gz)	gzip -cd $(CLONECONFIG) > .config.running ;;	\
+	*)	cat $(CLONECONFIG) > .config.running ;;		\
+	esac &&							\
+	echo -e "Cloning configuration file $(CLONECONFIG)\n"
+	$(Q)$< -D .config.running arch/$(SRCARCH)/Kconfig
+
 
 PHONY += listnewconfig oldnoconfig savedefconfig defconfig
 
-- 
Jeff Mahoney
SUSE Labs

             reply	other threads:[~2011-02-25  2:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25  2:35 Jeff Mahoney [this message]
2011-02-25  6:07 ` [PATCH] Add ``cloneconfig'' target Sam Ravnborg
2011-02-26  0:44   ` [PATCH 1/2] kconfig: add support for type handlers Jeff Mahoney
2011-02-26  1:28     ` Arnaud Lacombe
2011-02-26 17:27       ` Jeff Mahoney
2011-02-26  0:44   ` [PATCH 2/2] kconfig: Use /proc/config.gz as a configuration source Jeff Mahoney
2011-02-26 19:47   ` [PATCH] Add ``cloneconfig'' target Arnaud Lacombe
2011-02-26 22:18     ` Sam Ravnborg
2011-02-26 23:03       ` Arnaud Lacombe
2011-02-26 23:28         ` Arnaud Lacombe
2011-02-27 18:44           ` Sam Ravnborg
2011-02-27  9:03       ` Geert Uytterhoeven
2011-02-27 17:13         ` Arnaud Lacombe
2011-02-27 17:54         ` Jeff Mahoney
2011-02-26 22:47     ` Miguel Ojeda
2011-02-26 22:57       ` Arnaud Lacombe
2011-02-26 23:16         ` Miguel Ojeda
2011-02-26 23:26           ` Arnaud Lacombe
2011-02-26 23:38             ` Jeff Mahoney
2011-02-26 23:50               ` Arnaud Lacombe
2011-02-26 23:34         ` Jeff Mahoney
2011-02-26 23:53           ` Arnaud Lacombe
2011-02-26 19:50 ` Arnaud Lacombe

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=4D671556.80607@suse.com \
    --to=jeffm@suse.com \
    --cc=linux-kbuild@vger.kernel.org \
    --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