Package: virtualbox-ose
Version: 2.1.4-dfsg-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu jaunty ubuntu-patch

The attached patch contains an improvement to the init script, which removes 
the usage of "find", which can take up to 10 seconds (or probably more).

Please forgive me that I have not actually tested this, but committed it for 
Ubuntu Karmic already.

The initial bug has been reported against Ubuntu at, and includes more info 
(about the benchmarking):
https://launchpad.net/bugs/369550
diff -u virtualbox-ose-2.1.4-dfsg/debian/changelog virtualbox-ose-2.1.4-dfsg/debian/changelog
diff -u virtualbox-ose-2.1.4-dfsg/debian/patches/09-initscript.dpatch virtualbox-ose-2.1.4-dfsg/debian/patches/09-initscript.dpatch
--- virtualbox-ose-2.1.4-dfsg/debian/patches/09-initscript.dpatch
+++ virtualbox-ose-2.1.4-dfsg/debian/patches/09-initscript.dpatch
@@ -4,20 +4,19 @@
 ## DP: Some changes to initscript.
 
 @DPATCH@
-
-diff -Naurp virtualbox-ose-2.1.2-dfsg.orig/src/VBox/Installer/linux/vboxdrv.sh.in virtualbox-ose-2.1.2-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in
---- virtualbox-ose-2.1.2-dfsg.orig/src/VBox/Installer/linux/vboxdrv.sh.in	2009-02-20 13:37:57.000000000 +0100
-+++ virtualbox-ose-2.1.2-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in		2009-02-20 13:36:50.000000000 +0100
+diff -urNad virtualbox-ose-2.1.4-dfsg~/src/VBox/Installer/linux/vboxdrv.sh.in virtualbox-ose-2.1.4-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in
+--- virtualbox-ose-2.1.4-dfsg~/src/VBox/Installer/linux/vboxdrv.sh.in	2009-04-30 23:11:50.143791302 +0200
++++ virtualbox-ose-2.1.4-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in	2009-04-30 23:11:51.443789125 +0200
 @@ -32,6 +32,8 @@
  LOG="/var/log/vbox-install.log"
- NOLSB=yes
+ NOLSB=%NOLSB%
  
 +# Include virtualbox-ose defaults if available
 +[ -f /etc/default/virtualbox-ose ] && . /etc/default/virtualbox-ose
  [ -f /lib/lsb/init-functions ] && NOLSB=
  [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg
  
-@@ -147,14 +149,19 @@
+@@ -147,15 +149,18 @@
  {
      begin_msg "Starting VirtualBox kernel module"
      if ! running vboxdrv; then
@@ -30,22 +29,21 @@
 -        if ! modprobe vboxdrv > /dev/null 2>&1; then
 -            failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
 +	if [ "$LOAD_VBOXDRV_MODULE" = 1 ]; then
-+		if ! find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
-+		    failure "No suitable module for running kernel found"
-+		fi
 +		if ! rm -f $DEVICE; then
 +		    failure "Cannot remove $DEVICE"
 +		fi
-+	        if ! modprobe vboxdrv > /dev/null 2>&1; then
-+        	    failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
++		if ! modprobe -n -q vboxdrv; then
++        	    failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why."
 +		fi
 +	else
 +		succ_msg
 +		return
          fi
++	# Why is sleep used here (in case of error)?
          sleep .2
      fi
-@@ -184,8 +191,10 @@
+     # ensure the character special exists
+@@ -184,8 +189,10 @@
          rmmod vboxdrv 2>/dev/null
          failure "Cannot change owner $GROUPNAME for device $DEVICE"
      fi

Reply via email to