From patchwork Wed Nov 4 21:20:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pieter Smith X-Patchwork-Id: 540182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 41D611413DD for ; Thu, 5 Nov 2015 08:21:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=aOxr51yK; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4E8D593068; Wed, 4 Nov 2015 21:21: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 jlcAg6eMgX+w; Wed, 4 Nov 2015 21:21:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3F5C593076; Wed, 4 Nov 2015 21:21:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8EC141C0C93 for ; Wed, 4 Nov 2015 21:21:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8782C8AC65 for ; Wed, 4 Nov 2015 21:21:09 +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 3utolxpi2wcX for ; Wed, 4 Nov 2015 21:21:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id 909C58AC6C for ; Wed, 4 Nov 2015 21:21:08 +0000 (UTC) Received: by wicll6 with SMTP id ll6so98338898wic.0 for ; Wed, 04 Nov 2015 13:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=60S7tQmgqFQEobn1rwgeE/z5Ji5s8GcyNQmllI23Ows=; b=aOxr51yKCrTpIJHnj3uy1odjPbjLzD2yc4e5l+LhMaQLhqFH5vmtNSyRu8xT0vFGfJ m55WvJJbhIrXIA9UeFHbn9gd0qbDAGhUK7w1gOBgVXSRRAOMlso2nTXwR7F3d1aSywP5 dODsb2ok7iK6skZN/kOrgfYRmPUfjXZ/ZGvMaLLt4jMh7dvTvLh1eUiDPFC9U+yYqToa DevTlaBjb7i4xN0KcI93J1exSfAPOEmx8aZur6wy0ETPomPnM93akUSlaVjtqrgN4f+8 iuTrC3vKx/TWh5u1QC9p2gzd5odeC9w9j/WZT5x6t5O3nSkNB4nuVpcQw4pHDsJ/x+dt nylg== X-Received: by 10.194.84.42 with SMTP id v10mr4463669wjy.116.1446672067145; Wed, 04 Nov 2015 13:21:07 -0800 (PST) Received: from localhost.localdomain (ip4da2e5c1.direct-adsl.nl. [77.162.229.193]) by smtp.gmail.com with ESMTPSA id l1sm4930007wmg.21.2015.11.04.13.21.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Nov 2015 13:21:06 -0800 (PST) From: Pieter Smith To: buildroot@busybox.net Date: Wed, 4 Nov 2015 22:20:30 +0100 Message-Id: <1446672031-13866-4-git-send-email-pieter@boesman.nl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446672031-13866-1-git-send-email-pieter@boesman.nl> References: <1446672031-13866-1-git-send-email-pieter@boesman.nl> Cc: Pieter Smith Subject: [Buildroot] [v2, 3/4] barebox: user selection of build output images X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" A non-default image can be selected as the barebox build output in the images/ directory. This typically is needed to select the appropriate image generated by multi-platform support defconfigs (E.g. am335x). Signed-off-by: Pieter Smith --- boot/barebox/Config.in | 36 ++++++++++++++++++++++++++++++++++++ boot/barebox/barebox-1/barebox-1.mk | 13 +++++++++++-- boot/barebox/barebox-2/barebox-2.mk | 7 +++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in index 81c07fb..19b4e0f 100644 --- a/boot/barebox/Config.in +++ b/boot/barebox/Config.in @@ -149,6 +149,24 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES A space-separated list of configuration fragment files, that will be merged to the main Barebox configuration file. +choice + prompt "Barebox image file" + default BR2_TARGET_BAREBOX_USE_DEFAULT_IMAGE + +config BR2_TARGET_BAREBOX_USE_DEFAULT_IMAGE + bool "Using the default image file" + +config BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE + bool "Using a specific image file" + +endchoice + +config BR2_TARGET_BAREBOX_IMAGE_FILE + string "Image file path" + depends on BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE + help + Name of the built barebox image file in the barebox images directory + endif if BR2_TARGET_BAREBOX_TWO_CONFIGS @@ -190,6 +208,24 @@ config BR2_TARGET_BAREBOX_2_CONFIG_FRAGMENT_FILES A space-separated list of configuration fragment files, that will be merged to the main Barebox configuration file. +choice + prompt "Barebox image file" + default BR2_TARGET_BAREBOX_2_USE_DEFAULT_IMAGE + +config BR2_TARGET_BAREBOX_2_USE_DEFAULT_IMAGE + bool "Using the default image file" + +config BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE + bool "Using a specific image file" + +endchoice + +config BR2_TARGET_BAREBOX_2_IMAGE_FILE + string "Image file path" + depends on BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE + help + Name of the built barebox image file in the barebox images directory + config BR2_TARGET_BAREBOX_2_INSTALL_FILENAME string "Destination image filename in output/images" default "MLO" diff --git a/boot/barebox/barebox-1/barebox-1.mk b/boot/barebox/barebox-1/barebox-1.mk index f71069b..b28248d 100644 --- a/boot/barebox/barebox-1/barebox-1.mk +++ b/boot/barebox/barebox-1/barebox-1.mk @@ -15,6 +15,7 @@ BAREBOX_1_POST_PATCH_HOOKS += $(BAREBOX_POST_PATCH_HOOKS) BAREBOX_1_MAKE_FLAGS = $(BAREBOX_MAKE_FLAGS) BAREBOX_1_MAKE_ENV = $(BAREBOX_MAKE_ENV) BAREBOX_1_INSTALL_IMAGES = $(BAREBOX_INSTALL_IMAGES) +BAREBOX_1_INSTALL_DEST = $(BINARIES_DIR)/barebox.bin ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y) BAREBOX_1_SOURCE_CONFIG = $(BAREBOX_1_DIR)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\ @@ -54,14 +55,22 @@ define BAREBOX_1_BUILD_CMDS $(BAREBOX_1_BUILD_CUSTOM_ENV) endef +ifdef BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE +define BAREBOX_1_INSTALL_IMAGES_CMDS + cp -L $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_IMAGE_FILE)) \ + $(BAREBOX_1_INSTALL_DEST) + $(BAREBOX_1_INSTALL_CUSTOM_ENV) +endef +else define BAREBOX_1_INSTALL_IMAGES_CMDS if test -h $(@D)/barebox-flash-image ; then \ - cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \ + cp -L $(@D)/barebox-flash-image $(BAREBOX_1_INSTALL_DEST) ; \ else \ - cp $(@D)/barebox.bin $(BINARIES_DIR);\ + cp $(@D)/barebox.bin $(BAREBOX_1_INSTALL_DEST);\ fi $(BAREBOX_1_INSTALL_CUSTOM_ENV) endef +endif ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) define BAREBOX_1_INSTALL_TARGET_CMDS diff --git a/boot/barebox/barebox-2/barebox-2.mk b/boot/barebox/barebox-2/barebox-2.mk index dd70cc7..b50fc7b 100644 --- a/boot/barebox/barebox-2/barebox-2.mk +++ b/boot/barebox/barebox-2/barebox-2.mk @@ -33,6 +33,12 @@ define BAREBOX_2_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_2_MAKE_FLAGS) -C $(@D) endef +ifdef BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE +define BAREBOX_2_INSTALL_IMAGES_CMDS + cp -L $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_2_IMAGE_FILE)) \ + $(BAREBOX_2_INSTALL_DEST) +endef +else define BAREBOX_2_INSTALL_IMAGES_CMDS if test -h $(@D)/barebox-flash-image ; then \ cp -L $(@D)/barebox-flash-image $(BAREBOX_2_INSTALL_DEST) ; \ @@ -40,5 +46,6 @@ define BAREBOX_2_INSTALL_IMAGES_CMDS cp $(@D)/barebox.bin $(BAREBOX_2_INSTALL_DEST);\ fi endef +endif $(eval $(kconfig-package))