[packages/VirtualBox] simplify umounting

glen glen at pld-linux.org
Sun Jun 2 22:21:34 CEST 2013


commit 0f5355b3f1a9e6c37edff3cc37432673588c9dcb
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Jun 2 23:19:53 2013 +0300

    simplify umounting

 VirtualBox-vboxsf.init | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/VirtualBox-vboxsf.init b/VirtualBox-vboxsf.init
index 0011bf0..992c151 100755
--- a/VirtualBox-vboxsf.init
+++ b/VirtualBox-vboxsf.init
@@ -19,26 +19,18 @@ start() {
 	fi
 
 	modprobe -s $VBOX_MODULE
+	run_cmd "Mount VirtualBox Shared Folders:" mount -a -t vboxsf
 	touch /var/lock/subsys/vboxsf
 }
 
 stop() {
-	# umount vboxsf mounts, no retry, just don't stack them :)
-	local mount errors out rc=0
-	show "Unmounting vboxsf file systems"; busy
-	awk '$3 == "vboxsf" {print $2}' /proc/mounts | while read mount; do
-		if ! umount "$mount"; then
-			rc=$?
-		fi
-	done
-	if [ $rc = 0 ]; then
-		ok
-	else
-		fail
+	if [ ! -f  /var/lock/subsys/vboxsf ]; then
+		return
 	fi
+	run_cmd "Unmount VirtualBox Shared Folders:" umount -a -t vboxsf
 
 	# NOTE: rmmod will say module in use if there are remaining mounts
-	/sbin/rmmod $VBOX_MODULE
+	rmmod -s $VBOX_MODULE
 
 	rm -f /var/lock/subsys/vboxsf
 }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/VirtualBox.git/commitdiff/0f5355b3f1a9e6c37edff3cc37432673588c9dcb



More information about the pld-cvs-commit mailing list