From e92b6377feb22631f875f3b536f9ac760a05d0e6 Mon Sep 17 00:00:00 2001 From: grml User Date: Sat, 15 Sep 2007 22:39:15 +0200 Subject: [PATCH] Update documentation, simplify TARGET layout, remove cfengine2 from package list and drop EXECUTE=1 concept --- docs/grml-live.txt | 43 ++++++++++++------------ etc/grml/fai/config/package_config/GRML | 1 - etc/grml/grml-live.conf | 18 ++++------ grml-live | 58 ++++++++++++++++++--------------- 4 files changed, 59 insertions(+), 61 deletions(-) diff --git a/docs/grml-live.txt b/docs/grml-live.txt index 69b874f..bd4c41d 100644 --- a/docs/grml-live.txt +++ b/docs/grml-live.txt @@ -63,29 +63,22 @@ Force execution and do not display summary of configuration details. 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: +To get a small, Debian-stable and grml based live-cd using /dev/shm/ +as build and output directory: - # TARGET="/grml/grml_uncompressed" - # CDDIR="/grml/grml_cd" - # grml-live -c GRML -t $TARGET - # mksquashfs $TARGET/* $CDDIR/live/grml.squashfs -noappend - # cd $CDDIR - # mkisofs -V "my personal grml" -l -r -J -no-emul-boot -boot-load-size 4 \ - -boot-info-table -c boot/isolinux/boot.cat \ - -b boot/isolinux/isolinux.bin -o /grml/grml.iso . + # grml-live + +[NOTE] -(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) +If you have about 700MB of free space inside /dev/shm (being a tmpfs, usually +you have >=1GB of RAM) just run "mount -o remount,suid,dev,rw /dev/shm" and use +/dev/shm as build and output directory - resulting in very fast build process. +But please be aware of the fact that rebooting your system will result in an +empty /dev/shm, so please another directory for $CHROOT_TARGET, $BUILD_TARGET +and $ISO_TARGET if you plan to create more persistent output. :) The class concept ----------------- @@ -144,11 +137,11 @@ out-of-the-box so you shouldn't have to configure anything in this file. /etc/grml/fai/make-fai-nfsroot.conf -TODO +TODO: documentation /etc/grml/fai/NFSROOT -TODO +TODO: documentation /etc/grml/fai/apt/sources.list @@ -202,9 +195,10 @@ 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 700MB are required for a minimal grml-live -run (~400MB for the chroot [$CHROOT_TARGET], ~150MB for the build target -[$BUILD_TARGET] and ~150MB for the resulting ISO [$ISO_TARGET]). +* enough free disk space; at least 800MB are required for a minimal grml-live +run (\~400MB for the chroot [$CHROOT_TARGET], \~150MB for the build target +[$BUILD_TARGET] and \~150MB for the resulting ISO [$ISO_TARGET] plus some +temporary files) * 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 @@ -245,3 +239,6 @@ Authors ------- Michael Prokop . +///////////////////////////////////// +// vim:ai tw=80 ft=asciidoc expandtab +///////////////////////////////////// diff --git a/etc/grml/fai/config/package_config/GRML b/etc/grml/fai/config/package_config/GRML index 7a8dc28..703575d 100644 --- a/etc/grml/fai/config/package_config/GRML +++ b/etc/grml/fai/config/package_config/GRML @@ -2,7 +2,6 @@ PACKAGES aptitude aumix alsa-utils bzip2 -cfengine2 console-common cron dctrl-tools diff --git a/etc/grml/grml-live.conf b/etc/grml/grml-live.conf index fa7be2d..decafa1 100644 --- a/etc/grml/grml-live.conf +++ b/etc/grml/grml-live.conf @@ -6,21 +6,17 @@ # Latest change: Sat Sep 15 21:56:52 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 (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: -CHROOT_TARGET="/dev/shm/fai" # FIXME / TODO +# main output directory +# please notice that you need suid,dev,rw permissions there +TARGET="/dev/shm" # FIXME / TODO # mount -o remount,suid,dev,rw /dev/shm +# chroot of the buildprocess files: +CHROOT_TARGET="$TARGET/grml_chroot" # where do you want to find the compressed chroot, bootstuff,...? -BUILD_TARGET="/dev/shm/grml_cd" # FIXME / TODO - +BUILD_TARGET="$TARGET/grml_cd" # where do you want to find the final ISO? -ISO_TARGET="/dev/shm/grml_isos" # FIXME / TODO +ISO_TARGET="$TARGET/grml_isos" # which architecture want to build for now? ARCH="x86" diff --git a/grml-live b/grml-live index 5e36013..78053dc 100755 --- a/grml-live +++ b/grml-live @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # 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 21:36:04 CEST 2007 [mika] +# Latest change: Sat Sep 15 22:32:11 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -21,6 +21,7 @@ if [ "$(id -u 2>/dev/null)" != 0 ] ; then exit 1 fi +# make sure they are not set by default VERBOSE='' FORCE='' @@ -28,12 +29,12 @@ FORCE='' . /etc/grml/grml-live.conf PN=$(basename $0) -TMPFILE=$(mktemp) +# TMPFILE=$(mktemp) # }}} # clean exit {{{ bailout() { - rm -f "$TMPFILE" + # rm -f "$TMPFILE" [ -n "$1" ] && EXIT="$1" || EXIT="1" [ -n "$2" ] && echo "$2">&2 exit "$EXIT" @@ -45,8 +46,8 @@ trap bailout 1 2 3 15 [ -n "$GRML_FAI_CONFIG" ] || GRML_FAI_CONFIG=/etc/grml/fai [ -n "$HOSTNAME" ] || HOSTNAME=grml [ -n "$USERNAME" ] || USERNAME=grml -[ -n "$CLASSES" ] || CLASSES="GRML" -[ -n "$CHROOT_TARGET" ] || bailout 1 "${PN}: \$CHROOT_TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting." +[ -n "$CLASSES" ] || CLASSES="GRML,I386" +[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting." # }}} # usage information {{{ @@ -60,9 +61,9 @@ Usage: $PN [-c ] [-t ] [-F] [-h|--help] [additional Usage examples: $PN - $PN -c GRML -t /dev/shm/grml - $PN -c GRML,GRML_X -t /grml/chroot/grml_uncompressed - $PN -c GRML + $PN -c GRML,I386 -t /dev/shm/grml + $PN -c GRML,GRML_X,I386 -t /grml/ + $PN -c GRML,I386 More details: man grml-live /usr/share/doc/grml-live/grml-live.html @@ -75,34 +76,26 @@ http://grml.org/bugs/ # command line parsing {{{ -while getopts ?c:f:t:Fhv: opt; do +while getopts ?t:f:Fhv: opt; do case "$opt" in c) CLASSES="$OPTARG" ;; F) FORCE=1 ;; h) usage ; bailout 0 ;; - t) CHROOT_TARGET="$OPTARG" ;; + t) TARGET="$OPTARG" ;; v) VERBOSE="-v" ;; ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;; esac done shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter -FAI_ARGS="$*" +# 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 "$CHROOT_TARGET" ] || bailout 1 "Error: \$CHROOT_TARGET unset, please set it in /etc/grml/grml-live.conf or +[ -n "$TARGET" ] || bailout 1 "Error: \$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 - echo "Error: please set EXECUTE=1 in /etc/grml/grml-live.conf to really execute grml-live.">&2 - echo - echo "See 'man grml-live' for more details or execute '$PN --help'">&2 - echo - bailout 1 -fi # }}} # ask user whether the setup is ok {{{ @@ -110,11 +103,11 @@ if [ -z "$FORCE" ] ; then echo echo "$PN - check your configuration (or invoke using -F to force execution without prompting)" echo - echo " FAI classes: $CLASSES" - echo " chroot target: $CHROOT_TARGET" - echo " build target: $BUILD_TARGET" - echo " ISO target: $ISO_TARGET" - + echo " FAI classes: $CLASSES" + echo " output directory: $TARGET" + [ -n "$CHROOT_TARGET" ] && echo " chroot target: $CHROOT_TARGET" + [ -n "$BUILD_TARGET" ] && echo " build target: $BUILD_TARGET" + [ -n "$ISO_TARGET" ] && echo " ISO target: $ISO_TARGET" [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS" echo echo -n "Is this ok for you? [y/N] " @@ -126,6 +119,7 @@ if [ -z "$FORCE" ] ; then fi # }}} +# on-the-fly configuration {{{ if [ -n "$GRML_LIVE_SOURCES" ] ; then echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list fi @@ -133,16 +127,22 @@ fi if [ -n "$FAI_DEBOOTSTRAP" ] ; then sed -i "s#^FAI_DEBOOTSTRAP#FAI_DEBOOTSTRAP=$FAI_DEBOOTSTRAP#" /etc/grml/fai/make-fai-nfsroot.conf fi +# }}} -# execute FAI {{{ +# CHROOT_TARGET - execute FAI {{{ +[ -n "$CHROOT_TARGET" ] || CHROOT_TARGET="$TARGET/grml_chroot" if [ -d "$CHROOT_TARGET" ] ; then echo " [x] $CHROOT_TARGET exists already, skipping the stage 'fai dirnstall'" 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 + umount $CHROOT_TARGET/proc 2>/dev/null + umount $CHROOT_TARGET/sys 2>/dev/null fi # }}} +# BUILD_TARGET - execute arch specific stuff and squashfs {{{ +[ -n "$BUILD_TARGET" ] || BUILD_TARGET="$TARGET/grml_cd" mkdir -p "$BUILD_TARGET" || bailout 6 "Problem with creating $BUILD_TARGET for stage ARCH" # x86: @@ -200,7 +200,10 @@ else mkdir "$BUILD_TARGET"/live mksquashfs $CHROOT_TARGET/* $BUILD_TARGET/live/grml.squashfs -noappend fi +# }}} +# ISO_TARGET - mkisofs {{{ +[ -n "$ISO_TARGET" ] || ISO_TARGET="$TARGET/grml_isos" if [ -d "$ISO_TARGET" ] ; then echo " [x] $ISO_TARGET exists already, skipping the stage 'iso build'" else @@ -213,9 +216,12 @@ else ) fi +# }}} +# finalize {{{ echo " [*] Sucessfully finished execution of $PN" bailout 0 +# }}} ## END OF FILE ################################################################# # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2 -- 2.1.4