# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fre Nov 03 11:15:56 CET 2006 [mika]
+# Latest change: Fre Nov 03 13:50:30 CET 2006 [mika]
################################################################################
# http://www.debian.org/releases/stable/i386/apcs04.html.en
eend $?
# now mount the new partition
-einfo "Mounting $TARGET to $MNTPOINT"
-mount -o rw,suid,dev $TARGET $MNTPOINT
-eend $?
+if grep -q $TARGET /proc/mounts ; then
+ eerror "$TARGEt already mounted, exiting."
+else
+ einfo "Mounting $TARGET to $MNTPOINT"
+ mount -o rw,suid,dev $TARGET $MNTPOINT
+ eend $?
+fi
# get main packages from a debian-mirror
einfo "Running $DEBOOTSTRAP for release $RELEASE using mirror $MIRROR"
[ -d /etc/debootstrap/share ] && cp -a /etc/debootstrap/share/* $MNTPOINT/share/
[ -d /etc/debootstrap/usr ] && cp -a /etc/debootstrap/usr/* $MNTPOINT/usr/
[ -d /etc/debootstrap/var ] && cp -a /etc/debootstrap/var/* $MNTPOINT/var/
-eend $?
+eend 0
einfo "Executing chroot-script now"
chroot $MNTPOINT /bin/chroot-script
umount $MNTPOINT
eend $?
+if [ "$FSCK" = 'yes' ] ; then
+ [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}"
+ einfo "Checking filesystem on $TARGET using $FSCKTOOL"
+ $FSCKTOOL $TARGET
+ eend $?
+fi
+
einfo "Finished execution of $0 - enjoy your Debian system." ; eend 0
## END OF FILE #################################################################