]>
Commit | Line | Data |
---|---|---|
6a930a95 BS |
1 | From: Andreas Gruenbacher <agruen@suse.de> |
2 | Subject: Add ``cloneconfig'' target | |
3 | ||
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. | |
7 | ||
8 | Signed-off-by: Andreas Gruenbacher <agruen@suse.de> | |
9 | ||
10 | scripts/kconfig/Makefile | 16 ++++++++++++++++ | |
11 | 1 file changed, 16 insertions(+) | |
12 | ||
13 | --- a/scripts/kconfig/Makefile | |
14 | +++ b/scripts/kconfig/Makefile | |
15 | @@ -61,6 +61,22 @@ allnoconfig: $(obj)/conf | |
16 | allmodconfig: $(obj)/conf | |
17 | $< -m $(Kconfig) | |
18 | ||
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"; \ | |
28 | + false ;; \ | |
29 | + *.gz) gzip -cd $(CLONECONFIG) > .config.running ;; \ | |
30 | + *) cat $(CLONECONFIG) > .config.running ;; \ | |
31 | + esac && \ | |
32 | + echo -e "Cloning configuration file $(CLONECONFIG)\n" | |
33 | + $(Q)$< -D .config.running arch/$(SRCARCH)/Kconfig | |
34 | + | |
35 | defconfig: $(obj)/conf | |
36 | ifeq ($(KBUILD_DEFCONFIG),) | |
37 | $< -d $(Kconfig) |