diff mbox

[v3,2/6] docs/manual: mention the new post-image mechanism

Message ID 1360274328-14754-3-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni Feb. 7, 2013, 9:58 p.m. UTC
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
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(+)

Comments

Samuel Martin Feb. 8, 2013, 5:12 a.m. UTC | #1
2013/2/7 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Peter Korsgaard Feb. 8, 2013, 9:01 p.m. UTC | #2
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Thomas> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 Thomas> ---
 v1-> v2:
 Thomas>  * Fix typos noticed by Yann.
 v2-> v3:
 Thomas>  * Mention that the post-image scripts are executed as the user
 Thomas>    executing Buildroot, i.e generally not the root user. Suggested by
 Thomas>    Samuel Martin.
 Thomas> ---
 Thomas>  docs/manual/customize-rootfs.txt |   22 ++++++++++++++++++++++
 Thomas>  1 file changed, 22 insertions(+)

 Thomas> diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
 Thomas> index fa04d85..97af580 100644
 Thomas> --- a/docs/manual/customize-rootfs.txt
 Thomas> +++ b/docs/manual/customize-rootfs.txt
 Thomas> @@ -55,3 +55,25 @@ there are a few ways to customize the resulting target filesystem.
 Thomas>    target root filesystem in +package/customize/source+, and then
 Thomas>    enable this special package in the configuration system. _This
 Thomas>    method is marked as deprecated_.
 Thomas> +
 Thomas> +Note also that if you want to perform some specific actions *after*
 Thomas> +all filesystem images have been created (for example to automatically
 Thomas> +extract your root filesystem tarball in a location exported by your
 Thomas> +NFS server, or to create a special firmware image that bundles your
 Thomas> +root filesystem and kernel image, or any other custom action), you can
 Thomas> +specify a space-separated list of scripts in the
 Thomas> ++BR2_ROOTFS_POST_IMAGE_SCRIPT+ configuration option.
 Thomas> +
 Thomas> +Each of those scripts will be called, with the path to the +images+

I don't think this comma should be here.

 Thomas> +output directory as first and unique argument, and will be executed
 Thomas> +with the main Buildroot source directory as the current
 Thomas> +directory. Those scripts will be executed as the user that executes
 Thomas> +Buildroot, which should normally not be the root user. Therefore, any
 Thomas> +action requiring root permissions in one of these post-image script
 Thomas> +will require special handling (usage of fakeroot or sudo), which is
 Thomas> +left to the script developer.
 Thomas> +
 Thomas> +Just like for the _post-build scripts_ mentionned above, you also have

s/mentionned/mentioned/

Committed with these fixes, thanks.
diff mbox

Patch

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+.