packages: VirtualBox/VirtualBox-vboxdrv.init, VirtualBox/VirtualBox-vboxgue...

glen glen at pld-linux.org
Tue Jan 11 23:41:55 CET 2011


Author: glen                         Date: Tue Jan 11 22:41:55 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- cleanups & unify

---- Files affected:
packages/VirtualBox:
   VirtualBox-vboxdrv.init (1.7 -> 1.8) , VirtualBox-vboxguest.init (1.1 -> 1.2) , VirtualBox-vboxnetadp.init (1.1 -> 1.2) , VirtualBox-vboxnetflt.init (1.2 -> 1.3) , VirtualBox-vboxsf.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/VirtualBox/VirtualBox-vboxdrv.init
diff -u packages/VirtualBox/VirtualBox-vboxdrv.init:1.7 packages/VirtualBox/VirtualBox-vboxdrv.init:1.8
--- packages/VirtualBox/VirtualBox-vboxdrv.init:1.7	Tue Dec 29 10:37:06 2009
+++ packages/VirtualBox/VirtualBox-vboxdrv.init	Tue Jan 11 23:41:50 2011
@@ -20,30 +20,32 @@
 
 setup() {
 	modprobe -s $VBOX_MODULE
+	if [ -d /dev/.udev ]; then
+		return
+	fi
+
 	# set proper /dev/vboxdrv for systems with static dev
-	if [ ! -d /dev/.udev/ ]; then
-		show "Setting $VBOX_DEVICE entry"; busy
-		rm -f $VBOX_DEVICE
-		VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
-		if [ -n "$VBOX_MAJOR" ]; then
-			VBOX_MINOR=0
-		else
-			VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
-			if [ -n "$VBOX_MINOR" ]; then
-				VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
-			fi
-		fi
-		if [ -z "$VBOX_MAJOR" ]; then
-			/sbin/rmmod $VBOX_MODULE
-			fail
-		elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
-			rmmod $VBOX_MODNAME
-			fail
-		elif ! chown root:vbox $VBOX_DEVICE; then
-			fail
-		else
-			ok
+	show "Setting $VBOX_DEVICE entry"; busy
+	rm -f $VBOX_DEVICE
+	VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
+	if [ -n "$VBOX_MAJOR" ]; then
+		VBOX_MINOR=0
+	else
+		VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
+		if [ -n "$VBOX_MINOR" ]; then
+			VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
 		fi
+	fi
+	if [ -z "$VBOX_MAJOR" ]; then
+		/sbin/rmmod $VBOX_MODULE
+		fail
+	elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
+		rmmod $VBOX_MODNAME
+		fail
+	elif ! chown root:vbox $VBOX_DEVICE; then
+		fail
+	else
+		ok
 	fi
 }
 

================================================================
Index: packages/VirtualBox/VirtualBox-vboxguest.init
diff -u packages/VirtualBox/VirtualBox-vboxguest.init:1.1 packages/VirtualBox/VirtualBox-vboxguest.init:1.2
--- packages/VirtualBox/VirtualBox-vboxguest.init:1.1	Tue Dec  1 08:47:37 2009
+++ packages/VirtualBox/VirtualBox-vboxguest.init	Tue Jan 11 23:41:50 2011
@@ -18,37 +18,42 @@
 # Get service config - may override defaults
 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
 
-start() {
-	if [ ! -f /var/lock/subsys/vboxguest ]; then
-		modprobe -s $VBOX_MODULE
-		# set proper /dev/vboxdrv for systems with static dev
-		if ! [ -d /dev/.udev/ ]; then
-			show "Setting $VBOX_DEVICE entry"
-			busy
-			rm -f $VBOX_DEVICE
-			VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
-			if [ -n "$VBOX_MAJOR" ]; then
-				VBOX_MINOR=0
-			else
-				VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
-				if [ -n "$VBOX_MINOR" ]; then
-					VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
-				fi
-			fi
-			if [ -z "$VBOX_MAJOR" ]; then
-				/sbin/rmmod $VBOX_MODULE
-				fail
-			elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
-				rmmod $VBOX_MODNAME
-				fail
-			elif ! chown root:vbox $VBOX_DEVICE; then
-				fail
-			else
-				ok
+setup() {
+	modprobe -s $VBOX_MODULE
+	# set proper /dev/vboxdrv for systems with static dev
+	if [ ! -d /dev/.udev ]; then
+		show "Setting $VBOX_DEVICE entry"
+		busy
+		rm -f $VBOX_DEVICE
+		VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
+		if [ -n "$VBOX_MAJOR" ]; then
+			VBOX_MINOR=0
+		else
+			VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
+			if [ -n "$VBOX_MINOR" ]; then
+				VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
 			fi
 		fi
-		touch /var/lock/subsys/vboxguest
+		if [ -z "$VBOX_MAJOR" ]; then
+			/sbin/rmmod $VBOX_MODULE
+			fail
+		elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
+			rmmod $VBOX_MODNAME
+			fail
+		elif ! chown root:vbox $VBOX_DEVICE; then
+			fail
+		else
+			ok
+		fi
+	fi
+}
+
+start() {
+	if [ -f /var/lock/subsys/vboxguest ]; then
+		return
 	fi
+	setup
+	touch /var/lock/subsys/vboxguest
 }
 
 stop() {
@@ -70,6 +75,9 @@
 	stop
 	start
 	;;
+  setup)
+	setup
+	;;
   status)
 	if ! is_module $VBOX_MODULE; then
 		echo "$VBOX_MODULE module is loaded"
@@ -85,7 +93,7 @@
 	fi
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|status}"
+	msg_usage "$0 {start|stop|restart|setup|status}"
 	exit 3
 esac
 

================================================================
Index: packages/VirtualBox/VirtualBox-vboxnetadp.init
diff -u packages/VirtualBox/VirtualBox-vboxnetadp.init:1.1 packages/VirtualBox/VirtualBox-vboxnetadp.init:1.2
--- packages/VirtualBox/VirtualBox-vboxnetadp.init:1.1	Thu Feb  4 10:44:13 2010
+++ packages/VirtualBox/VirtualBox-vboxnetadp.init	Tue Jan 11 23:41:50 2011
@@ -19,11 +19,12 @@
 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
 
 start() {
-	if [ ! -f /var/lock/subsys/vboxnetadp ]; then
-		modprobe -s $VBOX_MODULE
-		# set proper /dev/vboxdrv for systems with static dev
-		touch /var/lock/subsys/vboxnetadp
+	if [ -f /var/lock/subsys/vboxnetadp ]; then
+		return
 	fi
+
+	modprobe -s $VBOX_MODULE
+	touch /var/lock/subsys/vboxnetadp
 }
 
 stop() {

================================================================
Index: packages/VirtualBox/VirtualBox-vboxnetflt.init
diff -u packages/VirtualBox/VirtualBox-vboxnetflt.init:1.2 packages/VirtualBox/VirtualBox-vboxnetflt.init:1.3
--- packages/VirtualBox/VirtualBox-vboxnetflt.init:1.2	Thu Dec 25 09:08:30 2008
+++ packages/VirtualBox/VirtualBox-vboxnetflt.init	Tue Jan 11 23:41:50 2011
@@ -19,11 +19,12 @@
 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
 
 start() {
-	if [ ! -f /var/lock/subsys/vboxnetflt ]; then
-		modprobe -s $VBOX_MODULE
-		# set proper /dev/vboxdrv for systems with static dev
-		touch /var/lock/subsys/vboxnetflt
+	if [ -f /var/lock/subsys/vboxnetflt ]; then
+		return
 	fi
+
+	modprobe -s $VBOX_MODULE
+	touch /var/lock/subsys/vboxnetflt
 }
 
 stop() {
@@ -33,12 +34,13 @@
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/vboxnetflt ]; then
-		stop
-		start
-	else
+	if [ ! -f /var/lock/subsys/vboxnetflt ]; then
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 RETVAL=0

================================================================
Index: packages/VirtualBox/VirtualBox-vboxsf.init
diff -u packages/VirtualBox/VirtualBox-vboxsf.init:1.3 packages/VirtualBox/VirtualBox-vboxsf.init:1.4
--- packages/VirtualBox/VirtualBox-vboxsf.init:1.3	Thu May 27 20:40:35 2010
+++ packages/VirtualBox/VirtualBox-vboxsf.init	Tue Jan 11 23:41:50 2011
@@ -19,11 +19,12 @@
 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
 
 start() {
-	if [ ! -f /var/lock/subsys/vboxsf ]; then
-		modprobe -s $VBOX_MODULE
-		# set proper /dev/vboxdrv for systems with static dev
-		touch /var/lock/subsys/vboxsf
+	if [ -f /var/lock/subsys/vboxsf ]; then
+		return
 	fi
+
+	modprobe -s $VBOX_MODULE
+	touch /var/lock/subsys/vboxsf
 }
 
 stop() {
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/VirtualBox/VirtualBox-vboxdrv.init?r1=1.7&r2=1.8&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/VirtualBox/VirtualBox-vboxguest.init?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/VirtualBox/VirtualBox-vboxnetadp.init?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/VirtualBox/VirtualBox-vboxnetflt.init?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/VirtualBox/VirtualBox-vboxsf.init?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list