From patchwork Thu Oct 18 08:03:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 192224 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 AD5E72C00A3 for ; Thu, 18 Oct 2012 19:03:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A6B07A0423; Thu, 18 Oct 2012 08:03:48 +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 ibghmsNi7FiQ; Thu, 18 Oct 2012 08:03:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 41525A0337; Thu, 18 Oct 2012 08:03:46 +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 617268F791 for ; Thu, 18 Oct 2012 08:03:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 468088D0B8 for ; Thu, 18 Oct 2012 08:03:44 +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 y2WgCfmXhzwU for ; Thu, 18 Oct 2012 08:03:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 5C2248D107 for ; Thu, 18 Oct 2012 08:03:39 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id BB670E5; Thu, 18 Oct 2012 10:02:30 +0200 (CEST) Received: from localhost (gar31-2-82-226-185-134.fbx.proxad.net [82.226.185.134]) by mail.free-electrons.com (Postfix) with ESMTPSA id B5D14D1 for ; Thu, 18 Oct 2012 10:02:19 +0200 (CEST) From: Maxime Ripard To: buildroot@busybox.net Date: Thu, 18 Oct 2012 10:03:25 +0200 Message-Id: <1350547405-31491-1-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH] barebox: Allow to pass a custom configuration 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 Signed-off-by: Maxime Ripard --- boot/barebox/Config.in | 21 +++++++++++++++++++++ boot/barebox/barebox.mk | 16 +++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in index 1f86bc4..5c05270 100644 --- a/boot/barebox/Config.in +++ b/boot/barebox/Config.in @@ -75,12 +75,33 @@ config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION endif + +choice + prompt "Barebox configuration" + default BR2_TARGET_BAREBOX_USE_DEFCONFIG + +config BR2_TARGET_BAREBOX_USE_DEFCONFIG + bool "Using a defconfig" + +config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + bool "Using a custom config file" + +endchoice + config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG string "board defconfig" + depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG help Name of the board for which Barebox should be built, without the _defconfig suffix. + +config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE + string "Configuration file path" + depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG + help + Path to the kernel configuration file + config BR2_TARGET_BAREBOX_BAREBOXENV bool "bareboxenv tool in target" help diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk index 9550cdc..3512251 100644 --- a/boot/barebox/barebox.mk +++ b/boot/barebox/barebox.mk @@ -37,8 +37,6 @@ ifneq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) BAREBOX_INSTALL_TARGET = NO endif -BAREBOX_BOARD_DEFCONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG)) - ifeq ($(KERNEL_ARCH),i386) BAREBOX_ARCH=x86 else ifeq ($(KERNEL_ARCH),powerpc) @@ -49,8 +47,16 @@ endif BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" + +ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y) +BAREBOX_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig +else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y) +BAREBOX_SOURCE_CONFIG = $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) +endif + define BAREBOX_CONFIGURE_CMDS - $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) $(BAREBOX_BOARD_DEFCONFIG)_defconfig + cp $(BAREBOX_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig endef ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) @@ -80,8 +86,8 @@ $(eval $(generic-package)) ifeq ($(BR2_TARGET_BAREBOX),y) # we NEED a board defconfig file unless we're at make source ifeq ($(filter source,$(MAKECMDGOALS)),) -ifeq ($(BAREBOX_BOARD_DEFCONFIG),) -$(error No Barebox defconfig file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG setting) +ifeq ($(BAREBOX_SOURCE_CONFIG),) +$(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG setting) endif endif