public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add ``cloneconfig'' target
@ 2011-02-25  2:35 Jeff Mahoney
  2011-02-25  6:07 ` Sam Ravnborg
  2011-02-26 19:50 ` Arnaud Lacombe
  0 siblings, 2 replies; 23+ messages in thread
From: Jeff Mahoney @ 2011-02-25  2:35 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Roman Zippel, linux-kbuild

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2011-02-27 18:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25  2:35 [PATCH] Add ``cloneconfig'' target Jeff Mahoney
2011-02-25  6:07 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox