From 1482c1237c796e651d36f1c8535418c66b9c68ed Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 8 May 2009 15:43:58 +0200 Subject: [PATCH] check for mounted target in mkfs() step already instead of mount_target() --- debian/changelog | 3 ++- grml-debootstrap | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 302e64b..4accc0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,11 +13,12 @@ grml-debootstrap (0.27) unstable; urgency=low - Drop 'do not prompt for partition dialog if swraid has been configured already' which doesn't make any sense in most situations * Minor changes: + - check for mounted target in mkfs() step already instead of mount_target() - use '.. to the debootstrap command' in description of --debopt * Debian Package: - bump Standard Version to 3.8.1 (no further changes). - -- Michael Prokop Fri, 08 May 2009 15:37:58 +0200 + -- Michael Prokop Fri, 08 May 2009 15:43:02 +0200 grml-debootstrap (0.26) unstable; urgency=low diff --git a/grml-debootstrap b/grml-debootstrap index 46d2526..b11ee7c 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -675,6 +675,11 @@ stage() { # create filesystem {{{ mkfs() { + if grep -q $TARGET /proc/mounts ; then + eerror "$TARGET already mounted, exiting to avoid possible damage. (Manually unmount $TARGET)" ; eend 1 + exit 1 + fi + if [ -n "$MKFS" ] ; then einfo "Running $MKFS on $TARGET" $MKFS $TARGET @@ -700,7 +705,7 @@ mount_target() { einfo "Running grml-debootstrap on a directory, nothing to mount." else if grep -q $TARGET /proc/mounts ; then - eerror "$TARGET already mounted, exiting." + ewarn "$TARGET already mounted, continuing anyway." ; eend 0 else [ -d "$MNTPOINT" ] || mkdir -p "$MNTPOINT" einfo "Mounting $TARGET to $MNTPOINT" -- 2.1.4