Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Add support for custom post-build script
@ 2009-07-08 20:46 Daniel Mack
  2009-07-15  9:21 ` Daniel Mack
  2009-07-25 21:14 ` Peter Korsgaard
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel Mack @ 2009-07-08 20:46 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sven Neumann <s.neumann@raumfeld.com>
---
 Makefile         |    4 ++++
 target/Config.in |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 76dd2cd..dbeede5 100644
--- a/Makefile
+++ b/Makefile
@@ -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)))
diff --git a/target/Config.in b/target/Config.in
index 87abbe6..dbdc2d6 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -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"
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] Add support for custom post-build script
@ 2009-07-10 16:26 nfrench at xtale.biz
  2009-07-10 18:43 ` Daniel Mack
  0 siblings, 1 reply; 13+ messages in thread
From: nfrench at xtale.biz @ 2009-07-10 16:26 UTC (permalink / raw)
  To: buildroot




I am currently building my app using the tools in staging_dir to
build my app then I mount the built ext2 from binaries cp my program on
and build a new ext2

Is there a standard why to do this .ie
this custom post-build

would it be possible to document how to
add a simple Hello World app.? So that it gets built? with
buildroot or have I missed somthing in the docs.

Thanks

Nick


> 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.
> 
> Signed-off-by: Daniel Mack
<daniel@caiaq.de>
> Cc: Sven Neumann
<s.neumann@raumfeld.com>
> ---
>  Makefile         |
   4 ++++
>  target/Config.in |   15 +++++++++++++++
>  2
files changed, 19 insertions(+), 0 deletions(-)
> 
> diff
--git a/Makefile b/Makefile
> index 76dd2cd..dbeede5 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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)))
> diff --git a/target/Config.in b/target/Config.in
> index
87abbe6..dbdc2d6 100644
> --- a/target/Config.in
> +++
b/target/Config.in
> @@ -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"
> --
> 1.6.3.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
>
http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090710/2de3d73b/attachment.htm>

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] Add support for custom post-build script
@ 2009-07-11 19:34 nfrench at xtale.biz
  2009-07-13  3:14 ` Paul Archer
  0 siblings, 1 reply; 13+ messages in thread
From: nfrench at xtale.biz @ 2009-07-11 19:34 UTC (permalink / raw)
  To: buildroot



Thanks Daniel

It would be nice to have a proto type package aka
hello world for us first timers. As for me being able to build for two
different platforms 32bit / 64bit is great feature of buildroot. At the
moment we have been using lfs for 32 bit and 64 bit. Does a package have
to have a network location for download as my prototype code / initial
program ideas go through many revisions before they even get to that stage
:-).

Nick

> On Fri, Jul 10, 2009 at 04:26:39PM
-0000, nfrench at xtale.biz wrote:
>> I am currently building my
app using the tools in staging_dir to
>> build my app then I
mount the built ext2 from binaries cp my program on
>> and
build a new ext2
> 
> This is exactly what I want to
avoid. I know it is possible, but using
> the post-build script
method is faster, more logic and more straight
> forward.
> 
>> Is there a standard why to do this .ie
>>
this custom post-build
> 
> Well, it's up to you what you
do with that script. You'll be fed with
> the target rootfs as $1
and could then do something like
> 
> 	cp
/path/to/your/hello $1/usr/bin/
> 
> Or remove unwanted
files etc. Up to you.
> 
>> would it be possible to
document how to
>> add a simple Hello World app.? So that
it gets built? with
>> buildroot or have I missed somthing
in the docs.
> 
> No, don't confuse that. Your application
will not be built by buildroot
> by the post-build script.
> 
> If you want to do that, you need to add your own
package. See the
> package/ folder how others do that. And if that
package is building a
> publically available project, please
consider sending a patch back to
> this list so everybody can
benefit from it.
> 
> Daniel
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090711/8f5f01e8/attachment.htm>

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

end of thread, other threads:[~2009-07-27 12:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-08 20:46 [Buildroot] [PATCH] Add support for custom post-build script Daniel Mack
2009-07-15  9:21 ` Daniel Mack
2009-07-16  4:14   ` Paul Archer
2009-07-25 21:14 ` Peter Korsgaard
2009-07-27 11:58   ` Daniel Mack
2009-07-27 12:17     ` Peter Korsgaard
2009-07-27 12:38       ` Daniel Mack
2009-07-27 12:48     ` Peter Korsgaard
2009-07-27 12:26   ` Marcelo Martins Maia do Couto
  -- strict thread matches above, loose matches on Subject: below --
2009-07-10 16:26 nfrench at xtale.biz
2009-07-10 18:43 ` Daniel Mack
2009-07-11 19:34 nfrench at xtale.biz
2009-07-13  3:14 ` Paul Archer

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