Skip to contentSkip to conversation

Add support for custom post-build script

PATCH New Daniel Mack 4 participants 9 messages Jul 8, 2009 – Jul 27, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for custom post-build script

The config help text says it all:

Specify a script to be run after the build has finished and before the BR2 starts packing the files into selected packages.

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.

---
 Makefile         |    4 ++++
 target/Config.in |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
Makefile +4 -0
index 76dd2cd..dbeede5 100644
@@ -360,6 +360,10 @@ endif
 	find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
 	$(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
 
+ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
+	$(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
+endif
+
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 LOCALE_WHITELIST=$(PROJECT_BUILD_DIR)/locales.nopurge
 LOCALE_NOPURGE=$(strip $(subst ",,$(BR2_ENABLE_LOCALE_WHITELIST)))
target/Config.in +15 -0
index 87abbe6..dbdc2d6 100644
@@ -12,6 +12,21 @@ config BR2_ROOTFS_SUFFIX
 	help
 	  Add a custom string to the end of the root file system name.
 
+config BR2_ROOTFS_POST_BUILD_SCRIPT
+	string "Custom script to run before packing files"
+	default ""
+	help
+	  Specify a script to be run after the build has finished and before
+	  the BR2 starts packing the files into selected packages.
+
+	  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.
+
 comment "filesystem for target device"
 
 source "target/cramfs/Config.in"
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 1/1 Add support for custom post-build script

What about this one?

Quoted 64 lines · Daniel Mack

The config help text says it all:

Specify a script to be run after the build has finished and before the BR2 starts packing the files into selected packages.

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.

---
 Makefile         |    4 ++++
 target/Config.in |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
Makefile +4 -0
index 76dd2cd..dbeede5 100644
@@ -360,6 +360,10 @@ endif
 	find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
 	$(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
 
+ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
+	$(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
+endif
+
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 LOCALE_WHITELIST=$(PROJECT_BUILD_DIR)/locales.nopurge
 LOCALE_NOPURGE=$(strip $(subst ",,$(BR2_ENABLE_LOCALE_WHITELIST)))
target/Config.in +15 -0
index 87abbe6..dbdc2d6 100644
@@ -12,6 +12,21 @@ config BR2_ROOTFS_SUFFIX
 	help
 	  Add a custom string to the end of the root file system name.
 
+config BR2_ROOTFS_POST_BUILD_SCRIPT
+	string "Custom script to run before packing files"
+	default ""
+	help
+	  Specify a script to be run after the build has finished and before
+	  the BR2 starts packing the files into selected packages.
+
+	  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.
+
 comment "filesystem for target device"
 
 source "target/cramfs/Config.in"
Signature · 1 line
1.6.3.1
#2 lore raw

PATCH 1/1 Add support for custom post-build script

Code seems fine by me. It will be useful for some people.

Quoted 73 lines · Daniel Mack

What about this one?

Quoted 60 lines · Daniel Mack

The config help text says it all:

? Specify a script to be run after the build has finished and before ? the BR2 starts packing the files into selected packages.

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

---
?Makefile ? ? ? ? | ? ?4 ++++ ?target/Config.in | ? 15 +++++++++++++++ ?2 files changed, 19 insertions(+), 0 deletions(-)

Makefile +0 -0
index 76dd2cd..dbeede5 100644
@@ -360,6 +360,10 @@ endif

? ? ? find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true ? ? ? $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null

Makefile +4 -0
+ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
+ ? ? $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
+endif
+

?ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) ?LOCALE_WHITELIST=$(PROJECT_BUILD_DIR)/locales.nopurge ?LOCALE_NOPURGE=$(strip $(subst ",,$(BR2_ENABLE_LOCALE_WHITELIST)))

target/Config.in +0 -0
index 87abbe6..dbdc2d6 100644
@@ -12,6 +12,21 @@ config BR2_ROOTFS_SUFFIX

? ? ? help
? ? ? ? Add a custom string to the end of the root file system name.

target/Config.in +15 -0
+config BR2_ROOTFS_POST_BUILD_SCRIPT
+ ? ? string "Custom script to run before packing files"
+ ? ? default ""
+ ? ? help
+ ? ? ? Specify a script to be run after the build has finished and before
+ ? ? ? the BR2 starts packing the files into selected packages.
+
+ ? ? ? 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.
+

?comment "filesystem for target device"

Quoted 4 lines

?source "target/cramfs/Config.in"
--
1.6.3.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 4 lines
----
Regards
Paul Archer
ptarcher at gmail.com
#3 lore raw

PATCH 1/1 Add support for custom post-build script

In reply to Daniel Mack
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Hi,

Daniel> The config help text says it all: Specify a script to be run Daniel> after the build has finished and before the BR2 starts Daniel> packing the files into selected packages.

Daniel> This gives users the oportunity to do board-specific Daniel> cleanups, add-ons and the like, so the generated files can be Daniel> used directly without further processing.

Daniel> The script is called with the target directory name as first Daniel> and only argument. Make sure the exit code of that script is Daniel> 0, otherwise make will stop after calling it.

I have normally done this by simply running make twice - E.G. build the rootfs, fixup anything you need under project_build_*/*/root and run make again to regenerate the rootfs.

But ok, I can see the desire for such a script. I'll apply it now, thanks.

It would be good to have a note about it in the documentation - Could I get you to add a short note about it in docs/buildroot.html?

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 Add support for custom post-build script

Quoted 18 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Daniel> The config help text says it all: Specify a script to be run Daniel> after the build has finished and before the BR2 starts Daniel> packing the files into selected packages.

Daniel> This gives users the oportunity to do board-specific Daniel> cleanups, add-ons and the like, so the generated files can be Daniel> used directly without further processing.

Daniel> The script is called with the target directory name as first Daniel> and only argument. Make sure the exit code of that script is Daniel> 0, otherwise make will stop after calling it.

I have normally done this by simply running make twice - E.G. build the rootfs, fixup anything you need under project_build_*/*/root and run make again to regenerate the rootfs.

Quoted 5 lines

But ok, I can see the desire for such a script. I'll apply it now, thanks.

It would be good to have a note about it in the documentation - Could I get you to add a short note about it in docs/buildroot.html?

Sure, see below.

Thanks!

Daniel

#5 lore raw

PATCH 1/1 Add support for custom post-build script

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Hi,

Quoted 2 lines
Quoted 2 lines

It would be good to have a note about it in the documentation - Could I get you to add a short note about it in docs/buildroot.html?

Daniel> Sure, see below.

Thanks! One comment:

 Daniel> +      find that a certain package generates wrong or unneeded files, you
 Daniel> +      should rather fix than package than shipping your way around it
 Daniel> +      with a cleanup script.</p>

I think '.. than working around it with a cleanup script.' sounds a bit better - OK with you?

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 1/1 Add support for custom post-build script

Quoted 8 lines · Peter Korsgaard

Thanks! One comment:

 Daniel> +      find that a certain package generates wrong or unneeded files, you
 Daniel> +      should rather fix than package than shipping your way around it
 Daniel> +      with a cleanup script.</p>

I think '.. than working around it with a cleanup script.' sounds a bit better - OK with you?

Of course, go ahead :)

#7 lore raw

PATCH 1/1 Add support for custom post-build script

In reply to Daniel Mack
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

It would be good to have a note about it in the documentation - Could I get you to add a short note about it in docs/buildroot.html?

Daniel> Sure, see below.

Thanks, committed.

Signature · 1 line
Bye, Peter Korsgaard
#8 lore raw

PATCH 1/1 Add support for custom post-build script

In reply to Peter Korsgaard

Hi,

I'm engineer and would like to learn how i use buildroot and uclinux
together... I searched in google and a lot of media but i can't found... And you have problems in compile buildroot in x86_64 systems? In my slackware64 can't build this...

Thanks for any reply.

Eng. Marcelo Martins Maia do Couto
Engenheiro de Desenvolvimento
Coordenador de TI
Professor de Sistemas Operacionais/Redes/Hardware
E-mail: marcelo.m.maia at gmail.com
Site: www.marcelocouto.net
Skype: marcelo_m_maia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090727/31301ece/attachment.htm>