Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261411AbVARTiO (ORCPT ); Tue, 18 Jan 2005 14:38:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261405AbVARTgI (ORCPT ); Tue, 18 Jan 2005 14:36:08 -0500 Received: from mail-ex.suse.de ([195.135.220.2]:62858 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S261408AbVARTff (ORCPT ); Tue, 18 Jan 2005 14:35:35 -0500 Message-Id: <20050118192608.500213000.suse.de> References: <20050118184123.729034000.suse.de> Date: Tue, 18 Jan 2005 19:41:23 +0100 From: Andreas Gruenbacher To: linux-kernel@vger.kernel.org, Sam Ravnborg Cc: Rusty Russell Subject: [kbuild 3/5] Add cloneconfig target Content-Disposition: inline; filename=cloneconfig.diff Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1590 Lines: 43 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 Index: linux-2.6.11-rc1-bk6/scripts/kconfig/Makefile =================================================================== --- linux-2.6.11-rc1-bk6.orig/scripts/kconfig/Makefile +++ linux-2.6.11-rc1-bk6/scripts/kconfig/Makefile @@ -37,6 +37,22 @@ allnoconfig: $(obj)/conf allmodconfig: $(obj)/conf $< -m arch/$(ARCH)/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/$(ARCH)/Kconfig + defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< -d arch/$(ARCH)/Kconfig -- Andreas Gruenbacher SUSE Labs, SUSE LINUX PRODUCTS GMBH - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/