X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=ca826c6823fe453f7ef964c10c773ca4050aeb90;hp=dbc43fc20ae13bf2dee60e0b5ca4db3ed5c4da4b;hb=68b9fb146e8702b2f6a790e3d9486ca36f0d9f76;hpb=896a6c8d2654fdc1b8db0bb9abf85ae3e8babec2 diff --git a/grml-live b/grml-live index dbc43fc..ca826c6 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: Die Okt 30 00:09:42 CET 2007 [mika] +# Latest change: Sun Nov 25 16:35:35 CET 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -15,7 +15,7 @@ export LC_ALL=C # exit on any error: set -e -GRML_LIVE_VERSION='0.0.7' +GRML_LIVE_VERSION='0.0.10' CMDLINE="$0 $@" ISO_DATE="$(date +%Y-%m-%d)" @@ -325,32 +325,40 @@ else mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" fi fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" $FAI_ACTION "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE + log "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" echo "$GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" > $CHROOT_OUTPUT/etc/grml_version chmod 644 $CHROOT_OUTPUT/etc/grml_version + + # Remove all FAI logs from chroot if class RELEASE is used: + if [ -f $CHROOT_OUTPUT/etc/grml_fai_release ] ; then + rm -rf $CHROOT_OUTPUT/var/log/fai/* + fi + umount $CHROOT_OUTPUT/proc 2>/dev/null || /bin/true umount $CHROOT_OUTPUT/sys 2>/dev/null || /bin/true [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" # notice: 'fai dirinstall' does not seem to exit appropriate, so: ERROR='' - if [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] ; then + CHECKLOG=/var/log/fai/$HOSTNAME/last + if [ -r "$CHECKLOG/software.log" ] ; then # 1 errors during executing of commands # Unable to write mmap - msync (28 No space left on device) # 'No candidate version found for' [/var/log/fai/current/software.log] - grep 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=1 - grep 'E: Method http has died unexpectedly!' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=2 - grep 'ERROR: chroot' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=3 + grep 'dpkg: error processing' $CHECKLOG/software.log >> $LOGFILE && ERROR=1 + grep 'E: Method http has died unexpectedly!' $CHECKLOG/software.log >> $LOGFILE && ERROR=2 + grep 'ERROR: chroot' $CHECKLOG/software.log >> $LOGFILE && ERROR=3 fi - if [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] ; then - grep 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log >> $LOGFILE && ERROR=2 + if [ -r "$CHECKLOG/shell.log" ] ; then + grep 'FAILED with exit code' $CHECKLOG/shell.log >> $LOGFILE && ERROR=2 fi if [ -n "$ERROR" ] ; then log "There was an error [${ERROR}] during execution of stage 'fai dirinstall' [$(date)]" eerror "There was an error during execution of stage 'fai dirinstall'" - echo " Check out /var/log/fai/dirinstall/$HOSTNAME/ for details. [exit ${ERROR}]" + echo " Check out $CHECKLOG for details. [exit ${ERROR}]" eend 1 bailout 1 else @@ -376,16 +384,25 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then # if we don't have an initrd we a) can't boot and b) there was an error # during build, so check for the file: - if [ -f "$CHROOT_OUTPUT"/boot/initrd* ] ; then - cp "$CHROOT_OUTPUT"/boot/initrd* "$BUILD_OUTPUT"/boot/isolinux/initrd.gz + INITRD="$(ls $CHROOT_OUTPUT/boot/initrd* 2>/dev/null| grep -v '.bak$' | sort -r | head -1)" + if [ -n "$INITRD" ] ; then + cp $INITRD "$BUILD_OUTPUT"/boot/isolinux/initrd.gz + find $CHROOT_OUTPUT/boot/ -name initrd\*.bak -exec rm {} \; else log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1 bailout 10 fi - KERNEL_IMAGE="$(ls $CHROOT_OUTPUT/boot/vmlinuz* | sort -r | head -1)" - cp "$KERNEL_IMAGE" "$BUILD_OUTPUT"/boot/isolinux/linux26 + KERNEL_IMAGE="$(ls $CHROOT_OUTPUT/boot/vmlinuz* 2>/dev/null | sort -r | head -1)" + if [ -n "$KERNEL_IMAGE" ] ; then + cp "$KERNEL_IMAGE" "$BUILD_OUTPUT"/boot/isolinux/linux26 + else + log "No kernel found inside $CHROOT_OUTPUT/boot/ - Exiting" + eerror "No kernel found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1 + bailout 11 + fi + cp /usr/lib/syslinux/chain.c32 "$BUILD_OUTPUT"/boot/isolinux/ cp /usr/lib/syslinux/isolinux.bin "$BUILD_OUTPUT"/boot/isolinux/ cp /usr/lib/syslinux/memdisk "$BUILD_OUTPUT"/boot/isolinux/ @@ -447,7 +464,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then ( cd "$BUILD_OUTPUT"/windows for file in pageant plink pscp psftp putty puttygen ; do wget -O ${file}.exe ${WINDOWS_BINARIES}/${file}.exe - md5sum ${WINDOWS_BINARIES}/${file}.exe > ${WINDOWS_BINARIES}/${file}.exe.md5 + md5sum ${file}.exe > ${file}.exe.md5 done ) fi fi