Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [Feature Request] script to run after build completion
Date: Sat, 19 Jan 2013 11:54:37 +0100	[thread overview]
Message-ID: <50FA7B6D.9040504@mind.be> (raw)
In-Reply-To: <50F6DE49.4000600@relinux.de>

On 16/01/13 18:07, Stephan Hoffmann wrote:
> Hello all,
>
> I am picking up a feature request from 2011, because I am currently in a
> situation where I could use the proposed feature.
>
> Alper Y?ld?r?m wrote on 8 Jun 2011 22:40
>> Hello,
>>
>> A feature i want to see in buildroot is to have a post build script to
>> run after image creation process, in other words just before "make"
>> returns to console. This way i can put my post build commands inside
>> this script. It will definitely ease my buildroot usage.
>>
>> Some examples to put in this script are:
>>
>> - Printing some king of a "build completed" message,
>> - Printing build time,
>> - Nfs directory creation from rootfs.tar file,
>> - Copying necessary images to some other locations,
> - any other kind of project/board specific post processing
>> - Playing some sound when build is completed.
>>
>> Also, it will be nice to pass a build failed/completed parameter to
>> this script, so different actions could be taken, (i.e. different
>> sounds could be played)
> I would rather think of a hook that only gets called after successful
> image completion.

  I think this very much falls into the category of featuritis.

  In many situations, you'll want a script around 'make' to automate 
things beyond what buildroot does. As long as this script only does 
things _before_ and _after_ the 'make' invocation, there is no need for a 
change in buildroot infrastructure. And these top-level scripts are so 
different from project to project that it doesn't make sense to include 
them in buildroot either.

  For example, here's a script that will automatically take a defconfig 
and copy the images to the target:

#! /bin/sh
# Wrapper around make

# We allow running from a foreign directory
topdir="$(dirname $0)"
[ "$topdir" = . ] && output="output/" || outdir="O=$PWD"
MAKE="make -C $topdir $outdir"

if [ ! -e .config ]; then
   $MAKE project_defconfig
fi

echo $MAKE "$@"
$MAKE "$@" || exit $?

imgfiles="${output}images/bzImage ${output}images/rootfs.cpio.bz2"

# Terminate if image files were not generated
for f in $imgfiles; do
    [ -r "$f" ] || exit 1
done

if [ "$TARGET_IP" ]; then
   scp $imgfiles root@$TARGET_IP:/mnt/boot
   ssh root@$TARGET_IP /sbin/reboot
fi


  There is really no need to change buildroot to support this kind of thing.

  Regards,
  Arnout


[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2013-01-19 10:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 17:07 [Buildroot] [Feature Request] script to run after build completion Stephan Hoffmann
2013-01-19 10:54 ` Arnout Vandecappelle [this message]
2013-01-21  5:27   ` Jérôme Pouiller
2013-01-24  6:26     ` Arnout Vandecappelle
  -- strict thread matches above, loose matches on Subject: below --
2011-06-08 20:40 Alper Yıldırım
2011-06-08 22:30 ` Steve Calfee
2011-06-09 11:23   ` Bjørn Forsman
2011-06-09 15:55     ` Steve Calfee
2011-06-09 11:21 ` Bjørn Forsman
2011-06-09 19:35   ` Alper Yıldırım

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FA7B6D.9040504@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox