From patchwork Thu Feb 7 21:58:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 219001 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 9817A2C0091 for ; Fri, 8 Feb 2013 09:00:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 63F79A0223; Thu, 7 Feb 2013 22:00:34 +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 cqJe1xAinkKN; Thu, 7 Feb 2013 22:00:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 63C7CA00F7; Thu, 7 Feb 2013 22:00:24 +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 357D48F753 for ; Thu, 7 Feb 2013 21:59:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C75D48CA37 for ; Thu, 7 Feb 2013 21:59:46 +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 ily2k+tdsVG0 for ; Thu, 7 Feb 2013 21:59:33 +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 4D9548C93F for ; Thu, 7 Feb 2013 21:58:55 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 9D8F684C; Thu, 7 Feb 2013 22:58:54 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 226FE827 for ; Thu, 7 Feb 2013 22:58:54 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Thu, 7 Feb 2013 22:58:44 +0100 Message-Id: <1360274328-14754-3-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360274328-14754-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1360274328-14754-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH v3 2/6] docs/manual: mention the new post-image mechanism 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: Thomas Petazzoni Acked-by: "Yann E. MORIN" Acked-by: Samuel Martin --- v1->v2: * Fix typos noticed by Yann. v2->v3: * Mention that the post-image scripts are executed as the user executing Buildroot, i.e generally not the root user. Suggested by Samuel Martin. --- docs/manual/customize-rootfs.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt index fa04d85..97af580 100644 --- a/docs/manual/customize-rootfs.txt +++ b/docs/manual/customize-rootfs.txt @@ -55,3 +55,25 @@ there are a few ways to customize the resulting target filesystem. target root filesystem in +package/customize/source+, and then enable this special package in the configuration system. _This method is marked as deprecated_. + +Note also that if you want to perform some specific actions *after* +all filesystem images have been created (for example to automatically +extract your root filesystem tarball in a location exported by your +NFS server, or to create a special firmware image that bundles your +root filesystem and kernel image, or any other custom action), you can +specify a space-separated list of scripts in the ++BR2_ROOTFS_POST_IMAGE_SCRIPT+ configuration option. + +Each of those scripts will be called, with the path to the +images+ +output directory as first and unique argument, and will be executed +with the main Buildroot source directory as the current +directory. Those scripts will be executed as the user that executes +Buildroot, which should normally not be the root user. Therefore, any +action requiring root permissions in one of these post-image script +will require special handling (usage of fakeroot or sudo), which is +left to the script developer. + +Just like for the _post-build scripts_ mentionned 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+.