Greetings,

Please find in the patch attached...

Module related changes to installation files and init.d script.

    - postinst: Compile modules at installation
      time in init script.

    - prerm: Remove modules when package is removed.

Declaration:
- This is my own work.
- Made available under the MIT license
  http://www.virtualbox.org/wiki/MIT license
diff --git a/debian/changelog b/debian/changelog
index a46ce75..cc72018 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,39 @@
+virtualbox-ose (2.2.51~svn-1~ps5) unstable; urgency=low
+
+  * Drive compilation of module code from init script.
+
+ -- Paul Schulz <[email protected]>  Tue, 26 May 2009 16:59:34 +0930
+
+virtualbox-ose (2.2.51~svn-1~ps4) unstable; urgency=low
+
+  * Remove compiled modules when package is removed.
+
+ -- Paul Schulz <[email protected]>  Tue, 26 May 2009 15:51:01 +0930
+
+virtualbox-ose (2.2.51~svn-1~ps3) unstable; urgency=low
+
+  * Updated from SVN. r19980
+
+ -- Paul Schulz <[email protected]>  Mon, 25 May 2009 23:42:11 +0930
+
+virtualbox-ose (2.2.51~svn-1~ps2) unstable; urgency=low
+
+  * rebuild Debian package
+
+ -- Paul Schulz <[email protected]>  Tue, 19 May 2009 12:03:27 +0930
+
 virtualbox-ose (2.2.51~svn-1) unstable; urgency=low
 
   * rebuild Debian package
 
  -- Sun Microsystems, Inc. <[email protected]>  Sun, 17 May 2009 20:00:00 +0200
 
+virtualbox-ose (2.2.51~svn-1~ps1) unstable; urgency=low
+
+  * rebuild Debian package
+
+ -- Paul Schulz <[email protected]>  Sun, 17 May 2009 18:15:17 +0930
+
 virtualbox-ose (2.2.1~svn-1) unstable; urgency=low
 
   * rebuild Debian package
diff --git a/debian/postinst b/debian/postinst
index 07d7172..e644b54 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -51,68 +51,6 @@ db_input high virtualbox/group-vboxusers || true
 db_go || true
 addgroup --system vboxusers
 
-if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
-  db_get virtualbox/module-compilation-allowed
-  if [ "$RET" = "false" ]; then
-    cat << EOF
-Unable to find a precompiled module for the current kernel
-though module compilation denied by debconf setting.
-EOF
-  else
-    db_input critical virtualbox/module-compilation-allowed || true
-    db_go || true
-    db_get virtualbox/module-compilation-allowed
-    if [ "$RET" = "true" ]; then
-      # Compile module. Don't show a message box here if everything works well.
-      cat << EOF
-Messages emitted during module compilation will be logged to $LOG.
-EOF
-      rm -f /etc/vbox/module_not_compiled
-      echo "** Compiling vboxdrv" > /var/log/vbox-install.log
-      if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
-          --save-module-symvers /tmp/vboxdrv-Module.symvers \
-          --no-print-directory KBUILD_VERBOSE= \
-          install >> /var/log/vbox-install.log 2>&1; then
-        db_fset virtualbox/module-compilation-failed seen false
-        db_input critical virtualbox/module-compilation-failed || true
-        db_go || true
-        touch /etc/vbox/module_not_compiled
-        # don't abort the installation!
-      else
-        echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
-        if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
-            --use-module-symvers /tmp/vboxdrv-Module.symvers \
-            --no-print-directory KBUILD_VERBOSE= \
-            install >> /var/log/vbox-install.log 2>&1; then
-          db_fset virtualbox/module-compilation-failed seen false
-          db_input critical virtualbox/module-compilation-failed || true
-          db_go || true
-          touch /etc/vbox/module_not_compiled
-          # don't abort the installation!
-        else
-          echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
-          if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
-              --use-module-symvers /tmp/vboxdrv-Module.symvers \
-              --no-print-directory KBUILD_VERBOSE= \
-              install >> /var/log/vbox-install.log 2>&1; then
-            db_fset virtualbox/module-compilation-failed seen false
-            db_input critical virtualbox/module-compilation-failed || true
-            db_go || true
-            touch /etc/vbox/module_not_compiled
-            # don't abort the installation!
-          fi
-        fi
-      fi
-      if [ ! -f /etc/vbox/module_not_compiled ]; then
-        # success
-        cat << EOF
-Success!
-EOF
-      fi
-    fi
-  fi
-fi
-
 # There might be an old module active (e.g. manually loaded)
 if lsmod | grep -q "vboxdrv[^_-]"; then
   /etc/init.d/vboxdrv stop || true
@@ -136,6 +74,10 @@ if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetAdpCtl > /dev/null 2>&1
   chmod 4511 /usr/lib/virtualbox/VBoxNetAdpCtl
 fi
 
+if [ -x "/etc/init.d/vboxdrv" ]; then
+    /etc/init.d/vboxdrv setup || exit $?
+fi
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/prerm b/debian/prerm
index 622617b..3c50032 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -4,6 +4,10 @@ rm -f /etc/udev/rules.d/60-vboxdrv.rules
 rm -f /etc/vbox/license_agreed
 rm -f /etc/vbox/module_not_compiled
 
+rm -f /lib/modules/`uname -r`/misc/vboxdrv.ko
+rm -f /lib/modules/`uname -r`/misc/vboxnetflt.ko
+rm -f /lib/modules/`uname -r`/misc/vboxnetadp.ko
+
 #DEBHELPER#
 
 exit 0
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to