X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-live;h=4240aa1d928716e09a819cba8607d3fc5b1b4079;hb=5814000e2935205ebf42b7c17cf2e47b7f6b10dc;hp=78053dc9a1772e5b11e7bd5c67cd95064ecb77fd;hpb=e92b6377feb22631f875f3b536f9ac760a05d0e6;p=grml-live.git diff --git a/grml-live b/grml-live index 78053dc..4240aa1 100755 --- a/grml-live +++ b/grml-live @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash # Filename: grml-live # Purpose: build process script for generating a (grml based) Linux Live-ISO # 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 22:32:11 CEST 2007 [mika] +# Latest change: Sun Sep 16 23:47:55 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -76,18 +76,23 @@ http://grml.org/bugs/ # command line parsing {{{ -while getopts ?t:f:Fhv: opt; do +while getopts "c:s:t:Fhv" opt; do case "$opt" in c) CLASSES="$OPTARG" ;; + # f) FLAVOUR="$OPTARG" ;; # TODO F) FORCE=1 ;; h) usage ; bailout 0 ;; - t) TARGET="$OPTARG" ;; + s) SUITE="$OPTARG" ;; + t) TARGET="$OPTARG" + CHROOT_TARGET="$TARGET/grml_chroot" + BUILD_TARGET="$TARGET/grml_cd" + ISO_TARGET="$TARGET/grml_isos" + ;; 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="$*" # }}} @@ -108,7 +113,9 @@ if [ -z "$FORCE" ] ; then [ -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" + [ -n "$SUITE" ] && echo " Debian suite: $SUITE" + [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS" + [ -n "$VERBOSE" ] && echo " Using VERBOSE mode." echo echo -n "Is this ok for you? [y/N] " read a @@ -124,6 +131,14 @@ if [ -n "$GRML_LIVE_SOURCES" ] ; then echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list fi +# we assume that it is set to 'etch' by default +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 +fi + if [ -n "$FAI_DEBOOTSTRAP" ] ; then sed -i "s#^FAI_DEBOOTSTRAP#FAI_DEBOOTSTRAP=$FAI_DEBOOTSTRAP#" /etc/grml/fai/make-fai-nfsroot.conf fi @@ -131,13 +146,15 @@ fi # 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 + umount $CHROOT_TARGET/proc 2>/dev/null || /bin/true + umount $CHROOT_TARGET/sys 2>/dev/null || /bin/true + echo " [*] Finished execution of stage 'fai dirinstall'" fi # }}} @@ -172,7 +189,7 @@ if [ "$ARCH" = x86 ] ; then # boot.cat if [ -n "$WINDOWS_BINARIES" ] ; then if [ -d "$BUILD_TARGET"/windows ] ; then - echo " [x] $BUILD_TARGET/windows exists already - skipping stage WINDOWS_BINARIES" + echo " [x] $BUILD_TARGET/windows exists already - skipping stage 'WINDOWS_BINARIES'" return 0 else mkdir "$BUILD_TARGET"/windows @@ -181,14 +198,16 @@ if [ "$ARCH" = x86 ] ; then wget ${WINDOWS_BINARIES}/${file}.exe done ) fi + echo " [*] Finished execution of stage 'WINDOWS_BINARIES'" fi + echo " [*] Finished execution of stage 'boot/isolinux'" fi # amd64: elif [ "$ARCH" = amd64 ] ; then - echo 'Warning: gebi, it is your turn. :)'>2 + echo 'Warning: gebi, it is your turn. :)'>&2 # ppc: -elif [ "$ARCH" = ppc ] ; then - echo 'Warning: formorer, it is your turn. :)'>2 +elif [ "$ARCH" = powerpc ] ; then + echo 'Warning: formorer, it is your turn. :)'>&2 # unsuported: else echo 'Warning: Unsupported ARCH, sorry. Want to support it? Contribute!'>&2 @@ -200,6 +219,7 @@ else mkdir "$BUILD_TARGET"/live mksquashfs $CHROOT_TARGET/* $BUILD_TARGET/live/grml.squashfs -noappend fi +echo " [*] Finished execution of stage 'squashfs'" # }}} # ISO_TARGET - mkisofs {{{ @@ -214,7 +234,7 @@ else -c boot/isolinux/boot.cat -b boot/isolinux/isolinux.bin \ -o "$ISO_TARGET"/grml_0.0-1.iso . ) - + echo " [*] Finished execution of stage 'iso build'" fi # }}}