view common/README @ 40:ef471ef37665 draft default tip

Yank reliance on ash.
author Rob Landley <>
date Sat, 18 Jul 2015 01:39:24 -0500
parents bcd2e358d57f
line wrap: on
line source

Common infrastructure for natively building packages on target.

This contains a top level file run on the host to create a control image: - script run on host to create a control image.

And several files in the "mnt" subdirectory which are copied to the target:

  init - First script run in a control image.  Copies root filesystem into
         /home/chroot to get a writeable filesystem build can install more
         packages into, and --bind mounts other directories in as appropriate
         so the result actually works.  Chroots into the new filesystem
         and runs /mnt/  When chroot exits, cleans up
         bind mounts, tars up the result, and uploads it to the host via ftp. - reusable functions like set_titlebar and dotprogress. - Loop through /mnt/package-list calling
         /mnt/ on each entry, in order.  Stop at the first
         failed package.

         This script also maintains a manifest file listing installed packages,
         skipping already installed packages when re-run unless $FORCE is set.

         If $FILTER is set, skips listed packages (name|name|name).  Packages
         can be annotated with categories (in #comments at the end of each
         line) which $FILTER can also skip. - Build a single package listed on the command line.

         If /mnt/build/$NAME.nosrc exists, this runs it.  Otherwise, copy a
         symlink tree from /mnt/packages/$NAME to /home/$NAME (via "cp -s",
         first deleting any old /home/$NAME if it exists), then cd to
         the new directory and run /mnt/build/$  On success, delete
         /home/$NAME on the way out.

To use this infrastructure, create a new project subdirectory with
"", "", "mnt/package-list", and
"mnt/build/*", I.E.:

1) Create a new sources/control-images/MYPROJECT subdirectory.

2) Symlink the control image wrapper to in your new
   directory, ala:

     ln -s ../bootstrap-skeleton/

3) Create a script to fetch/extract/prepare your package source.

   The control image wrapper script calls this configured so that
   using the "download" function to grab packages from $URL (with $SHA1, using
   the normal cacheing infrastructure) will automatically extract each
   package into the "packages" subdirectory of the new control image.  The
   tarball will wind up in a subdirectory under the top level "packages"
   directory on the host.

   This script gets run at control image creation time, it is not copied to
   the target.  Remember to mark it executable.

4) Create a "mnt" subdirectory under your new proect subdirectory, containing
   additional files to be copied verbaim into the control image.  You will need
   at least:

   A) package-list - file listing packages to install, in order, one per line.

   B) build - directory containing $ and $PACKAGE.nosrc build scripts.

See the gentoo-boostrap and lfs-bootstrap directories for examples.