From patchwork Sun Oct 27 17:24:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 286353 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 7D7B52C0091 for ; Mon, 28 Oct 2013 04:24:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AD6A98B388; Sun, 27 Oct 2013 17:24:23 +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 TupyncGCUfu0; Sun, 27 Oct 2013 17:24:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A44048AE15; Sun, 27 Oct 2013 17:24:22 +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 224F51BF838 for ; Sun, 27 Oct 2013 17:24:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1D3418B189 for ; Sun, 27 Oct 2013 17:24:22 +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 xYi8JJYwaidO for ; Sun, 27 Oct 2013 17:24:21 +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 4D5E28AC18 for ; Sun, 27 Oct 2013 17:24:21 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex4so540315wid.9 for ; Sun, 27 Oct 2013 10:24:19 -0700 (PDT) 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=Fw0paeGM/VorOY3sPkrwXzB3E23GuAxpILeN1+2sMME=; b=P9tDf5Or6FYZ1L1tmiEi9i0e2lc2Jg7ORNx1R22+JVZ2Hgdtc0dnOlxpZHmv7q4MCr U1ty6VyjVz7OHEMsbg0MPF1RNd1AvNdziSIj/OY6ZZeYkZzoCKFgZlhL/bbQ2jlI1cb7 xazcglRrWJZ7M5iEPX0TGsAIIa5KACiGMTpMNFjJYoLTuQNGUHxi/kFn6VRS1D2IjJIX XphoVNWdjizfcEZukDDk+2DNB0xvcc5N+stU68EmRx4JpDWugOxKHP/9/FFKa9bJcXAL S5alcG9od9FGr96KIHdGPRVjDG6TA1nKx+DBS21npBZxwQCrQwVG7ljX5iEf3DopEcHd 9Wqg== X-Received: by 10.180.187.2 with SMTP id fo2mr5794607wic.65.1382894659899; Sun, 27 Oct 2013 10:24:19 -0700 (PDT) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id y20sm27491826wib.0.2013.10.27.10.24.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Oct 2013 10:24:19 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 27 Oct 2013 17:24:10 +0000 Message-Id: X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/4] post-{build, images} hooks: export BUILD_DIR too 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: "Yann E. MORIN" Also export BUILD_DIR for post-{build,images} hooks, so they do have a place to store generated files. Note: this will be more einteresting for the instrumentation of steps, to come in a later patch. Signed-off-by: "Yann E. MORIN" --- Makefile | 4 ++-- docs/manual/customize-rootfs.txt | 5 +++-- package/Makefile.in | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f266e2d..0113f75 100644 --- a/Makefile +++ b/Makefile @@ -511,7 +511,7 @@ endif @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \ $(call MESSAGE,"Executing post-build script $(s)"); \ - $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) + $(USER_HOOKS_EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge @@ -557,7 +557,7 @@ endif target-post-image: @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ $(call MESSAGE,"Executing post-image script $(s)"); \ - $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) + $(USER_HOOKS_EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) toolchain-eclipse-register: ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt index 49a6b4b..450b3d5 100644 --- a/docs/manual/customize-rootfs.txt +++ b/docs/manual/customize-rootfs.txt @@ -41,6 +41,7 @@ there are a few ways to customize the resulting target filesystem. - +BUILDROOT_CONFIG+: the path to the Buildroot .config file - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see xref:generic-package-reference[] + - +BUILD_DIR+: the directory where packages are extracted and built - +BINARIES_DIR+: the place where all binary files (aka images) are stored - +BASE_DIR+: the base output directory @@ -78,8 +79,8 @@ in one of these _post-image scripts_ will require special handling Just like for the _post-build scripts_ mentioned above, you also have access to the following environment variables from your _post-image -scripts_: +BUILDROOT_CONFIG+, +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+, -+BINARIES_DIR+ and +BASE_DIR+. +scripts_: +BUILDROOT_CONFIG+, +BUILD_DIR+, +HOST_DIR+, +STAGING_DIR+, ++TARGET_DIR+, +BINARIES_DIR+ and +BASE_DIR+. Additionally, each of the +BR2_ROOTFS_POST_BUILD_SCRIPT+ and +BR2_ROOTFS_POST_IMAGE_SCRIPT+ scripts will be passed the arguments diff --git a/package/Makefile.in b/package/Makefile.in index 612f3c7..2224f27 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -275,6 +275,11 @@ HOST_MAKE_ENV=PATH=$(HOST_PATH) \ PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig" \ PERLLIB="$(HOST_DIR)/usr/lib/perl" +# This extra environment we can not export ourselves, so we have +# to expicitly pass it to user-supplied external hooks (eg. +# post-build, post-images) +USER_HOOKS_EXTRA_ENV=\ + BUILD_DIR=$(BUILD_DIR) ################################################################################ # settings we need to pass to configure