From patchwork Tue Jan 22 15:40:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 214576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 038F52C00BA for ; Wed, 23 Jan 2013 02:40:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 62BA28B159; Tue, 22 Jan 2013 15:40:53 +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 ijZMtEj7Vb8H; Tue, 22 Jan 2013 15:40:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 631418AB49; Tue, 22 Jan 2013 15:40:51 +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 B77328F7A1 for ; Tue, 22 Jan 2013 15:40:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E1F0D8AB49 for ; Tue, 22 Jan 2013 15:40:49 +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 ZTe2nXaJPabI for ; Tue, 22 Jan 2013 15:40:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.35.102]) by whitealder.osuosl.org (Postfix) with ESMTP id 8599B8AAEF for ; Tue, 22 Jan 2013 15:40:45 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id A7FE35ED4; Tue, 22 Jan 2013 16:40:44 +0100 (CET) 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 1C9D61263 for ; Tue, 22 Jan 2013 16:40:44 +0100 (CET) From: Maxime Ripard To: buildroot@busybox.net Date: Tue, 22 Jan 2013 16:40:42 +0100 Message-Id: <1358869242-13472-1-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.10.4 Subject: [Buildroot] [PATCH] barebox: Allow to build an environment image 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 | 11 +++++++++++ boot/barebox/barebox.mk | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in index b9e03b3..24fcb38 100644 --- a/boot/barebox/Config.in +++ b/boot/barebox/Config.in @@ -99,4 +99,15 @@ config BR2_TARGET_BAREBOX_BAREBOXENV help Install bareboxenv tool in target. +config BR2_TARGET_BAREBOX_CUSTOM_ENV + bool "Generate an environment image" + help + Generate a custom environment image. + +config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH + string "Environment path" + depends on BR2_TARGET_BAREBOX_CUSTOM_ENV + help + Path to the custom barebox environment + endif diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk index 143338e..5ec47f6 100644 --- a/boot/barebox/barebox.mk +++ b/boot/barebox/barebox.mk @@ -67,9 +67,22 @@ define BAREBOX_BUILD_BAREBOXENV_CMDS endef endif +ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_ENV),y) +BAREBOX_ENV_NAME = $(notdir $(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH))) +define BAREBOX_BUILD_CUSTOM_ENV + $(@D)/scripts/bareboxenv -s \ + $(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \ + $(@D)/$(BAREBOX_ENV_NAME) +endef +define BAREBOX_INSTALL_CUSTOM_ENV + cp $(@D)/$(BAREBOX_ENV_NAME) $(BINARIES_DIR) +endef +endif + define BAREBOX_BUILD_CMDS $(BAREBOX_BUILD_BAREBOXENV_CMDS) $(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) + $(BAREBOX_BUILD_CUSTOM_ENV) endef define BAREBOX_INSTALL_IMAGES_CMDS @@ -78,6 +91,7 @@ define BAREBOX_INSTALL_IMAGES_CMDS else \ cp $(@D)/barebox.bin $(BINARIES_DIR);\ fi + $(BAREBOX_INSTALL_CUSTOM_ENV) endef ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)