Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] Adding my applications to the image generated
Date: Tue, 9 Oct 2012 14:36:42 +0000 (UTC)	[thread overview]
Message-ID: <k51cpp$cnh$2@ger.gmane.org> (raw)
In-Reply-To: C008AB77AF9902469191C92183A1C6128B56E20A40@AUSP01VMBX13.collaborationhost.net

On 2012-10-09, Chris Westervelt <chris.westervelt@advantor.com> wrote:

> I'm new to build root but a long time LTIB user.  In LTIB, we had a
> way to 'merge' our custom files to the final build by putting them in
> a merge directory that replicated the directory hierarchy with the
> files in each level of the tree.  Is there a way to do this in
> Buildroot?

There are several ways to do it:

http://buildroot.uclibc.org/downloads/manual/manual.html#_customizing_the_generated_target_filesystem

Using the "customize" package is depricated, and I think will be
eliminated in the near future.  It sounds to me like you probably want
to define a post-build script that merges your custom files files into
the target tree after it's been built.

I've placed a tree of files to be merged in "../custom-files" and the
post-build script copies them into the target directory.  My
post-build script shown below.  The line the does the merging of my
custom files is the 'tar' command.  The rest of the script tweaks some
of the pre-existing files.

Once you've written a post-build script, you need to set the the 
BR2_ROOTFS_POST_BUILD_SCRIPT configuration variable to point to it:

In my .config file:

BR2_ROOTFS_POST_BUILD_SCRIPT="../postbuild.sh"



------------------------------postbuild.sh------------------------------
#/bin/bash

echo ">>>   Post-build script start"
TARGET="$1"
set -x

# modify snmpd init script so that it listens on all interfaces rather
# than only on 127.0.0.1
sed -i '/^SNMPDOPTS/ s/ *127\.0\.0\.1//g' $TARGET/etc/init.d/S*snmpd

# copy custom-files
tar -c -f - -C ../custom-files --exclude-vcs --exclude-backup . | \
          tar -v -x -f - -C "$TARGET"

# set some global env variables by exporting them in rcS
sed -i -e '/^export PATH=/ d'                    $TARGET/etc/init.d/rcS
sed -i -e '/^export LD_LIBRARY_PATH=/ d'         $TARGET/etc/init.d/rcS
sed -i -e '2 iexport PATH=$PATH:/apps/bin'       $TARGET/etc/init.d/rcS
sed -i -e '2 iexport LD_LIBRARY_PATH=/apps/lib'  $TARGET/etc/init.d/rcS

# tweak PHP settings
sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 10M/g' $TARGET/etc/php.ini

# make sure ssh keys aren't readable by anybody except owner
chmod go-rwx $TARGET/etc/ssh_*_key

set +x
echo ">>>   Post-build script done"
------------------------------------------------------------------------


-- 
Grant Edwards               grant.b.edwards        Yow! I want a VEGETARIAN
                                  at               BURRITO to go ... with
                              gmail.com            EXTRA MSG!!

  reply	other threads:[~2012-10-09 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 14:09 [Buildroot] Adding my applications to the image generated Chris Westervelt
2012-10-09 14:36 ` Grant Edwards [this message]
2012-10-09 15:08   ` Chris Westervelt

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='k51cpp$cnh$2@ger.gmane.org' \
    --to=grant.b.edwards@gmail.com \
    --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