[Pkg-virtualbox-commits] r121 - trunk/debian

meskes at alioth.debian.org meskes at alioth.debian.org
Mon Nov 19 10:04:10 UTC 2007


Author: meskes
Date: 2007-11-19 10:04:10 +0000 (Mon, 19 Nov 2007)
New Revision: 121

Modified:
   trunk/debian/changelog
   trunk/debian/control
   trunk/debian/virtualbox-ose-guest-utils.init
Log:
Applied patch by Kel Modderman.



Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-11-18 22:49:47 UTC (rev 120)
+++ trunk/debian/changelog	2007-11-19 10:04:10 UTC (rev 121)
@@ -11,12 +11,14 @@
   * Made grep command in vboxnet.sh be quiet, closes: #451741
   * Do not start guest utils if not inside the vm.
   * Disabled modprobing of vboxadd because udev seems to be able to handle it.
+  * Applied patch by Kel Modderman <kel at otaku42.de> improving
+    guest utils init script.
 
   [ Daniel Baumann ]
   * Removing again whitespaces at EOL.
   * Removing empty virtualbox-ose-guest-utils.postrm.
 
- -- Daniel Baumann <daniel at debian.org>  Sun, 18 Nov 2007 23:48:00 +0100
+ -- Michael Meskes <meskes at debian.org>  Mon, 19 Nov 2007 10:56:31 +0100
 
 virtualbox-ose (1.5.2-dfsg2-1) unstable; urgency=low
 

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2007-11-18 22:49:47 UTC (rev 120)
+++ trunk/debian/control	2007-11-19 10:04:10 UTC (rev 121)
@@ -66,7 +66,7 @@
 
 Package: virtualbox-ose-guest-utils
 Architecture: amd64 i386
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, pciutils
 Recommends: virtualbox-ose-guest-modules, virtualbox-ose-guest-source
 Description: PC virtualization solution - guest utils
  VirtualBox is a free PC virtualization solution allowing you to run a wide

Modified: trunk/debian/virtualbox-ose-guest-utils.init
===================================================================
--- trunk/debian/virtualbox-ose-guest-utils.init	2007-11-18 22:49:47 UTC (rev 120)
+++ trunk/debian/virtualbox-ose-guest-utils.init	2007-11-19 10:04:10 UTC (rev 121)
@@ -14,23 +14,40 @@
 
 . /lib/lsb/init-functions
 
-set -e
+in_virtual_machine()
+{
+	if [ -z "$(lspci -d 80ee:beef)" ]; then
+		log_action_begin_msg 'VirtualBox Additions Disabled';
+		log_warning_msg 'not in a Virtual Machine environemnt';
+		log_end_msg 0
+		return 1
+	fi
 
-(lspci|grep -q 80ee:beef) || exit 0 # not inside a vm
+	return 0
+}
 
 case "$1" in
   start)
+  	in_virtual_machine || exit 0
   	log_action_begin_msg 'Starting VirtualBox Additions';
-	# udev should have already handled thismodule
-	# modprobe vboxadd
+	# udev should have already handled this module
+	# double check kernel support is present or die
+	modprobe --quiet vboxadd
+	if [ "$?" -ne 0 ]; then
+		# vboxadd not installed, or has a problem
+		log_failure_msg 'cannot modprobe vboxadd kernel module';
+		log_end_msg 1
+		exit 1
+	fi
 
 	start-stop-daemon --start --quiet --exec /usr/sbin/vboxadd-timesync -- --daemonize
-	log_end_msg 0
+	log_end_msg $?
 	;;
   stop)
+  	in_virtual_machine || exit 0
   	log_action_begin_msg 'Stopping VirtualBox Additions';
 	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/vboxadd-timesync
-	log_end_msg 0
+	log_end_msg $?
 	;;
   restart|force-reload)
 	#




More information about the Pkg-virtualbox-commits mailing list