Support installation of local files through $CHROOT_INSTALL
authorMichael Prokop <mika@grml.org>
Sun, 16 Aug 2009 21:36:59 +0000 (23:36 +0200)
committerMichael Prokop <mika@grml.org>
Sun, 16 Aug 2009 21:46:12 +0000 (23:46 +0200)
debian/changelog
docs/grml-live.txt
etc/grml/grml-live.conf
grml-live

index 65c7211..4bd13c6 100644 (file)
@@ -35,6 +35,8 @@ grml-live (0.9.21) UNRELEASED; urgency=low
     executed with options '-q -B' and empty boot/isolinux works as well.
   * Introduce $NO_WINDOWS_BINARIES which replaces $WINDOWS_BINARIES so
     we can improve sanity checks and easify configuration.
     executed with options '-q -B' and empty boot/isolinux works as well.
   * Introduce $NO_WINDOWS_BINARIES which replaces $WINDOWS_BINARIES so
     we can improve sanity checks and easify configuration.
+  * Support installation of local files (not being part of any Debian package)
+    through $CHROOT_INSTALL.
   * Software related changes:
     - Add git-email to GRML_FULL (thanks to Joerg Woelke for mentioning).
     - Add aesfix, aeskeyfind, bios-memimage, chaosreader, ext3grep, fatback,
   * Software related changes:
     - Add git-email to GRML_FULL (thanks to Joerg Woelke for mentioning).
     - Add aesfix, aeskeyfind, bios-memimage, chaosreader, ext3grep, fatback,
@@ -51,7 +53,7 @@ grml-live (0.9.21) UNRELEASED; urgency=low
     isolinux.cfg, syslinux.cfg with each other; provide a fallback
     way to boot MirOS bsd4grml from both GRUB versions using modules
 
     isolinux.cfg, syslinux.cfg with each other; provide a fallback
     way to boot MirOS bsd4grml from both GRUB versions using modules
 
- -- Michael Prokop <mika@grml.org>  Sun, 16 Aug 2009 22:57:46 +0200
+ -- Michael Prokop <mika@grml.org>  Sun, 16 Aug 2009 23:36:14 +0200
 
 grml-live (0.9.20) unstable; urgency=low
 
 
 grml-live (0.9.20) unstable; urgency=low
 
index a04746d..f5bfbd4 100644 (file)
@@ -121,6 +121,12 @@ Display short usage information and exit.
 Specify name of ISO which will be available inside $OUTPUT_DIRECTORY/grml_isos
 by default.
 
 Specify name of ISO which will be available inside $OUTPUT_DIRECTORY/grml_isos
 by default.
 
+  -I **CHROOT_INSTALL**::
+
+Specify name of source directory which provides files that should become part of
+the chroot/ISO. Not enabled by default. Note: the files are installed under '/'
+in the chroot so you have to create the rootfs structure on your own.
+
   -o **OUTPUT_DIRECTORY**::
 
 Main output directory of the build process of FAI.  Some directories are created
   -o **OUTPUT_DIRECTORY**::
 
 Main output directory of the build process of FAI.  Some directories are created
@@ -593,6 +599,8 @@ Instructions
   # consider using lzma only for space reasons (resulting in longer
   # build time but smaller ISO):
   SQUASHFS_OPTIONS="-nolzma"
   # consider using lzma only for space reasons (resulting in longer
   # build time but smaller ISO):
   SQUASHFS_OPTIONS="-nolzma"
+  # install local files into the chroot
+  CHROOT_INSTALL="/etc/grml/fai/chroot_install"
   ## adjust if necessary (defaults to /grml/grml-live):
   ## OUTPUT="/srv/grml-live"
   FAI_DEBOOTSTRAP="squeeze http://ftp.de.debian.org/debian/"
   ## adjust if necessary (defaults to /grml/grml-live):
   ## OUTPUT="/srv/grml-live"
   FAI_DEBOOTSTRAP="squeeze http://ftp.de.debian.org/debian/"
@@ -654,6 +662,21 @@ If you need help with grml-live or would like to see new features as part of
 grml-live you can get commercial support via
 link:http://grml-solutions.com/[Grml Solutions].
 
 grml-live you can get commercial support via
 link:http://grml-solutions.com/[Grml Solutions].
 
+[[install-local-files]]
+How to I install further files into the chroot/ISO?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Just point the configuration variable CHROOT_INSTALL to the directory which
+provides the files you would like to install. Note that the files are installed
+under '/' in the chroot - so you have to create the rootfs structure on your
+own. Usage example:
+
+  echo "CHROOT_INSTALL=\$GRML_FAI_CONFIG/chroot_install" >> /etc/grml/grml-live.local
+  mkdir -p /etc/grml/fai/chroot_install/usr/src/
+  wget example.org/foo.tar.gz
+  mv foo.tar.gz /etc/grml/fai/chroot_install/usr/src/
+  grml-live ...
+
 [[local-debian-mirror]]
 Can I use my own (local) Debian mirror?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 [[local-debian-mirror]]
 Can I use my own (local) Debian mirror?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index c7c6ff8..e4af5c2 100644 (file)
 # Directory of configuration files for grml-live's FAI:
 # GRML_FAI_CONFIG=/etc/grml/fai
 
 # Directory of configuration files for grml-live's FAI:
 # GRML_FAI_CONFIG=/etc/grml/fai
 
+# Do you want to put any local files into the chroot?
+# If so then point CHROOT_INSTALL to a directory providing the files.
+# Note: the files are installed under '/' in the chroot -
+# so you have to create the rootfs structure on your own.
+# CHROOT_INSTALL="$GRML_FAI_CONFIG/chroot_install"
+
 # Do you want to pass any additional arguments to FAI?
 # FAI_ARGS=""
 
 # Do you want to pass any additional arguments to FAI?
 # FAI_ARGS=""
 
index a710bcf..9197b3e 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -47,6 +47,8 @@ Usage: $PN [options, see as follows]
    -g <grml_name>]         set the grml flavour name
    -h                      display short usage information and exit
    -i <iso_name>           name of ISO
    -g <grml_name>]         set the grml flavour name
    -h                      display short usage information and exit
    -i <iso_name>           name of ISO
+   -I <src_directory>      directory which provides files that should become
+                           part of the chroot/ISO
    -o <output_directory>   main output directory of the build process
    -q                      skip mksquashfs
    -r <release_name<       release name
    -o <output_directory>   main output directory of the build process
    -q                      skip mksquashfs
    -r <release_name<       release name
@@ -207,7 +209,7 @@ fi
 # }}}
 
 # command line parsing {{{
 # }}}
 
 # command line parsing {{{
-while getopts "a:C:c:g:i:o:r:s:t:v:bBFuqVz" opt; do
+while getopts "a:C:c:g:i:I:o:r:s:t:v:bBFuqVz" opt; do
   case "$opt" in
     a) ARCH="$OPTARG" ;;
     b) BUILD_ONLY=1 ;;
   case "$opt" in
     a) ARCH="$OPTARG" ;;
     b) BUILD_ONLY=1 ;;
@@ -216,6 +218,7 @@ while getopts "a:C:c:g:i:o:r:s:t:v:bBFuqVz" opt; do
     C) CONFIG="$OPTARG" ;;
     g) GRML_NAME="$OPTARG" ;;
     i) ISO_NAME="$OPTARG" ;;
     C) CONFIG="$OPTARG" ;;
     g) GRML_NAME="$OPTARG" ;;
     i) ISO_NAME="$OPTARG" ;;
+    I) CHROOT_INSTALL="$OPTARG" ;;
     o) OUTPUT="$OPTARG" ;;
     q) SKIP_MKSQUASHFS=1 ;;
     r) RELEASENAME="$OPTARG" ;;
     o) OUTPUT="$OPTARG" ;;
     q) SKIP_MKSQUASHFS=1 ;;
     r) RELEASENAME="$OPTARG" ;;
@@ -315,6 +318,7 @@ if [ -z "$FORCE" ] ; then
    [ -n "$ARCH" ]               && echo "  Architecture:      $ARCH"
    [ -n "$BOOT_METHOD" ]        && echo "  Boot method:       $BOOT_METHOD"
    [ -n "$TEMPLATE_DIRECTORY" ] && echo "  Template files:    $TEMPLATE_DIRECTORY"
    [ -n "$ARCH" ]               && echo "  Architecture:      $ARCH"
    [ -n "$BOOT_METHOD" ]        && echo "  Boot method:       $BOOT_METHOD"
    [ -n "$TEMPLATE_DIRECTORY" ] && echo "  Template files:    $TEMPLATE_DIRECTORY"
+   [ -n "$CHROOT_INSTALL" ]     && echo "  Install files from directory to chroot:  $CHROOT_INSTALL"
    [ -n "$FAI_ARGS" ]           && echo "  additional arguments for FAI: $FAI_ARGS"
    [ -n "$LOGFILE" ]            && echo "  Logging to file:   $LOGFILE"
    [ -n "$SQUASHFS_ZLIB" ]      && echo "  Using ZLIB (instead of LZMA) compression."
    [ -n "$FAI_ARGS" ]           && echo "  additional arguments for FAI: $FAI_ARGS"
    [ -n "$LOGFILE" ]            && echo "  Logging to file:   $LOGFILE"
    [ -n "$SQUASHFS_ZLIB" ]      && echo "  Using ZLIB (instead of LZMA) compression."
@@ -765,14 +769,25 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
       fi
    einfo "Finished execution of stage 'boot'" ; eend 0
    fi
       fi
    einfo "Finished execution of stage 'boot'" ; eend 0
    fi
-# ppc:
-elif [ "$ARCH" = powerpc ] ; then
-    ewarn 'Warning: formorer, it is your turn. :)'>&2
-# unsuported:
 else
 else
+   log 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!'
    eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1
 fi
 
    eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1
 fi
 
+# support installation of local files into the chroot/ISO
+if [ -n "$CHROOT_INSTALL" ] ; then
+  if ! [ -d "$CHROOT_INSTALL" ] ; then
+     log "Configuration variable \$CHROOT_INSTALL is set but not a directory; ignoring"
+     ewarn "Configuration variable \$CHROOT_INSTALL is set but not a directory; ignoring"
+  else
+     log "Copying local files to chroot as requested via \$CHROOT_INSTALL"
+     einfo "Copying local files to chroot as requested via \$CHROOT_INSTALL"
+     rsync -avz --inplace "$CHROOT_INSTALL"/ "$CHROOT_OUTPUT/"
+     eend $?
+     einfo "Make sure to run squashfs stage, otherwise your local files won't be part of the ISO."
+  fi
+fi
+
 if [ -f "$BUILD_OUTPUT"/live/${GRML_NAME}.squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then
    log "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'"
    ewarn "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ; eend 0
 if [ -f "$BUILD_OUTPUT"/live/${GRML_NAME}.squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then
    log "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'"
    ewarn "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ; eend 0