summaryrefslogtreecommitdiff
path: root/package/block-mount/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-09-10 09:48:31 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-09-10 09:48:31 +0000
commit77fe98d1342d957188c81675279e7202e2837f5c (patch)
treeeb6b05c280a92a8187720b3bd6b3a25b9b0de622 /package/block-mount/files
parenta36bdb24172f9849c8f0ca8d789abbb64895476b (diff)
downloadmtk-20170518-77fe98d1342d957188c81675279e7202e2837f5c.zip
mtk-20170518-77fe98d1342d957188c81675279e7202e2837f5c.tar.gz
mtk-20170518-77fe98d1342d957188c81675279e7202e2837f5c.tar.bz2
block-mount: additionally try to umount disk by mountpoint (#12056)
SVN-Revision: 33357
Diffstat (limited to 'package/block-mount/files')
-rw-r--r--package/block-mount/files/40-mount4
1 files changed, 3 insertions, 1 deletions
diff --git a/package/block-mount/files/40-mount b/package/block-mount/files/40-mount
index 5118d9c..f1d63eb 100644
--- a/package/block-mount/files/40-mount
+++ b/package/block-mount/files/40-mount
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009-2012 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@@ -11,6 +11,7 @@ blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
device=`basename $DEVPATH`
+ mountpoint=`sed -ne "s|^[^ ]*/$device ||; T; s/ .*//p" /proc/self/mounts`
case "$ACTION" in
add)
@@ -82,6 +83,7 @@ if [ `basename $blkdev` != "block" ]; then
;;
remove)
umount /dev/$device
+ umount $mountpoint
;;
esac