X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=ae1f80d39fc6d9198da6e1330b33bba5cede5f94;hp=68d88248120144d8b3e3bb75830e8af1017211ac;hb=8d3fd17fcc92984f69b859fa9d731049167dbf40;hpb=666902fa1edae45c1018433d24e9af026c831372 diff --git a/grml-debootstrap b/grml-debootstrap index 68d8824..ae1f80d 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -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. -# Latest change: Die Jun 05 13:51:21 CEST 2007 [mika] +# Latest change: Die Jun 05 14:06:21 CEST 2007 [mika] ################################################################################ # http://www.debian.org/releases/stable/i386/index.html.en @@ -96,7 +96,7 @@ while [ "$#" -gt "0" ] ; do ;; -i|--iso) shift - [ -n "$MIRROR" ] && unset MIRROR + [ -n "$MIRROR" ] && unset MIRROR ISO=$1 ;; -h|--help) @@ -178,6 +178,7 @@ chmod 600 /etc/debootstrap/variables # make sure nobody except root can read it [ -n "$GROOT" ] && echo "GROOT=$GROOT" >> /etc/debootstrap/variables [ -n "$TARGET" ] && echo "TARGET=$TARGET" >> /etc/debootstrap/variables [ -n "$ISO" ] && echo "ISO=$ISO" >> /etc/debootstrap/variables +[ -n "$ISODIR" ] && echo "ISODIR=$ISO" >> /etc/debootstrap/variables [ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> /etc/debootstrap/variables [ -n "$MIRROR" ] && echo "CHROOTMIRROR=$MIRROR" >> /etc/debootstrap/variables [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> /etc/debootstrap/variables @@ -298,8 +299,10 @@ mount_target() { fi fi if [ -n "$ISODIR" ] ; then + einfo "Mounting Debian image loopback to $MNTPOINT/$ISODIR." mkdir -p "$MNTPOINT/$ISODIR" mount --bind "$ISODIR" "$MNTPOINT/$ISODIR" + eend $? fi } # }}} @@ -382,10 +385,19 @@ grub_install() { # unmount $MNTPOINRT {{{ umount_chroot() { - if [ -n "$PARTITION" ] ; then - einfo "Unmount $MNTPOINT" - umount $MNTPOINT - eend $? + if [ -n "$ISODIR" ] ; then + if grep -q "$MNTPOINT/$ISODIR" /proc/mounts ; then + einfo "Unmount $MNTPOINT/$ISODIR" + umount "$MNTPOINT/$ISODIR" + eend $? + fi + fi + if grep -q "$MNTPOINT" /proc/mounts ; then + if [ -n "$PARTITION" ] ; then + einfo "Unmount $MNTPOINT" + umount $MNTPOINT + eend $? + fi fi } # }}}