Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] [v2] Allow to run severals post build scripts instead of only one
@ 2012-07-09  8:30 Philippe Reynes
  2012-07-09 11:32 ` Arnout Vandecappelle
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Reynes @ 2012-07-09  8:30 UTC (permalink / raw)
  To: buildroot

Using severals post build scripts is usefull to share
script between severals boards/projects.

Signed-off-by: Philippe Reynes <philippe.reynes@sagemcom.com>
---
 Makefile                 |    3 ++-
 target/generic/Config.in |   11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index b80477f..56833da 100644
--- a/Makefile
+++ b/Makefile
@@ -449,7 +449,8 @@ endif
 
 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
 	@$(call MESSAGE,"Executing post-build script")
-	$(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
+	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
+		$(s) $(TARGET_DIR);)
 endif
 
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
diff --git a/target/generic/Config.in b/target/generic/Config.in
index 88f0718..b987331 100644
--- a/target/generic/Config.in
+++ b/target/generic/Config.in
@@ -138,15 +138,16 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT
 	string "Custom script to run before creating filesystem images"
 	default ""
 	help
-	  Specify a script to be run after the build has finished and before
-	  Buildroot starts packing the files into selected filesystem images.
+	  Specify a space-separated list of scripts to be run after the build
+	  has finished and before Buildroot starts packing the files into 
+	  selected filesystem images.
 
 	  This gives users the oportunity to do board-specific cleanups,
 	  add-ons and the like, so the generated files can be used directly
 	  without further processing.
 
-	  The script is called with the target directory name as first and
-	  only argument. Make sure the exit code of that script is 0,
-	  otherwise make will stop after calling it.
+	  These scripts are called with the target directory name as first and
+	  only argument. Make sure the exit code of those scripts are 0,
+	  otherwise make will stop after calling them.
 
 endmenu
-- 
1.7.1


#
" Ce courriel et les documents qui lui sont joints peuvent contenir des
informations confidentielles ou ayant un caract?re priv?. S'ils ne vous sont
pas destin?s, nous vous signalons qu'il est strictement interdit de les
divulguer, de les reproduire ou d'en utiliser de quelque mani?re que ce
soit le contenu. Si ce message vous a ?t? transmis par erreur, merci d'en
informer l'exp?diteur et de supprimer imm?diatement de votre syst?me
informatique ce courriel ainsi que tous les documents qui y sont attach?s."


                               ******

" This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, you are
notified that any dissemination, copying of this e-mail and any attachments
thereto or use of their contents by any means whatsoever is strictly
prohibited. If you have received this e-mail in error, please advise the
sender immediately and delete this e-mail and all attached documents
from your computer system."
#

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] [v2] Allow to run severals post build scripts instead of only one
  2012-07-09  8:30 [Buildroot] [PATCH] [v2] Allow to run severals post build scripts instead of only one Philippe Reynes
@ 2012-07-09 11:32 ` Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2012-07-09 11:32 UTC (permalink / raw)
  To: buildroot

On 07/09/12 10:30, Philippe Reynes wrote:
> Using severals post build scripts is usefull to share
> script between severals boards/projects.
>
> Signed-off-by: Philippe Reynes<philippe.reynes@sagemcom.com>
> ---
>   Makefile                 |    3 ++-
>   target/generic/Config.in |   11 ++++++-----
>   2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index b80477f..56833da 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -449,7 +449,8 @@ endif
>
>   ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
>       @$(call MESSAGE,"Executing post-build script")
  This should be plural now :-)  Or "script(s)".

> -    $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
> +    @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> +        $(s) $(TARGET_DIR);)
>   endif
>
>   ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
> diff --git a/target/generic/Config.in b/target/generic/Config.in
> index 88f0718..b987331 100644
> --- a/target/generic/Config.in
> +++ b/target/generic/Config.in
> @@ -138,15 +138,16 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT
>       string "Custom script to run before creating filesystem images"
>       default ""
>       help
> -      Specify a script to be run after the build has finished and before
> -      Buildroot starts packing the files into selected filesystem images.
> +      Specify a space-separated list of scripts to be run after the build
> +      has finished and before Buildroot starts packing the files into
> +      selected filesystem images.
>
>         This gives users the oportunity to do board-specific cleanups,
>         add-ons and the like, so the generated files can be used directly
>         without further processing.
>
> -      The script is called with the target directory name as first and
> -      only argument. Make sure the exit code of that script is 0,
> -      otherwise make will stop after calling it.
> +      These scripts are called with the target directory name as first and
> +      only argument. Make sure the exit code of those scripts are 0,
> +      otherwise make will stop after calling them.

  With this patch, this is no longer true except for the last script in the list.
To fix that, it should be something like:

     @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
         $(s) $(TARGET_DIR) || exit 1;)

Or even better (untested):

     @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
         $(s) $(TARGET_DIR)$(sep))


  Regards,
  Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-09 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-09  8:30 [Buildroot] [PATCH] [v2] Allow to run severals post build scripts instead of only one Philippe Reynes
2012-07-09 11:32 ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox