Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose
@ 2013-04-03  8:28 Luca Ceresoli
  2013-04-03  8:32 ` Thomas Petazzoni
  2013-04-04  1:35 ` Danomi Manchego
  0 siblings, 2 replies; 5+ messages in thread
From: Luca Ceresoli @ 2013-04-03  8:28 UTC (permalink / raw)
  To: buildroot

Make the post-build system similar to the rootfs overlay system. This allows to
show each script filename before execution.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 Makefile |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index c95bb1e..69996bc 100644
--- a/Makefile
+++ b/Makefile
@@ -509,11 +509,10 @@ endif
 			$${dir}/ $(TARGET_DIR); \
 	done
 
-ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
-	@$(call MESSAGE,"Executing post-build script\(s\)")
-	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
-		$(s) $(TARGET_DIR)$(sep))
-endif
+	@for scr in $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)); do \
+		$(call MESSAGE,"Executing post-build script $${scr}"); \
+		$${scr} $(TARGET_DIR); \
+	done
 
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
-- 
1.7.10.4

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

* [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose
  2013-04-03  8:28 [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose Luca Ceresoli
@ 2013-04-03  8:32 ` Thomas Petazzoni
  2013-04-07 13:58   ` Luca Ceresoli
  2013-04-04  1:35 ` Danomi Manchego
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2013-04-03  8:32 UTC (permalink / raw)
  To: buildroot

Dear Luca Ceresoli,

On Wed,  3 Apr 2013 10:28:48 +0200, Luca Ceresoli wrote:
> Make the post-build system similar to the rootfs overlay system. This allows to
> show each script filename before execution.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

I don't have a strong opinion on whether this is useful or not, but if
it gets applied, I'd like the same to be done for post-image scripts,
in order to keep the consistency.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose
  2013-04-03  8:28 [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose Luca Ceresoli
  2013-04-03  8:32 ` Thomas Petazzoni
@ 2013-04-04  1:35 ` Danomi Manchego
  2013-04-08 16:47   ` Luca Ceresoli
  1 sibling, 1 reply; 5+ messages in thread
From: Danomi Manchego @ 2013-04-04  1:35 UTC (permalink / raw)
  To: buildroot

Alternatively, you could just move the MESSAGE into the loop instead
of relying on shell loops.  That would keep things more in make, if
that's desired.

	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
		$(call MESSAGE,"Executing $(s)"); \
		$(s) $(TARGET_DIR)$(sep))

Danomi -

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

* [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose
  2013-04-03  8:32 ` Thomas Petazzoni
@ 2013-04-07 13:58   ` Luca Ceresoli
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ceresoli @ 2013-04-07 13:58 UTC (permalink / raw)
  To: buildroot

Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
>
> On Wed,  3 Apr 2013 10:28:48 +0200, Luca Ceresoli wrote:
>> Make the post-build system similar to the rootfs overlay system. This allows to
>> show each script filename before execution.
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> I don't have a strong opinion on whether this is useful or not, but if
> it gets applied, I'd like the same to be done for post-image scripts,
> in order to keep the consistency.

To me it is useful each time multiple post-build scripts are used, 
because is
makes it easy to understand what's happening and which scripts you are 
running
(and which you are not running).
E.g., I have multiple products with a common base, plus some "optional" 
features.
Some features needs a specific post-build script. Each product 
implements a subset
of the features, but these subsets overlap between different products.
When a build a product's rootfs it is useful to see if I am running all 
and only
the correct post-build scripts: the "common base" script, plus the 
scripts for the
wanted features.

Of course I agree this change should be done also in the post-image scripts.
I will submit a patchset that does also this.

Luca

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

* [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose
  2013-04-04  1:35 ` Danomi Manchego
@ 2013-04-08 16:47   ` Luca Ceresoli
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ceresoli @ 2013-04-08 16:47 UTC (permalink / raw)
  To: buildroot

Danomi Manchego wrote:
> Alternatively, you could just move the MESSAGE into the loop instead
> of relying on shell loops.  That would keep things more in make, if
> that's desired.
>
> 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> 		$(call MESSAGE,"Executing $(s)"); \
> 		$(s) $(TARGET_DIR)$(sep))

It is actually cleanerand should also be more efficient(FWIW).

Sending a v2 patchset with this implementation.

Luca

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

end of thread, other threads:[~2013-04-08 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03  8:28 [Buildroot] [PATCH] post-build: reimplement using a for loop and make verbose Luca Ceresoli
2013-04-03  8:32 ` Thomas Petazzoni
2013-04-07 13:58   ` Luca Ceresoli
2013-04-04  1:35 ` Danomi Manchego
2013-04-08 16:47   ` Luca Ceresoli

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