X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-live;h=91a929d679a90639810c9eb93831e56cab589d1d;hb=18b724911750d346e7d13ac5d29e4b0d321c9283;hp=98bf5587b942e718ebdd775c132a4f3c6bcc50e6;hpb=85faacc881efc871120f0500b1d1bb2b7216f168;p=grml-live.git diff --git a/grml-live b/grml-live index 98bf558..91a929d 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: Mon Sep 17 18:31:35 CEST 2007 [mika] +# Latest change: Tue Sep 18 19:29:33 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -26,7 +26,8 @@ VERBOSE='' FORCE='' # source main configuration file: -. /etc/grml/grml-live.conf +LIVE_CONF=/etc/grml/grml-live.conf +. $LIVE_CONF PN=$(basename $0) # TMPFILE=$(mktemp) @@ -47,7 +48,7 @@ trap bailout 1 2 3 15 [ -n "$HOSTNAME" ] || HOSTNAME=grml [ -n "$USERNAME" ] || USERNAME=grml [ -n "$CLASSES" ] || CLASSES="GRML,I386" -[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting." +[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust $LIVE_CONF. Exiting." # }}} # usage information {{{ @@ -61,8 +62,8 @@ Usage: $PN [-c ] [-t ] [-s [-Fvh] Usage examples: $PN - $PN -c GRMLBASE,I386 -t /dev/shm/grml $PN -c GRMLBASE,GRML_X,I386 -t /grml/ + $PN -c GRMLBASE,I386 -t /dev/shm/grml $PN -c GRMLBASE,GRML_SMALL,I386 $PN -s sid -c GRMLBASE,I386 @@ -98,19 +99,19 @@ shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter # }}} # some misc checks before executing FAI {{{ -[ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or +[ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in $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 "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in $LIVE_CONF or specify it on the command line using the -t|--target option." # }}} # ask user whether the setup is ok {{{ if [ -z "$FORCE" ] ; then echo - echo "$PN - check your configuration (or invoke using -F to force execution without prompting)" + echo "$PN - check your configuration (or invoke using -F to force execution without prompting):" echo echo " FAI classes: $CLASSES" - echo " output directory: $TARGET" + echo " main 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" @@ -132,17 +133,21 @@ if [ -n "$GRML_LIVE_SOURCES" ] ; then echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list fi -# this heuristic is broken as it works exactly *once* by default :-/ -# TODO / FIXME -if [ -n "$SUITE" ] ; then - sed -i "s#etch #$SUITE #" /etc/grml/fai/make-fai-nfsroot.conf - sed -i "s#etch #$SUITE #" /etc/grml/grml-live.conf - sed -i "s# etch # $SUITE #" /etc/grml/grml-live.conf - sed -i "s# etch # $SUITE #" /etc/grml/fai/apt/sources.list +if [ -n "$FAI_DEBOOTSTRAP" ] ; then + sed -i "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" /etc/grml/fai/make-fai-nfsroot.conf fi -if [ -n "$FAI_DEBOOTSTRAP" ] ; then - sed -i "s#^FAI_DEBOOTSTRAP#FAI_DEBOOTSTRAP=$FAI_DEBOOTSTRAP#" /etc/grml/fai/make-fai-nfsroot.conf +# does this suck? YES! +if [ -n "$SUITE" ] ; then + sed -ie "s/SUITE=.*/SUITE=\"$SUITE\"/" $LIVE_CONF + + DIST="\|\ etch\ \|\ stable\ \|\ lenny\ \|\ testing\ \|\ sid\ \|\ unstable\ " + sed -ie "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" $LIVE_CONF + sed -ie "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" /etc/grml/fai/apt/sources.list + + DIST='\"etch\|=\"stable=\"lenny=\"testing=\"sid=\"unstable' + sed -ie "s#FAI_DEBOOTSTRAP=$DIST#FAI_DEBOOTSTRAP=\"$SUITE#" $LIVE_CONF + sed -ie "s#FAI_DEBOOTSTRAP=$DIST#FAI_DEBOOTSTRAP=\"$SUITE#" /etc/grml/fai/make-fai-nfsroot.conf fi # }}} @@ -152,7 +157,7 @@ fi 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" + mkdir -p "$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 || /bin/true umount $CHROOT_TARGET/sys 2>/dev/null || /bin/true