Skip to contentSkip to conversation

Add support for custom post-build script

PATCH New nfrench at xtale.biz 2 participants 2 messages Jul 10, 2009

lore
Share & tools
lore
#0 lore raw

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

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

Quoted 3 lines

The config help text says it all:

Specify a script to be run after the build has

finished and before

Quoted 1 line

the BR2 starts packing the files into

selected packages.

Quoted 2 lines

This gives users the oportunity

to do board-specific cleanups,

Quoted 1 line

add-ons and the like, so the

generated files can be used directly

Quoted 1 line

without further

processing.

Quoted 2 lines

The script is called with the target

directory name as first and

Quoted 1 line

only argument. Make sure the exit

code of that script is 0,

Quoted 1 line

otherwise make will stop after

calling it.

Quoted 2 lines
Signed-off-by Daniel Mack

<[email protected]>

Quoted 1 line
Cc Sven Neumann

<[email protected]>

Quoted 2 lines

---
Makefile |

4 ++++

Quoted 2 lines
 target/Config.in |   15 +++++++++++++++

2

files changed, 19 insertions(+), 0 deletions(-)

Quoted 2 lines

diff

--git a/Makefile b/Makefile

Quoted 4 lines

index 76dd2cd..dbeede5 100644

Makefile +0 -0

@@ -360,6 +360,10

@@ endif

Quoted 1 line

find $(TARGET_DIR) -type f -perm +111 | xargs

$(STRIPCMD) 2>/dev/null ||

Quoted 2 lines

true

	$(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
Quoted 2 lines

+ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")

Quoted 1 line

+ $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)

Quoted 2 lines

+endif

+

Quoted 2 lines

ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)

LOCALE_WHITELIST=$(PROJECT_BUILD_DIR)/locales.nopurge

Quoted 1 line

LOCALE_NOPURGE=$(strip $(subst ",,$(BR2_ENABLE_LOCALE_WHITELIST)))

Quoted 2 lines
target/Config.in +0 -0

index

87abbe6..dbdc2d6 100644

Quoted 2 lines

--- a/target/Config.in
+++

b/target/Config.in

target/Config.in config

Quoted 1 line
target/Config.in +0 -0
@@ -12,6 +12,21 @@ config

BR2_ROOTFS_SUFFIX

target/Config.in config · line 13

Quoted 2 lines
target/Config.in +0 -0
 	help
 	  Add a custom string to

the end of the root file system name.

target/Config.in config · line 14

Quoted 2 lines
target/Config.in +1 -0
+config

BR2_ROOTFS_POST_BUILD_SCRIPT

target/Config.in config · line 15

Quoted 1 line
target/Config.in +1 -0
+	string "Custom script to run

before packing files"

target/Config.in config · line 17

Quoted 2 lines
target/Config.in +1 -0
+	default ""
 

+ help

target/Config.in config · line 18

Quoted 1 line
target/Config.in +1 -0
+	  Specify a script to be run after the build has

finished and before

target/Config.in config · line 19

Quoted 1 line
target/Config.in +1 -0
+	  the BR2 starts packing the files into

selected packages.

target/Config.in config · line 21

Quoted 2 lines
target/Config.in +2 -0
+
+	  This gives users the

oportunity to do board-specific cleanups,

target/Config.in config · line 22

Quoted 1 line
target/Config.in +1 -0
+	  add-ons and the

like, so the generated files can be used directly

target/Config.in config · line 23

Quoted 1 line
target/Config.in +1 -0
+	  without

further processing.

target/Config.in config · line 25

Quoted 2 lines
target/Config.in +2 -0
+
+	  The script is called with

the target directory name as first and

target/Config.in config · line 26

Quoted 1 line
target/Config.in +1 -0
+	  only argument. Make

sure the exit code of that script is 0,

target/Config.in config · line 27

Quoted 1 line
target/Config.in +1 -0
+	  otherwise make will

stop after calling it.

target/Config.in config · line 29

Quoted 2 lines
target/Config.in +1 -0
+
 comment "filesystem for

target device"

target/Config.in config · line 30

Quoted 2 lines
target/Config.in +0 -0
 source

"target/cramfs/Config.in"

Quoted 7 lines
target/Config.in +0 -1
--

1.6.3.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net

http://lists.busybox.net/mailman/listinfo/buildroot

Quoted 1 line

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090710/2de3d73b/attachment.htm>

#1 lore raw

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

Quoted 3 lines · nfrench at xtale.biz

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.

Quoted 2 lines

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.

Quoted 3 lines

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