Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Where does post-build script belong?
Date: Tue, 28 Feb 2012 22:18:32 +0000	[thread overview]
Message-ID: <201202282218.32706.arnout@mind.be> (raw)
In-Reply-To: <jijhcf$a6d$1@dough.gmane.org>

On Tuesday 28 February 2012 21:36:15 Grant Edwards wrote:
> On 2012-02-28, Steve Calfee <stevecalfee@gmail.com> wrote:
> > On 02/28/2012 01:06 PM, Grant Edwards wrote:
> >> On 2012-02-28, Arnout Vandecappelle<arnout@mind.be>  wrote:
> >>> On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
> >>> [snip]
> >>>> I don't want to replace the default skeleton.  I want to add some
> >>>> files to it, and possible modify a few.  The documentation describes
> >>>> two ways to do that:
> >>>>
> >>>>    1) package/customize
> >>>>
> >>>>    2) post-build script
> >>>>
> >>>> I'm told 1) is now depricated, so I'm switching to 2).
> >>>>
> >>>> Where under board/mycompany/myproduct do you put "extra" files that
> >>>> will be added to the standard skeleton?
> >>> I put it in board/mycompany/myproduct/skeleton.  Although
> >>> rootfs-additions would be a better name than skeleton.
> >> Ah, perhaps I've misunderstood what a custom skeleton was for the past
> >> several years.  I thought it was the basis for the filesystem.  Is the
> >> custom skeleton something that's _added_ on top of the default
> >> skeleton rather than used in place of it?
> >>
> > Perhaps, but it is your script. If you want to completely replace the 
> > existing skeleton you can, but I think it makes more sense to just 
> > overlay new stuff on top of the default skeleton.
> 
> I seem to be completely lost.  Is board/mycompany/myproduct/skeleton
> above a post-build script or a custom skelecton (something you set
> BR2_ROOTFS_SKELETON_CUSTOM_PATH to point to)?

 The BR2_ROOTFS_SKELETON_CUSTOM_PATH is a real skeleton: it is copied to
the target fs before anything else is done.  It's called a skeleton
because it's mostly empty directories (/proc, /sys, /mnt, /usr/bin, ...).
There are a few files in /etc/ and /root as well.

 If you copy board/mycompany/myproduct/skeleton to the target in the
post-build script, that will go over everything else, because the
post-build script runs at the end.  That's why I say it should be
called rootfs-additions: it's added to the rootfs, it isn't the skeleton
of the rootfs.

 The post-build script (BR2_ROOTFS_POST_BUILD_SCRIPT) is just a script;
you have to add the command to copy it yourself.  For one customer,
for instance, I have:

BR2_ROOTFS_POST_BUILD_SCRIPT=board/mycompany/myproduct/cp-skeleton.sh

where cp-skeleton.sh contains:

dir="$(dirname $0)"/skeleton

if [ -d "$dir" ]; then
        rsync --exclude .svn --exclude '*~' -a "$dir"/* "$1"
fi

(indeed, this customer is using subversion :-)


 Ideally there should be a BR2_ROOTFS_ADDITIONS config option that does
exactly that, but I haven't gotten around to implementing it yet.


 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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

      parent reply	other threads:[~2012-02-28 22:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 20:41 [Buildroot] Where does post-build script belong? Grant Edwards
2012-02-20 21:00 ` J.C. Woltz
2012-02-20 21:45   ` Grant Edwards
2012-02-21  8:44     ` Luca Ceresoli
2012-02-21 14:54       ` Grant Edwards
2012-02-28 20:38         ` Arnout Vandecappelle
2012-02-28 21:06           ` Grant Edwards
2012-02-28 21:29             ` Steve Calfee
2012-02-28 21:36               ` Grant Edwards
2012-02-28 22:06                 ` Steve Calfee
2012-02-28 22:18                   ` Grant Edwards
2012-03-16 21:30                     ` Peter Korsgaard
2012-02-28 22:19                   ` Arnout Vandecappelle
2012-02-29  7:41                     ` Thomas De Schampheleire
2012-03-16 21:32                       ` Peter Korsgaard
2012-02-28 22:18                 ` Arnout Vandecappelle [this message]

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=201202282218.32706.arnout@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