From patchwork Sun Jan 13 21:52:20 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: 211652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id E5C4F2C0101 for ; Mon, 14 Jan 2013 08:52:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 44B3A1014FB; Sun, 13 Jan 2013 21:52:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s6oAd1RZJQjh; Sun, 13 Jan 2013 21:52:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 48F5C100DCB; Sun, 13 Jan 2013 21:52:27 +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 C4AAB8F7A0 for ; Sun, 13 Jan 2013 21:52:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6153E81C26 for ; Sun, 13 Jan 2013 21:52:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E8H76PwzosvT for ; Sun, 13 Jan 2013 21:52:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 14861816DC for ; Sun, 13 Jan 2013 21:52:30 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id u3so1779558wey.16 for ; Sun, 13 Jan 2013 13:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=ysVwXBLAstjS8PYhJcu1nIU7FGJkBbHDU5to1SE/Gyk=; b=RfuQZUpIA6kkGjOgtsh9P1rdfWmuBXPrQHvLemP7PrpmHjOS6ZWA0L4a2hr4ft2Zt2 ONTH1iWjkUtinaxVxNiVUIL/1O7OdLQ8e9X4rLMPECLoEiLtPoIcytA0tg+tNGVEQTXJ ilsoYQ/aTaZjbs97OO0Q5IEHCdQ5VVsOhCBoFGOHrK3/Jrz7ydF8SZZAQdCUuAkcDbTy dhfEEfCkeHJhiP4NByPlgwhVi6zPyWgtE7NfD+Sx5GMpxOqRjCSePRYVoH6KsnWR2rMX TX7NtFU8KRFXoa0kQu70mEZi7dTJnjA/b7CA8TDeO9Q281U1s8PKEH/n3R71SPcCTDZ3 5QGw== X-Received: by 10.194.78.207 with SMTP id d15mr131771120wjx.52.1358113949488; Sun, 13 Jan 2013 13:52:29 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-33-7.w90-32.abo.wanadoo.fr. [90.32.16.7]) by mx.google.com with ESMTPS id fv2sm10047940wib.4.2013.01.13.13.52.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Jan 2013 13:52:28 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 13 Jan 2013 22:52:20 +0100 Message-Id: X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/4] Makefile: export a few variables to help support scripts 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 Support scripts (in support/) may need to parse the .config file, so give them an easy access to it, by exporting BUILDROOT_CONFIG with the fully- qualified path to .config. Also, post-build scripts may need to reference a few locations, so export those, too. Note: we export both O and BASE_DIR. Although they are the same, BASE_DIR is used internally, while O is used on the command line, which makes it a bit ambiguous to know which to use. As users use O= on the command line, they will probably tend to use that in their post-build scripts. Update doc accordingly. Signed-off-by: "Yann E. MORIN" Cc: Arnout Vandecappelle Cc: Thomas Petazzoni cc: Peter Korsgaard --- Makefile | 11 +++++++++++ docs/manual/customize-rootfs.txt | 7 +++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index 074674a..5a83251 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,8 @@ EXTRAMAKEARGS = O=$(O) NEED_WRAPPER=y endif +BUILDROOT_CONFIG=$(CONFIG_DIR)/.config + # Pull in the user's configuration file ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) -include $(CONFIG_DIR)/.config @@ -282,6 +284,15 @@ HOSTCC := $(CCACHE) $(HOSTCC) HOSTCXX := $(CCACHE) $(HOSTCXX) endif +# Scripts in support/ or post-build scripts may need to reference +# these locations, so export them so it is easier to use +export BUILDROOT_CONFIG +export TARGET_DIR +export STAGING_DIR +export HOST_DIR +export BINARIES_DIR +export BASE_DIR O # O and BASE_DIR are the same + ############################################################# # # You should probably leave this stuff alone unless you know diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt index a1a556b..fe3ea7e 100644 --- a/docs/manual/customize-rootfs.txt +++ b/docs/manual/customize-rootfs.txt @@ -37,6 +37,13 @@ there are a few ways to customize the resulting target filesystem. certain package generates wrong or unneeded files, you should fix that package rather than work around it with a post-build cleanup script. _Among these first 3 methods, this one should be preferred_. + You may also use these variables in your post-build script: + - +BUILDROOT_CONFIG+: the path to the Buildroot .config file + - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see + xref:generic-package-reference[] + - +BINARIES_DIR+: the place were all binary files (aka images) are + stored + - +BASE_DIR+ (or +O+): the base output directory * A special package, 'customize', stored in +package/customize+ can be used. You can put all the files that you want to see in the final