Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] RFC: add check for post-build script existence?
@ 2013-01-31  4:09 Danomi Manchego
  2013-01-31  9:13 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Danomi Manchego @ 2013-01-31  4:09 UTC (permalink / raw)
  To: buildroot

Hi,

I am on a project where the same buildroot defconfig is being used for
multiple boards (LSI vendor's EVM, our custom board rev 1, rev 2,
...), where the few changes can be taken care of by a post-build fixup
script on just one or two scenarios.  I was thinking that I would set
BR2_ROOTFS_POST_BUILD_SCRIPT to something like
${BOARD_NAME}-fixups.sh, rather than maintain parallel nearly
identical defconfigs.  But since the port-build script list processing
doesn't check for file existence, this would force me to have a file
for each of my boards, rather than having fixup files only for the
scenarios which actually need it.

Would there be interest in adding a -e test before invoking the
script, similar to the -d test before the target skeleton copy?
Something like:

	@$(call MESSAGE,"Executing post-build script\(s\)")
	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
		if [ -e $(s) ]; then $(s) $(TARGET_DIR); fi$(sep))

If there is positive feedback, then I'll send in a patch.

Danomi -

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

* [Buildroot] RFC: add check for post-build script existence?
  2013-01-31  4:09 [Buildroot] RFC: add check for post-build script existence? Danomi Manchego
@ 2013-01-31  9:13 ` Thomas Petazzoni
  2013-02-01  1:37   ` Danomi Manchego
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2013-01-31  9:13 UTC (permalink / raw)
  To: buildroot

Dear Danomi Manchego,

On Wed, 30 Jan 2013 23:09:12 -0500, Danomi Manchego wrote:

> Would there be interest in adding a -e test before invoking the
> script, similar to the -d test before the target skeleton copy?
> Something like:
> 
> 	@$(call MESSAGE,"Executing post-build script\(s\)")
> 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> 		if [ -e $(s) ]; then $(s) $(TARGET_DIR); fi$(sep))
> 
> If there is positive feedback, then I'll send in a patch.

I am not sure I like that because it means that if an user makes a
small mistake in the post-build script name/path, it will be silently
ignored by Buildroot. I'd prefer if Buildroot would fail loudly if it
is given a post-build script that doesn't exist/isn't executable, or
any other problem that prevents the script from being executed.

I'm not sure where you're getting ${BOARD_NAME} from, but why don't you
handle the board differences in the script itself?

Like:

BR2_ROOTFS_POST_BUILD_SCRIPT=board/<company>/<project>/post-build.sh

and post-build.sh:

====
#!/bin/sh
if test -e ${BOARD_NAME}-fixups.sh; then
	sh ${BOARD_NAME}-fixups.sh
fi
====

No? :-)

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] 3+ messages in thread

* [Buildroot] RFC: add check for post-build script existence?
  2013-01-31  9:13 ` Thomas Petazzoni
@ 2013-02-01  1:37   ` Danomi Manchego
  0 siblings, 0 replies; 3+ messages in thread
From: Danomi Manchego @ 2013-02-01  1:37 UTC (permalink / raw)
  To: buildroot

Thomas,

> I'm not sure where you're getting ${BOARD_NAME} from, but why don't you
> handle the board differences in the script itself?

I forgot all about adding an "export" before the makefile variable
could also get passed to the bash script itself.  (To be honest, I
only recently learned that there actually *was* a makefile export
command.)  That's good enough for me.

Thanks for the prompt response and good advice.

Danomi -

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

end of thread, other threads:[~2013-02-01  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31  4:09 [Buildroot] RFC: add check for post-build script existence? Danomi Manchego
2013-01-31  9:13 ` Thomas Petazzoni
2013-02-01  1:37   ` Danomi Manchego

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