From patchwork Sat Oct 20 23:45:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 192969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 5A8062C0090 for ; Sun, 21 Oct 2012 10:46:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 78CF6A0393; Sat, 20 Oct 2012 23:46:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ywcJ-mPrLET; Sat, 20 Oct 2012 23:46:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E383EA0371; Sat, 20 Oct 2012 23:46:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8AE508F74A for ; Sat, 20 Oct 2012 23:45:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 59D038BB7E for ; Sat, 20 Oct 2012 23:45:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TAk7W2zf5DNG for ; Sat, 20 Oct 2012 23:45:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7EAA68C16A for ; Sat, 20 Oct 2012 23:45:41 +0000 (UTC) Received: from [172.16.2.6] (helo=vandecaa-laptop) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1TPija-0000OP-D9; Sun, 21 Oct 2012 01:45:39 +0200 Received: from arnout by vandecaa-laptop with local (Exim 4.80) (envelope-from ) id 1TPijZ-00036g-EX; Sun, 21 Oct 2012 01:45:37 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@busybox.net Date: Sun, 21 Oct 2012 01:45:31 +0200 Message-Id: <1350776731-8467-11-git-send-email-arnout@mind.be> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350776731-8467-1-git-send-email-arnout@mind.be> References: <1350776731-8467-1-git-send-email-arnout@mind.be> Subject: [Buildroot] [PATCH 10/10] Make savedefconfig save to a configured file. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: "Arnout Vandecappelle (Essensium/Mind)" Store BR2_DEFCONFIG in .config, and use it to update the original input defconfig file after updating the configuration. When a config is created by using the BR2_DEFCONFIG=... option, this is saved in the .config file; later runs of savedefconfig will update that same location. It is also possible to configure this place in the interactive configuration. The BR2_DEFCONFIG value itself is not saved into the generated defconfig, since Kconfig considers it at its default. This is intentional, to avoid hard-coding an absolute path in the defconfig. It will anyway be set again when the defconfig is used with the 'make BR2_DEFCONFIG=... defconfig' command. As a side-effect of this change, the *config options have been moved out of the BR2_HAVE_DOT_CONFIG condition. This doesn't make any functional difference, because the .config is still not read for the *config targets. However, the defconfig and savedefconfig targets do need to include .config now, which makes them slightly slower. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- Config.in | 12 ++++++++++++ Makefile | 17 +++++++++++++---- docs/manual/customize-store.txt | 1 + 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Config.in b/Config.in index dab7787..670ce84 100644 --- a/Config.in +++ b/Config.in @@ -16,6 +16,18 @@ config BR2_HOSTARCH source "target/Config.in.arch" +config BR2_DEFCONFIG_FROM_ENV + string + option env="BR2_DEFCONFIG" + +config BR2_DEFCONFIG + string "Location to save buildroot config" + default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != "" + default "$(CONFIG_DIR)/defconfig" + help + When running 'make savedefconfig', the defconfig file will be saved + in this location. + menu "Build options" menu "Commands" diff --git a/Makefile b/Makefile index e257c61..f6b8ef8 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ DATE:=$(shell date +%Y%m%d) export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion) noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \ - defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \ + %_defconfig allyesconfig allnoconfig silentoldconfig release \ randpackageconfig allyespackageconfig allnopackageconfig \ source-check print-version @@ -556,6 +556,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) all: menuconfig +endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) + # configuration # --------------------------------------------------------------------------- @@ -566,7 +568,12 @@ $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) +DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG)) + +# We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will +# recognize that if it's still at its default $(CONFIG_DIR)/defconfig COMMON_CONFIG_ENV = \ + BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \ KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \ KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \ @@ -638,7 +645,7 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @mkdir -p $(BUILD_DIR)/buildroot-config - @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN) + @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN) %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile @mkdir -p $(BUILD_DIR)/buildroot-config @@ -646,13 +653,15 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @mkdir -p $(BUILD_DIR)/buildroot-config - @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN) + @$(COMMON_CONFIG_ENV) $< \ + --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ + $(CONFIG_CONFIG_IN) # check if download URLs are outdated source-check: $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source -endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) +.PHONY: defconfig savedefconfig ############################################################# # diff --git a/docs/manual/customize-store.txt b/docs/manual/customize-store.txt index 6deed49..92d5378 100644 --- a/docs/manual/customize-store.txt +++ b/docs/manual/customize-store.txt @@ -156,6 +156,7 @@ the buildroot tree). * +BR2_TOOLCHAIN_CTNG_CONFIG+ * +BR2_UCLIBC_CONFIG+ * +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+ +1. Set +BR2_DEFCONFIG+ to +/buildroot.config+ 1. Create +/fs-overlay+ and fill it with additional files you need on your rootfs, e.g. +/etc/inittab+. Set +BR2_ROOTFS_OVERLAY+