X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=0183b6f6fb5b4ef297d9e97204058c497a5276bc;hp=6c3c5496c44c0a795a2619a0b40fbec2a18f96de;hb=781e6ceeaae00a0aa87faeda739f41b9ddaf35e3;hpb=cb5e98b9863e256b40ca8c58dc678cbcce698d4f diff --git a/grml-live b/grml-live index 6c3c549..0183b6f 100755 --- a/grml-live +++ b/grml-live @@ -20,10 +20,11 @@ else fi # exit on any error: -set -e +# disable for now since it seems to cause some problems +# set -e # global variables -GRML_LIVE_VERSION='0.13.3' +GRML_LIVE_VERSION='0.14.1' PN="$(basename $0)" CMDLINE="$0 $@" SOURCES_LIST_FILE='/etc/grml/fai/apt/sources.list' @@ -131,18 +132,29 @@ LIVE_CONF=/etc/grml/grml-live.conf . $LIVE_CONF # }}} +# umount all directories {{{ +umount_all() { + # make sure we don't leave any mounts - FAI doesn't remove them always + umount $CHROOT_OUTPUT/proc 2>/dev/null || /bin/true + umount $CHROOT_OUTPUT/sys 2>/dev/null || /bin/true + umount $CHROOT_OUTPUT/dev/pts 2>/dev/null || /bin/true + umount $CHROOT_OUTPUT/dev 2>/dev/null || /bin/true + [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" +} +# }}} + # clean exit {{{ bailout() { rm -f /var/run/fai/fai_softupdate_is_running \ /var/run/fai/FAI_INSTALLATION_IN_PROGRESS [ -n "$SQUASHFS_STDERR" ] && rm -rf "$SQUASHFS_STDERR" - [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" + umount_all [ -n "$1" ] && EXIT="$1" || EXIT="1" [ -n "$2" ] && eerror "$2">&2 log "------------------------------------------------------------------------------" exit "$EXIT" } -trap bailout 1 2 3 3 6 9 14 15 +trap bailout 1 2 3 3 6 9 14 15 EXIT # }}} # log file stuff {{{ @@ -439,7 +451,7 @@ for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do done # notice: activate grml-live pool only if we are building against unstable: -if grep -qe unstable -qe sid "$SOURCES_LIST_FILE" ; then +if grep -qwe unstable -qwe sid "$SOURCES_LIST_FILE" ; then grep -q 'grml-live.*main' "$SOURCES_LIST_FILE" || \ grep grml-stable "$SOURCES_LIST_FILE" | \ sed 's/grml-stable/grml-live/' >> "$SOURCES_LIST_FILE" @@ -548,13 +560,7 @@ else rm -rf "$CHROOT_OUTPUT"/var/log/fai/* fi - # make sure we don't leave any mounts - FAI doesn't remove them always - umount $CHROOT_OUTPUT/proc 2>/dev/null || /bin/true - umount $CHROOT_OUTPUT/sys 2>/dev/null || /bin/true - umount $CHROOT_OUTPUT/dev/pts 2>/dev/null || /bin/true - umount $CHROOT_OUTPUT/dev 2>/dev/null || /bin/true - - [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" + umount_all # notice: 'fai dirinstall' does not seem to exit appropriate, so: ERROR='' @@ -1127,11 +1133,11 @@ else einfo "Creating hybrid ISO file with manifold method" if [ "$HYBRID_METHOD" = "grub2" ] ; then # 512 bytes: MBR, partition table, load GRUB 2 - echo 4 63 | mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 1:0x96 -g $cyls:16:32 + echo 4 63 | mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 4:0x96 -g $cyls:16:32 else # read only one but 2048-byte sized (scale: << 2) sector echo $bootoff $bootoff | \ - mksh /usr/share/grml-live/scripts/bootilnx.mksh -A -M 1:0x96 -g $cyls:16:32 -S 2 + mksh /usr/share/grml-live/scripts/bootilnx.mksh -A -M 4:0x96 -g $cyls:16:32 -S 2 fi | dd of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null eend $? fi