X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-live;h=407cc17f0c39aabd6c46bd3bafd9f8150aeb7b12;hb=0f72adacbce0a22376ccc889598f29d8dd2966d9;hp=f476726c2c5c7e9fcbe2116d60a7c18f9cec30bf;hpb=1e57a2a5cdc5c979ebd5e2633502db23d9ea37ee;p=grml-live.git diff --git a/grml-live b/grml-live index f476726..407cc17 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: Wed Sep 19 23:41:52 CEST 2007 [mika] +# Latest change: Thu Sep 20 13:25:31 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -28,10 +28,10 @@ FORCE='' if [ -r /etc/grml/lsb-functions ] ; then . /etc/grml/lsb-functions else - einfo() { echo " [*] $*" ;} + einfo() { echo " [*] $*" ;} eerror() { echo " [!] $*">&2 ;} - ewarn() { echo " [x] $*" ;} - eend() { return 0 ; } + ewarn() { echo " [x] $*" ;} + eend() { return 0 ;} fi # source main configuration file: @@ -39,12 +39,10 @@ LIVE_CONF=/etc/grml/grml-live.conf . $LIVE_CONF PN=$(basename $0) -# TMPFILE=$(mktemp) # }}} # clean exit {{{ bailout() { - # rm -f "$TMPFILE" [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}" [ -n "$1" ] && EXIT="$1" || EXIT="1" [ -n "$2" ] && eerror "$2">&2 @@ -58,10 +56,11 @@ trap bailout 1 2 3 15 [ -n "$HOSTNAME" ] || HOSTNAME=grml [ -n "$USERNAME" ] || USERNAME=grml [ -n "$CLASSES" ] || CLASSES="GRML,I386" +[ -n "$BOOT_METHOD" ] || BOOT_METHOD='isolinux' [ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust $LIVE_CONF. Exiting." -[ -n "$VERSION" ] || VERSION="0.1" -[ -n "$CODENAME" ] || CODENAME="grml-live rocks" +[ -n "$VERSION" ] || VERSION="0.0.1" +[ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks" [ -n "$LOGDIR" ] || LOGDIR="/var/log/fai/dirinstall/$HOSTNAME" [ -d "$LOGDIR" ] || mkdir $LOGDIR @@ -123,7 +122,8 @@ usage() echo " $PN - build process script for generating a (grml based) Linux Live-ISO -Usage: $PN [-c ] [-t ] [-s [-Fvh] +Usage: $PN [-c ] [-i ] [-r ] \\ + [-s ] [-t ] [-v ] [-Fvh] Usage examples: @@ -131,7 +131,8 @@ Usage examples: $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 + $PN -c GRMLBASE,I386 -v -i grml_0.0-1.iso + $PN -c GRMLBASE,I386 -s sid More details: man grml-live /usr/share/doc/grml-live/grml-live.html @@ -144,19 +145,21 @@ http://grml.org/bugs/ # command line parsing {{{ -while getopts "c:i:s:t:Fhv" opt; do +while getopts "c:i:r:s:t:v:FhV" opt; do case "$opt" in c) CLASSES="$OPTARG" ;; - F) FORCE=1 ;; - h) usage ; bailout 0 ;; i) ISO_NAME="$OPTARG" ;; + r) RELEASENAME="$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" ;; + v) VERSION="$OPTARG" ;; + F) FORCE=1 ;; + h) usage ; bailout 0 ;; + V) VERBOSE="-v" ;; ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;; esac done @@ -182,6 +185,7 @@ if [ -z "$FORCE" ] ; then [ -n "$BUILD_TARGET" ] && echo " build target: $BUILD_TARGET" [ -n "$ISO_TARGET" ] && echo " ISO target: $ISO_TARGET" [ -n "$SUITE" ] && echo " Debian suite: $SUITE" + [ -n "$BOOT_METHOD" ] && echo " Boot method: $BOOT_METHOD" [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS" [ -n "$VERBOSE" ] && echo " Using VERBOSE mode." echo @@ -277,9 +281,9 @@ mkdir -p "$BUILD_TARGET" || bailout 6 "Problem with creating $BUILD_TARGET for s # i386: [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)" if [ "$ARCH" = i386 ] ; then - if [ -d "$BUILD_TARGET"/boot/isolinux ] ; then - ewarn "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'" ; eend 0 - log "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'" + if [ -d "$BUILD_TARGET"/boot ] ; then + ewarn "$BUILD_TARGET/boot exists already, skipping stage 'boot'" ; eend 0 + log "$BUILD_TARGET/boot exists already, skipping stage 'boot'" else # booting stuff: mkdir -p "$BUILD_TARGET"/boot/isolinux @@ -291,28 +295,25 @@ if [ "$ARCH" = i386 ] ; then 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/i386_files/boot/isolinux/allinone.img "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/balder10.imz "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/boot-beep.msg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/boot.msg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/f* "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/isolinux.cfg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/logo.16 "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/syslinux.cfg "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp -a /usr/share/grml-live/i386_files/boot/grub "$BUILD_TARGET"/boot/ # adjust boot splash information: ISO_DATE="$(date +%Y-%m-%d)" VERSION="$(cut_string 5 "$VERSION")" ; VERSION="$(extend_string_end 5 "$VERSION")" - CODENAME="$(cut_string 30 "$CODENAME")" ; CODENAME="$(extend_string_end 30 "$CODENAME")" + RELEASENAME="$(cut_string 30 "$RELEASENAME")" ; RELEASENAME="$(extend_string_end 30 "$RELEASENAME")" sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot.msg - sed -i "s/%CODENAME%/$CODENAME/" "$BUILD_TARGET"/boot/isolinux/boot.msg + sed -i "s/%RELEASENAME%/$RELEASENAME/" "$BUILD_TARGET"/boot/isolinux/boot.msg sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot.msg sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg - sed -i "s/%CODENAME%/$CODENAME/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg + sed -i "s/%RELEASENAME%/$RELEASENAME/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg + sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/grub/menu.lst + # autostart for Windows: cp /usr/share/grml-live/windows/autostart/autorun.bat "$BUILD_TARGET"/ cp /usr/share/grml-live/windows/autostart/autorun.inf "$BUILD_TARGET"/ @@ -333,7 +334,7 @@ if [ "$ARCH" = i386 ] ; then einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0 log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]" fi - einfo "Finished execution of stage 'boot/isolinux'" ; eend 0 + einfo "Finished execution of stage 'boot'" ; eend 0 fi # amd64: elif [ "$ARCH" = amd64 ] ; then @@ -359,17 +360,24 @@ fi # ISO_TARGET - mkisofs {{{ [ -n "$ISO_TARGET" ] || ISO_TARGET="$TARGET/grml_isos" -if [ -d "$ISO_TARGET" ] ; then +[ -n "$ISO_NAME" ] || ISO_NAME="grml_${VERSION}.iso" + +if [ "$BOOT_METHOD" = "isolinux" ] ; then + BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat" +elif [ "$BOOT_METHOD" = "grub" ] ; then + BOOT_FILE="boot/grub/stage2_eltorito" +fi + +if [ -f "${ISO_TARGET}/${ISO_NAME}" ] ; then ewarn "$ISO_TARGET exists already, skipping stage 'iso build'" ; eend 0 log "$ISO_TARGET exists already, skipping stage 'iso build'" else mkdir -p "$ISO_TARGET" || bailout 6 "Problem with creating $ISO_TARGET for stage 'iso build'" - [ -n "$ISO_NAME" ] || ISO_NAME="grml_0.0-1.iso" ( cd "$BUILD_TARGET" && - mkisofs -V "Debian/etch grml" -publisher 'grml-live | grml.org' \ + mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \ - -c boot/isolinux/boot.cat -b boot/isolinux/isolinux.bin \ - -o "${ISO_TARGET}"/"${ISO_NAME}" . + -b $BOOT_FILE \ + -o "${ISO_TARGET}/${ISO_NAME}" . ) einfo "Finished execution of stage 'iso build'" ; eend 0 log "Finished execution of stage 'iso build' [$(date)]"