- [ -x "$TARGET"/etc/init.d/ssh ] && "$TARGET"/etc/init.d/ssh stop
- [ -x "$TARGET"/etc/init.d/mdadm ] && "$TARGET"/etc/init.d/mdadm stop
- chroot "$TARGET" umount /sys 1>/dev/null 2>&1
- chroot "$TARGET" umount /proc 1>/dev/null 2>&1
- echo "Unmounting $TARGET"
- umount "$TARGET"
+ [ -x "$MNTPOINT"/etc/init.d/ssh ] && "$MNTPOINT"/etc/init.d/ssh stop
+ [ -x "$MNTPOINT"/etc/init.d/mdadm ] && "$MNTPOINT"/etc/init.d/mdadm stop
+ # ugly, but make sure we really don't leav anything
+ [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /sys 1>/dev/null 2>&1
+ [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount -a 1>/dev/null 2>&1
+ [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /proc 1>/dev/null 2>&1
+ [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount /proc 1>/dev/null 2>&1
+ einfo "Unmounting $MNTPOINT" ; umount "$MNTPOINT" ; eend $?