block-mount: additionally try to umount disk by mountpoint (#12056)
SVN-Revision: 33357
This commit is contained in:
parent
a36bdb2417
commit
77fe98d134
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=block-mount
|
PKG_NAME:=block-mount
|
||||||
PKG_VERSION:=0.2.0
|
PKG_VERSION:=0.2.0
|
||||||
PKG_RELEASE:=8
|
PKG_RELEASE:=9
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (C) 2009-2010 OpenWrt.org
|
# Copyright (C) 2009-2012 OpenWrt.org
|
||||||
# Copyright (C) 2010 Vertical Communications
|
# Copyright (C) 2010 Vertical Communications
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -11,6 +11,7 @@ blkdev=`dirname $DEVPATH`
|
|||||||
if [ `basename $blkdev` != "block" ]; then
|
if [ `basename $blkdev` != "block" ]; then
|
||||||
|
|
||||||
device=`basename $DEVPATH`
|
device=`basename $DEVPATH`
|
||||||
|
mountpoint=`sed -ne "s|^[^ ]*/$device ||; T; s/ .*//p" /proc/self/mounts`
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
add)
|
add)
|
||||||
@ -82,6 +83,7 @@ if [ `basename $blkdev` != "block" ]; then
|
|||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
umount /dev/$device
|
umount /dev/$device
|
||||||
|
umount $mountpoint
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user