[Buildroot] [PATCH] Add support for custom post-build script

Daniel Mack daniel at caiaq.de
Mon Jul 27 11:58:38 UTC 2009


On Sat, Jul 25, 2009 at 11:14:57PM +0200, Peter Korsgaard wrote:
> >>>>> "Daniel" == Daniel Mack <daniel at caiaq.de> writes:
> 
>  Daniel> The config help text says it all: Specify a script to be run
>  Daniel> after the build has finished and before the BR2 starts
>  Daniel> packing the files into selected packages.
> 
>  Daniel> This gives users the oportunity to do board-specific
>  Daniel> cleanups, add-ons and the like, so the generated files can be
>  Daniel> used directly without further processing.
> 
>  Daniel> The script is called with the target directory name as first
>  Daniel> and only argument. Make sure the exit code of that script is
>  Daniel> 0, otherwise make will stop after calling it.
> 
> I have normally done this by simply running make twice - E.G. build
> the rootfs, fixup anything you need under project_build_*/*/root and
> run make again to regenerate the rootfs.
> 
> But ok, I can see the desire for such a script. I'll apply it now,
> thanks.
> 
> It would be good to have a note about it in the documentation - Could
> I get you to add a short note about it in docs/buildroot.html?

Sure, see below.

Thanks!

Daniel

>From 7408709453878326dba5fdcf641e0e938482ea03 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel at caiaq.de>
Date: Mon, 27 Jul 2009 13:54:31 +0200
Subject: [PATCH] docs: describe BR2_ROOTFS_POST_BUILD_SCRIPT

Signed-off-by: Daniel Mack <daniel at caiaq.de>
---
 docs/buildroot.html |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/docs/buildroot.html b/docs/buildroot.html
index e97d601..419275a 100644
--- a/docs/buildroot.html
+++ b/docs/buildroot.html
@@ -37,6 +37,7 @@
       <li><a href="#external_toolchain">Use an external toolchain</a></li>
       <li><a href="#downloaded_packages">Location of downloaded packages</a>
       </li>
+      <li><a href="#adapting_rootfs">Adapting the rootfs for own binaries</a></li>
       <li><a href="#add_software">Extending Buildroot with more
       Software</a></li>
       <li><a href="#links">Resources</a></li>
@@ -877,6 +878,22 @@ It allows to generate toolchains based on <i>uClibc</i>, <i>glibc</i>
 and <i>eglibc</i> for a wide range of architectures, and has good
 community support.</p>
 
+      <h2><a name="adapting_rootfs" id="adapting_rootfs">Adapting the rootfs
+      for own binaries</h2>
+
+      <p>When using BR2 in an environment where own software binaries or
+      static data should be part of the generated rootfs package, the
+      <code>BR2_ROOTFS_POST_BUILD_SCRIPT</code> feature might interest
+      you. You can specify a command here which is called <i>after</i> BR2
+      built all the selected software, but <i>before</i> the the rootfs
+      packages are assembled. The destination rootfs folder is given as
+      first argument. You can add own components here, change
+      default configurations and remove unwanted files.</p>
+      <p>You should, however, use that feature with care. Whenever you
+      find that a certain package generates wrong or unneeded files, you
+      should rather fix than package than shipping your way around it
+      with a cleanup script.</p>
+
     <h2><a name="add_software" id="add_software"></a>Extending Buildroot with
     more software</h2>
 
-- 
1.6.3.1



More information about the buildroot mailing list