From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] system: add option to pass extra args to post-build and post-image scripts
Date: Tue, 9 Jul 2013 21:25:36 +0300 [thread overview]
Message-ID: <20130709182536.GU5098@tarshish> (raw)
In-Reply-To: <1373393196-19024-1-git-send-email-yann.morin.1998@free.fr>
Hi Yann,
On Tue, Jul 09, 2013 at 08:06:36PM +0200, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> It can be useful to have different configuration use the same post-build
> and/or post-image scripts as they share a common infrastructure, but yet
> have minor differentiation.
>
> This option allows passing zero or more additional arguments to each
> post-build or post-image script.
>
> The same set of extra arguments are passed to all scripts, it is not
> possible to pass different arguments to each script.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
You should also change the "first and only argument" language in the help text
of BR2_ROOTFS_POST_BUILD_SCRIPT and BR2_ROOTFS_POST_IMAGE_SCRIPT.
baruch
> ---
> Makefile | 4 ++--
> system/Config.in | 16 ++++++++++++++++
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 955e684..f6e9965 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -512,7 +512,7 @@ endif
>
> @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> $(call MESSAGE,"Executing post-build script $(s)"); \
> - $(s) $(TARGET_DIR)$(sep))
> + $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
>
> ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
> LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
> @@ -558,7 +558,7 @@ endif
> target-post-image:
> @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
> $(call MESSAGE,"Executing post-image script $(s)"); \
> - $(s) $(BINARIES_DIR)$(sep))
> + $(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/system/Config.in b/system/Config.in
> index c0e4f4a..da50f67 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -294,4 +294,20 @@ config BR2_ROOTFS_POST_IMAGE_SCRIPT
> first and only argument. The script is executed from the
> main Buildroot source directory as the current directory.
>
> +config BR2_ROOTFS_POST_SCRIPT_ARGS
> + string "Extra post-{build,image} arguments"
> + depends on BR2_ROOTFS_POST_BUILD_SCRIPT != "" || BR2_ROOTFS_POST_IMAGE_SCRIPT != ""
> + help
> + Pass these aditional arguments to each post-build or post-image
> + scripts.
> +
> + Note that all the post-build and post-image scripts will be passed
> + the same set of arguments, you can not pass different arguments to
> + each script.
> +
> + Note also, as stated in their respective help text, that the first
> + argument to each post-build or post-image script is the target/
> + directory $(TARGET_DIR). The arguments in this option will be
> + passed *after*.
> +
> endmenu
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
next prev parent reply other threads:[~2013-07-09 18:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 18:06 [Buildroot] [PATCH] system: add option to pass extra args to post-build and post-image scripts Yann E. MORIN
2013-07-09 18:25 ` Baruch Siach [this message]
2013-07-09 18:54 ` Yann E. MORIN
2013-07-09 18:35 ` Yann E. MORIN
2013-07-09 21:50 ` Peter Korsgaard
2013-07-10 7:16 ` Thomas Petazzoni
2013-07-10 9:29 ` Thomas Petazzoni
2013-07-10 9:53 ` Peter Korsgaard
2013-07-10 12:49 ` Thomas Petazzoni
2013-07-10 16:22 ` Yann E. MORIN
2013-07-10 16:17 ` Yann E. MORIN
-- strict thread matches above, loose matches on Subject: below --
2013-07-09 22:00 Yann E. MORIN
2013-07-10 7:31 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130709182536.GU5098@tarshish \
--to=baruch@tkos.co.il \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.