changeset 1297:171fed38f126

Documentation on how to use the bootstrap-skeleton infrastructure.
author Rob Landley <rob@landley.net>
date Sun, 21 Nov 2010 19:45:47 -0600
parents fe5af321ed29
children d5f698cc8a10
files sources/control-images/bootstrap-skeleton/README
diffstat 1 files changed, 68 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/README	Sun Nov 21 19:45:47 2010 -0600
@@ -0,0 +1,68 @@
+Common infrastructure for natively building packages on target.
+
+This contains a top level file run on the host to create a control image:
+
+  control-image-wrapper.sh - 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/run-build-stages.sh.  When chroot exits, cleans up
+         bind mounts, tars up the result, and uploads it to the host via ftp.
+
+  functions.sh - reusable functions like set_titlebar and dotprogress.
+
+  run-build-stages.sh - Loop through /mnt/package-list calling
+         /mnt/build-one-package.sh 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-one-package.sh - 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/$NAME.sh.  On success, delete
+         /home/$NAME on the way out.
+
+To use this infrastructure, create a new project subdirectory with
+"make-control-image.sh", "download.sh", "mnt/package-list", and
+"mnt/build/*", I.E.:
+
+1) Create a new sources/control-images/MYPROJECT subdirectory.
+
+2) Symlink the control image wrapper to make-control-image.sh in your new
+   directory, ala:
+
+     ln -s ../bootstrap-skeleton/control-image-wrapper.sh make-control-image.sh
+
+3) Create a download.sh script to fetch/extract/prepare your package source.
+
+   The control image wrapper script calls this download.sh 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 $PACKAGE.sh and $PACKAGE.nosrc build scripts.
+
+See the gentoo-boostrap and lfs-bootstrap directories for examples.