[Buildroot] [PATCH 4/4] pkg-infra: add user-supplied step-hooks

Thomas De Schampheleire patrickdepinguin at gmail.com
Mon Nov 11 08:30:50 UTC 2013


Hi Yann,

On Mon, Nov 11, 2013 at 12:51 AM, Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
> From: "Yann E. MORIN" <yann.morin.1998 at free.fr>
>
> Allow user to supply their own step-hooks by passing a variable
> on the make command-line:
>     make BR2_STEP_USER_HOOK=/path/to/my/script
>
> This can be usefull to run site-specific actions at each step of the

useful

> build process, such as logging installed, removed or modified files,
> do sanity checks on installed files...
>
> It is possible to call more than one script, by passing a space-separated
> lists of scripts to call.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
> ---
>  docs/manual/debugging-buildroot.txt | 33 +++++++++++++++++++++++++++++++++
>  docs/manual/developer-guide.txt     |  2 ++
>  package/pkg-generic.mk              |  9 +++++++++
>  3 files changed, 44 insertions(+)
>  create mode 100644 docs/manual/debugging-buildroot.txt
>
> diff --git a/docs/manual/debugging-buildroot.txt b/docs/manual/debugging-buildroot.txt
> new file mode 100644
> index 0000000..7e66208
> --- /dev/null
> +++ b/docs/manual/debugging-buildroot.txt
> @@ -0,0 +1,33 @@
> +// -*- mode:doc; -*-
> +// vim: set syntax=asciidoc:
> +
> +[[debugging-buildroot]]
> +
> +Debugging Buildroot
> +-------------------
> +
> +It is possible to instrument the steps +Buildroot+ does when building
> +packages. Define the variable +BR2_STEPS_USER_HOOKS+ to contain the path
> +of one or more scripts (or other executables), in a space-separated list,
> +you want called before and after each step. The script is called with
> +three parameters:
> +
> +  - +start+ or +end+ to denote the start (resp. the end) of a step;
> +  - the name of the step about to be started, or which just ended.
> +  - the name of the package
> +
> +For example :
> +
> +----
> +make BR2_STEPS_USER_HOOKS="/path/to/my/script1 /path/to/my/script2"
> +----

I think this variable should be named more in accordance with the name
GLOBAL_INSTRUMENTATION_HOOKS. For example:
BR2_USER_INSTRUMENTATION_HOOKS
or plainly:
BR2_INSTRUMENTATION_HOOKS
(or something else)

Best regards,
Thomas



More information about the buildroot mailing list