Initial support for grml_cd stuff
authorgrml User <repos@grml.org.invalid>
Sat, 15 Sep 2007 18:58:23 +0000 (20:58 +0200)
committergrml User <repos@grml.org.invalid>
Sat, 15 Sep 2007 18:58:23 +0000 (20:58 +0200)
debian/control
debian/rules
docs/grml-live.txt
etc/grml/grml-live.conf
grml-live

index f61bf73..8536777 100644 (file)
@@ -10,7 +10,7 @@ XS-Vcs-Browser: http://hg.grml.org/grml-live/
 
 Package: grml-live
 Architecture: all
-Depends: fai-client, fai-server
+Depends: fai-client, fai-server, syslinux [i386], memtest86+ [i386]
 Suggests: fai-doc
 Description: build system for creating a grml (based) live-cd
  This package provides the build system for creating
index 290e4f4..86fc4ff 100755 (executable)
@@ -30,10 +30,13 @@ install: build
        dh_testdir
        dh_testroot
        dh_clean -k 
-       dh_installdirs etc/grml/fai/live-initramfs usr/sbin
+       dh_installdirs etc/grml/fai/live-initramfs usr/sbin usr/share/doc/grml-live \
+                      usr/share/grml-live
 
        # Add here commands to install the package into debian/grml-live.
        cp -a etc debian/grml-live/
+       cp -a examples debian/grml-live/usr/share/doc/grml-live/
+       cp -a x86_files debian/grml-live/usr/share/grml-live/
        install -o root -m 755 grml-live debian/grml-live/usr/sbin/grml-live
 
 # Build architecture-independent files here.
index 41046d3..003589c 100644 (file)
@@ -3,42 +3,80 @@ grml-live(8)
 
 Name
 ----
-grml-live - generate a grml (based) live-cd
+grml-live - build process script for generating a (grml based) Linux Live-ISO
 
 Synopsis
 --------
-grml-live [ todo...]
+grml-live [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help]
 
 *******************************************************************************
-Important! grml-live is under heavy construction and everything but ready yet.
+Important! grml-live is under heavy construction, your feedback is highly
+appreciated.  This document is growing as requested. If you have questions which
+aren't answered by this document yet please let me (mika@grml.org) know!
 *******************************************************************************
 
-Introduction
-------------
+Description
+-----------
 
-grml-live provides the build system for creating a grml (based) live-cd.  The
+grml-live provides the build system for creating (a grml based) live-cd. The
 build system is based on link:http://www.informatik.uni-koeln.de/fai/[FAI]
-(Fully Automatic Installation). If you are familiar with FAI already it is very
-easy to get a live-cd, if you don't know FAI yet don't despair: it's still very
-easy. :)
+(Fully Automatic Installation).
 
 FAI uses a class based system. This gives you the flexibility to choose the
-packages you would like to include on your very own live-cd without having to
-deal with all the details in the core of the system.
+packages you would like to include on your very own Linux live-cd without having
+to deal with all the details of a build process.
 
+CAUTION: grml-live does not use /etc/fai for configuration but instead provides
+and uses /etc/grml/fai. This ensures that it does not clash with default FAI
+configuration and packages, so you can use grml-live and FAI completely
+independent!
+
+[NOTE]
 Please notice that you should have a fast network connection as all the Debian
 packages will be installed via network. If you want to use a local mirror
-checkout
-link:http://www.informatik.uni-koeln.de/fai/download/mkdebmirror[mkdebmirror]
-and debmirror.
+(strongly recommended!) checkout
+mkdebmirror (see /usr/share/doc/grml-live/examples/mkdebmirror)
+debmirro(1) and reprepro(1) (check out
+/usr/share/doc/grml-live/examples/reprepro/ for a sample configuration).
+To avoid downloading of the base system check out FAI's
+NFSROOT (check docs for ../fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz).
+
+Options
+-------
+
+  -c **CLASSES**::
+
+Specify the CLASSES to be used for building the ISO via fai.
+By default only the class GRML is assumed, resulting in a small base system (being
+about ~170MB ISO size).
+
+  -t **TARGET_DIRECTORY**::
+
+Output directory of the build process of FAI - being the chroot
+used for building the ISO.
+
+  -F::
+
+Force execution and do not display summary of configuration details.
+
+  -h|--help::
+
+Display short usage information and exit.
+
+  additional_arguments_for_fai::
+
+Any additional argument(s) to grml-live will be given to the FAI commandline
+(being basically "fai dirinstall ...).  This might become a temporary solution
+(due to security reasons), if you need an option please let us know so we can
+implement it.
 
 How to get your own live-cd - the easy, fast and simple way
 -----------------------------------------------------------
 
 To get a small, Debian-stable and grml based live-cd:
 
-  # TARGET="/grml/chroot/grml_uncompressed"
-  # CDDIR="/grml/chroot/grml_cd"
+  # TARGET="/grml/grml_uncompressed"
+  # CDDIR="/grml/grml_cd"
   # grml-live -c GRML -t $TARGET
   # mksquashfs $TARGET/* $CDDIR/live/grml.squashfs -noappend
   # cd $CDDIR
@@ -46,8 +84,38 @@ To get a small, Debian-stable and grml based live-cd:
             -boot-info-table -c boot/isolinux/boot.cat \
             -b boot/isolinux/isolinux.bin -o /grml/grml.iso .
 
-(TODO: provide the contenct of /grml/chroot/grml_cd through the package
-grml-live, in the meanwhil get the content from a current grml-ISO)
+(TODO: provide the content of /grml/chroot/grml_cd through the package
+grml-live, in the meanwhile get the content from a current grml-ISO)
+
+The class concept
+-----------------
+
+grml-live uses FAI and its class based concept for adjusting configuration
+according to your needs. This gives you flexibility and strength without losing
+the simplicity in the build process.
+
+The main and base class provided by grml-live is named GRML. It's strongly
+recommended to **always** use the class GRML when building an ISO using
+grml-live.  The following files and directories are relevant for class GRML by
+default:
+
+  /etc/grml/fai/config/scripts/GRML/
+  /etc/grml/fai/config/debconf/GRML
+  /etc/grml/fai/config/class/GRML.var
+  /etc/grml/fai/config/hooks/instsoft.GRML
+  /etc/grml/fai/config/package_config/GRML
+
+Take a look at the next section for information about the concept of those
+files/directories.
+
+If you want to use your own configuration, extend an existing configuration
+and/or add additional packages to your ISO just invent a new class. For example
+if you want to use your own class named "FOOBAR" just extend CLASSES="GRML" inside
+/etc/grml/grml-live.conf to CLASSES="GRML,FOOBAR" or invoke grml-live using
+the classes option: "grml-live -c GRML,FOOBAR ...".
+
+More details regarding the class concept can be found in the documentation of
+FAI (available at /usr/share/doc/fai-doc/).
 
 Files
 -----
@@ -127,17 +195,32 @@ Scripts for customising the ISO within build process.
 This directory provides the files used for building the initramfs/initrd via
 live-initramfs(8).
 
-TODO
-----
+Requirements for the build system
+---------------------------------
+
+* any Debian based system should be sufficient (if not please send a bug
+report), for example a grml2hd harddisk installation ships all you need
+
+* enough free disk space, at least 1GB are required for a minimal grml-live run
+
+* fast network access for retreiving the Debian packages used for creating the
+chroot (check out "local mirror" and "NFSROOT" to workaround this problem as far
+as possiblbe)
+
+Known TODOs
+-----------
+
+* extend the grml-live wrapper script so it runs all the necessary command in a
+single run (boot/isolinux, mksquashfs and mkisofs stuff is missing currently)
 
-* provide a wrapper script which runs all the necessary command in a single run
-(/usr/sbin/grml-live and /etc/grml/grml-live.conf are work in progress)
+* really support signed apt repositories
 
-* support signed apt repositories
+* explain (and provide configuration for) the use of NFSROOT
 
-* provide buildprocess for boot/isolinux stuff
+* support setting stuff like ISO name, version,...
 
-* explain and provide configuration for use of NFSROOT
+* support different flavours and architectures of Debian (currently it defaults
+to Debian/stable x86_32)
 
 Bugs
 ----
index a69f5e0..e7a2f83 100644 (file)
@@ -3,18 +3,28 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Sat Sep 15 17:02:32 CEST 2007 [mika]
+# Latest change: Sat Sep 15 20:48:42 CEST 2007 [mika]
 ################################################################################
 
 # unless this variable is set, grml-live won't execute anything!
-# so set it to '1' if you want to use grml-live
+# so set it to '1' if you want to use grml-live (might be removed
+# in the future, keep it for "security" reasons now...)
 EXECUTE=1
 
 # output directory of the buildprocess files (the chroot),
 # notice that you need suid,dev,rw permissions there:
-TARGET="/dev/shm/fai" # FIXME / TODO
+CHROOT_TARGET="/dev/shm/fai" # FIXME / TODO
 # mount -o remount,suid,dev,rw /dev/shm
 
+# where do you want to find the compressed chroot, bootstuff,...?
+BUILD_TARGET="/dev/shm/grml_cd"
+
+# where do you want to find the final ISO?
+ISO_TARGET="/dev/shm/"
+
+# which architecture want to build for now?
+ARCH="x86"
+
 # which FAI classes do you want to use by default?
 CLASSES="GRML"
 
@@ -47,5 +57,9 @@ FAI_ARGS=""
 # usage: <flavour> <mirror>
 # FAI_DEBOOTSTRAP="etch http://ftp.de.debian.org/debian"
 
+# do you want to download pageant, plink, pscp, psftp, putty and puttygen
+# to store it inside $BUILD_TARGET/windows/?
+# just unset it do skip download via wget or modify URL
+WINDOWS_BINARIES="http://the.earth.li/~sgtatham/putty/latest/x86/"
 
 ## END OF FILE #################################################################
index 9ee1220..93b4bd4 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -4,7 +4,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Sat Sep 15 18:22:07 CEST 2007 [mika]
+# Latest change: Sat Sep 15 20:58:00 CEST 2007 [mika]
 ################################################################################
 
 # read configuration files, set some misc variables {{{
@@ -23,7 +23,6 @@ fi
 
 VERBOSE=''
 FORCE=''
-DEBUG='' # TODO / FIXME - not implemented yet
 
 # source main configuration file:
 . /etc/grml/grml-live.conf
@@ -47,7 +46,7 @@ trap bailout 1 2 3 15
 [ -n "$HOSTNAME" ] || HOSTNAME=grml
 [ -n "$USERNAME" ] || USERNAME=grml
 [ -n "$CLASSES" ] || CLASSES="GRML"
-[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
+[ -n "$CHROOT_TARGET" ] || bailout 1 "${PN}: \$CHROOT_TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
 # }}}
 
 # usage information {{{
@@ -56,7 +55,7 @@ usage()
   echo "
 $PN - build process script for generating a (grml based) Linux Live-ISO
 
-Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [addiontalarguments_for_fai]
+Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [additional_arguments_for_fai]
 
 Usage examples:
 
@@ -81,8 +80,8 @@ while getopts ?c:f:t:Fhv: opt; do
     c) CLASSES="$OPTARG" ;;
     F) FORCE=1 ;;
     h) usage ; bailout 0 ;;
-    t) TARGET="$OPTARG" ;;
-    v) VERBOSE=1 ;;
+    t) CHROOT_TARGET="$OPTARG" ;;
+    v) VERBOSE="-v" ;;
     ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
   esac
 done
@@ -94,7 +93,7 @@ FAI_ARGS="$*"
 # some misc checks before executing FAI {{{
 [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or
 specify it on the command line using the -c|--classes option."
-[ -n "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in /etc/grml/grml-live.conf or
+[ -n "$CHROOT_TARGET" ] || bailout 1 "Error: \$CHROOT_TARGET unset, please set it in /etc/grml/grml-live.conf or
 specify it on the command line using the -t|--target option."
 
 if [ "$EXECUTE" != '1' ] ; then
@@ -112,7 +111,7 @@ if [ -z "$FORCE" ] ; then
    echo "$PN - check your configuration (or invoke using -F to force execution without prompting)"
    echo
    echo "  FAI classes:                  $CLASSES"
-   echo "  target / output directory:    $TARGET"
+   echo "  target / output directory:    $CHROOT_TARGET"
    [ -n "$FAI_ARGS" ] && echo "  additional arguments for FAI: $FAI_ARGS"
    echo
    echo -n "Is this ok for you? [y/N] "
@@ -133,8 +132,63 @@ if [ -n "$FAI_DEBOOTSTRAP" ] ; then
 fi
 
 # execute FAI {{{
-fai -v -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$TARGET" $FAI_ARGS
+if [ -d "$CHROOT_TARGET" ] ; then
+   echo "$CHROOT_TARGET assumes already, skipping the 'fai dirnstall' stage therefore."
+else
+   mkdir "$CHROOT_TARGET" || bailout 5 "Problem with creating $CHROOT_TARGET for FAI"
+   fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$CHROOT_TARGET" $FAI_ARGS
+fi
 # }}}
 
+if [ -d "$BUILD_TARGET" ] ; then
+   echo "$BUILD_TARGET assumes already, skipping the 'squashfs' stage therefore."
+else
+   mkdir -p "$BUILD_TARGET" || bailout 6 "Problem with creating $BUILD_TARGET for squashfs"
+
+   if [ "$ARCH" = x86 ] ; then
+      mkdir -p "$BUILD_TARGET"/boot/isolinux
+      mkdir "$BUILD_TARGET"/GRML
+      mkdir "$BUILD_TARGET"/live
+      cp /boot/memtest86+.bin                                       "$BUILD_TARGET"/boot/isolinux/memtest
+      cp "$CHROOT_TARGET"/boot/initrd*                              "$BUILD_TARGET"/boot/isolinux/initrd.gz
+      cp "$CHROOT_TARGET"/boot/vmlinuz                              "$BUILD_TARGET"/boot/isolinux/linux26
+      cp /usr/lib/syslinux/chain.c32                                "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/lib/syslinux/isolinux.bin                             "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/lib/syslinux/memdisk                                  "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/lib/syslinux/menu.c32                                 "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/allinone.img  "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/balder10.imz  "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/boot-beep.msg "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/boot.msg      "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/f*            "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/isolinux.cfg  "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/logo.16       "$BUILD_TARGET"/boot/isolinux/
+      cp /usr/share/grml-live/x86_files/boot/isolinux/syslinux.cfg  "$BUILD_TARGET"/boot/isolinux/
+      # minirt26.gz
+      # boot.cat
+      if [ -n "$WINDOWS_BINARIES" ] ; then
+         mkdir "$BUILD_TARGET"/windows
+         ( cd "$BUILD_TARGET"/windows
+         for file in pageant plink pscp psftp putty puttygen ; do
+             wget $WINDOWS_BINARIES/$file
+         done )
+      fi
+   elif [ "$ARCH" = amd64 ] ; then
+       echo 'Warning: gebi, it is your turn. :)'>2
+   elif [ "$ARCH" = ppc ] ; then
+       echo 'Warning: formorer, it is your turn. :)'>2
+   else
+      echo 'Warning: Unsupported ARCH, sorry. Want to support it? Contribute!'>&2
+   fi
+fi
+
+if [ -d "$ISO_TARGET" ] ; then
+   echo "$ISO_TARGET assumes already, skipping the 'iso build' stage therefore."
+else
+   mkdir -p "$ISO_TARGET" || bailout 6 "Problem with creating $ISO_TARGET for squashfs"
+fi
+
+bailout 0
+
 ## END OF FILE #################################################################
 # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2