block-mount: additionally try to umount disk by mountpoint (#12056)
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Sep 2012 09:48:31 +0000 (09:48 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Sep 2012 09:48:31 +0000 (09:48 +0000)
SVN-Revision: 33357

package/block-mount/Makefile
package/block-mount/files/40-mount

index b82011fe42587ea70504a81cd2d5e73fccb143cd..799539e4bd53cd58e4d7b8091f7b3d619db92f27 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=block-mount
 PKG_VERSION:=0.2.0
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 include $(INCLUDE_DIR)/package.mk
 
index 5118d9c1044431579e7b81646136e3f7324e8094..f1d63eba6636748ede41061263e9dbda78f40986 100644 (file)
@@ -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