1 From: Andreas Gruenbacher <agruen@suse.de>
2 Subject: Add ``cloneconfig'' target
4 Cloneconfig takes the first configuration it finds which appears
5 to belong to the running kernel, and configures the kernel sources
6 to match this configuration as closely as possible.
8 Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
10 scripts/kconfig/Makefile | 16 ++++++++++++++++
11 1 file changed, 16 insertions(+)
13 --- a/scripts/kconfig/Makefile
14 +++ b/scripts/kconfig/Makefile
15 @@ -61,6 +61,22 @@ allnoconfig: $(obj)/conf
16 allmodconfig: $(obj)/conf
19 +UNAME_RELEASE := $(shell uname -r)
20 +CLONECONFIG := $(firstword $(wildcard /proc/config.gz \
21 + /lib/modules/$(UNAME_RELEASE)/.config \
22 + /etc/kernel-config \
23 + /boot/config-$(UNAME_RELEASE)))
24 +cloneconfig: $(obj)/conf
25 + $(Q)case "$(CLONECONFIG)" in \
26 + '') echo -e "The configuration of the running" \
27 + "kernel could not be determined\n"; \
29 + *.gz) gzip -cd $(CLONECONFIG) > .config.running ;; \
30 + *) cat $(CLONECONFIG) > .config.running ;; \
32 + echo -e "Cloning configuration file $(CLONECONFIG)\n"
33 + $(Q)$< -D .config.running arch/$(SRCARCH)/Kconfig
35 defconfig: $(obj)/conf
36 ifeq ($(KBUILD_DEFCONFIG),)