Index: /trunk/src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- /trunk/src/VBox/Additions/linux/installer/vboxadd.sh	(revision 61259)
+++ /trunk/src/VBox/Additions/linux/installer/vboxadd.sh	(revision 61260)
@@ -39,4 +39,10 @@
 SCRIPTNAME=vboxadd.sh
 QUICKSETUP=
+
+# These are getting hard-coded in more and more places...
+test -z "${KERN_DIR}" && KERN_DIR="/lib/modules/`uname -r`/build"
+test -z "${MODULE_DIR}" && MODULE_DIR="/lib/modules/`uname -r`/misc"
+KERN_DIR_SUFFIX="${KERN_DIR#/lib/modules/}"
+KERN_VER="${KERN_DIR_SUFFIX%/*}"
 
 if $MODPROBE -c 2>/dev/null | grep -q '^allow_unsupported_modules  *0'; then
@@ -283,4 +289,24 @@
 }
 
+## Update the initramfs.  Debian and Ubuntu put the graphics driver in, and
+# need the touch(1) command below.  Everyone else that I checked just need
+# the right module alias file from depmod(1) and only use the initramfs to
+# load the root filesystem, not the boot splash.  update-initramfs works
+# for the first two and dracut for every one else I checked.  We are only
+# interested in distributions recent enough to use the KMS vboxvideo driver.
+## @param $1  kernel version to update for.
+update_module_dependencies()
+{
+    depmod "${1}"
+    test -d "/lib/modules/${1}/initrd" &&
+        touch "/lib/modules/${1}/initrd/vboxvideo"
+    test -n "${QUICKSETUP}" && return
+    if type dracut >/dev/null 2>&1; then
+        dracut -f "/boot/initramfs-${1}.img"
+    elif type update-initramfs >/dev/null 2>&1; then
+        update-initramfs -u -k "${1}"
+    fi
+}
+
 # Remove any existing VirtualBox guest kernel modules from the disk, but not
 # from the kernel as they may still be in use
@@ -337,5 +363,5 @@
     fi
     succ_msg
-    depmod
+    update_module_dependencies "${KERN_VER}"
     return 0
 }
@@ -472,5 +498,7 @@
     # Delete old versions of VBox modules.
     cleanup_modules
-    depmod
+    for i in /lib/modules/*; do
+        update_module_dependencies "${i#/lib/modules}"
+    done
 
     # Remove old module sources
@@ -489,4 +517,5 @@
     rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null
     rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
+    rm -f /lib/modules/*/initrd/vboxvideo
 }
 
