A new user interface for you! Read more...

File vbox-vboxadd-init-script.diff of Package virtualbox-5.0

Index: VirtualBox-5.0.28/src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- VirtualBox-5.0.28.orig/src/VBox/Additions/linux/installer/vboxadd.sh
+++ VirtualBox-5.0.28/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -23,9 +23,12 @@
 # Provides:       vboxadd
 # Required-Start:
 # Required-Stop:
-# Default-Start:  2 3 4 5
+# Should-Start:   $remote_fs
+# Should-Stop:    $remote_fs
+# Default-Start:  2 3 5
 # Default-Stop:   0 1 6
 # Description:    VirtualBox Linux Additions kernel modules
+# Short-Description: VirtualBox Linux Additions kernel modules
 ### END INIT INFO
 
 PATH=$PATH:/bin:/sbin:/usr/sbin
@@ -154,7 +157,6 @@ fail()
 
 dev=/dev/vboxguest
 userdev=/dev/vboxuser
-config=/var/lib/VBoxGuestAdditions/config
 owner=vboxadd
 group=1
 
@@ -232,12 +234,6 @@ do_vboxguest_non_udev()
             fail "Cannot create device $dev with major $maj and minor $min"
         }
     fi
-    chown $owner:$group $dev 2>/dev/null || {
-        rm -f $dev 2>/dev/null
-        rm -f $userdev 2>/dev/null
-        rmmod vboxguest 2>/dev/null
-        fail "Cannot change owner $owner:$group for device $dev"
-    }
 
     if [ ! -c $userdev ]; then
         maj=10
@@ -248,12 +244,6 @@ do_vboxguest_non_udev()
                 rmmod vboxguest 2>/dev/null
                 fail "Cannot create device $userdev with major $maj and minor $min"
             }
-            chown $owner:$group $userdev 2>/dev/null || {
-                rm -f $dev 2>/dev/null
-                rm -f $userdev 2>/dev/null
-                rmmod vboxguest 2>/dev/null
-                fail "Cannot change owner $owner:$group for device $userdev"
-            }
         fi
     fi
 }
@@ -261,13 +251,6 @@ do_vboxguest_non_udev()
 start()
 {
     begin "Starting the VirtualBox Guest Additions ";
-    if test -r $config; then
-      . $config
-    else
-      fail "Configuration file $config not found"
-    fi
-    test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
-      fail "Configuration file $config not complete"
     uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null &&
         ps -A -o comm | grep -q '/*udevd$' 2>/dev/null ||
         no_udev=1
@@ -304,7 +287,7 @@ start()
     }
 
     # Put the X.Org driver in place.  This is harmless if it is not needed.
-    /sbin/rcvboxadd-x11 setup
+#    /sbin/rcvboxadd-x11 setup
     # Install the guest OpenGL drivers.  For now we don't support
     # multi-architecture installations
     rm -f /etc/ld.so.conf.d/00vboxvideo.conf
@@ -505,13 +488,14 @@ extra_setup()
         ## @todo 60-vboxadd.rules -> 60-vboxguest.rules ?
         echo "KERNEL=${udev_fix}\"vboxguest\", NAME=\"vboxguest\", OWNER=\"vboxadd\", MODE=\"0660\"" > /etc/udev/rules.d/60-vboxadd.rules
         echo "KERNEL=${udev_fix}\"vboxuser\", NAME=\"vboxuser\", OWNER=\"vboxadd\", MODE=\"0666\"" >> /etc/udev/rules.d/60-vboxadd.rules
+        echo "KERNEL=${udev_fix}\"vboxsf\", NAME=\"vboxsf\", OWNER=\"vboxadd\", MODE=\"0666\"" >> /etc/udev/rules.d/60-vboxadd.rules
     fi
 
     # Put mount.vboxsf in the right place
     ln -sf "$lib_path/$PACKAGE/mount.vboxsf" /sbin
     # And an rc file to re-build the kernel modules and re-set-up the X server.
     ln -sf "$lib_path/$PACKAGE/vboxadd" /sbin/rcvboxadd
-    ln -sf "$lib_path/$PACKAGE/vboxadd-x11" /sbin/rcvboxadd-x11
+#    ln -sf "$lib_path/$PACKAGE/vboxadd-x11" /sbin/rcvboxadd-x11
     # SELinux security context for the mount helper.
     if test -e /etc/selinux/config; then
         # This is correct.  semanage maps this to the real path, and it aborts
@@ -527,49 +511,13 @@ extra_setup()
 # setup_script
 setup()
 {
-    if test -r $config; then
-      . $config
-    else
-      fail "Configuration file $config not found"
-    fi
-    test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
-      fail "Configuration file $config not complete"
-    export BUILD_TYPE
-    export USERNAME
-
-    rm -f $LOG
-    MODULE_SRC="$INSTALL_DIR/src/vboxguest-$INSTALL_VER"
-    BUILDINTMP="$MODULE_SRC/build_in_tmp"
-    DODKMS="$MODULE_SRC/do_dkms"
-    chcon -t bin_t "$BUILDINTMP" > /dev/null 2>&1
-    chcon -t bin_t "$DODKMS"     > /dev/null 2>&1
-
-    setup_modules
-    mod_succ="$?"
-    extra_setup
-    if [ "$mod_succ" -eq "0" ]; then
-        if running_vboxguest || running_vboxadd; then
-            printf "You should restart your guest to make sure the new modules are actually used\n\n"
-        else
-            start
-        fi
-    fi
+    begin "Recompiling VirtualBox kernel module, NOT. It has been packaged."
+    succ_msg
 }
 
 # cleanup_script
 cleanup()
 {
-    if test -r $config; then
-      . $config
-      test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
-        fail "Configuration file $config not complete"
-      DODKMS="$INSTALL_DIR/src/vboxguest-$INSTALL_VER/do_dkms"
-    elif test -x ./do_dkms; then  # Executing as part of the installer...
-      DODKMS=./do_dkms
-    else
-      fail "Configuration file $config not found"
-    fi
-
     # Delete old versions of VBox modules.
     cleanup_modules
     for i in /lib/modules/*; do
@@ -582,12 +530,12 @@ cleanup()
     done
 
     # Clean-up X11-related bits
-    /sbin/rcvboxadd-x11 cleanup
+#    /sbin/rcvboxadd-x11 cleanup
 
     # Remove other files
     rm /sbin/mount.vboxsf 2>/dev/null
     rm /sbin/rcvboxadd 2>/dev/null
-    rm /sbin/rcvboxadd-x11 2>/dev/null
+#    rm /sbin/rcvboxadd-x11 2>/dev/null
     rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
     rm -f /lib/modules/*/initrd/vboxvideo
 }