2016-07-26 18:15:55 +02:00
|
|
|
Index: VirtualBox-5.1.2/src/VBox/Additions/linux/installer/vboxadd.sh
|
2016-05-16 23:36:43 +02:00
|
|
|
===================================================================
|
2016-07-26 18:15:55 +02:00
|
|
|
--- VirtualBox-5.1.2.orig/src/VBox/Additions/linux/installer/vboxadd.sh
|
|
|
|
+++ VirtualBox-5.1.2/src/VBox/Additions/linux/installer/vboxadd.sh
|
2016-01-14 17:37:33 +01:00
|
|
|
@@ -23,9 +23,12 @@
|
2010-12-23 11:08:49 +01:00
|
|
|
# Provides: vboxadd
|
2016-01-14 17:37:33 +01:00
|
|
|
# Required-Start:
|
|
|
|
# Required-Stop:
|
2010-12-23 11:08:49 +01:00
|
|
|
-# Default-Start: 2 3 4 5
|
2016-01-14 17:37:33 +01:00
|
|
|
+# Should-Start: $remote_fs
|
|
|
|
+# Should-Stop: $remote_fs
|
2010-12-23 11:08:49 +01:00
|
|
|
+# 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
|
|
|
|
|
2016-07-26 18:15:55 +02:00
|
|
|
## @todo This file duplicates a lot of script with vboxdrv.sh. When making
|
|
|
|
@@ -100,7 +103,6 @@ fail()
|
2016-05-16 23:36:43 +02:00
|
|
|
|
|
|
|
dev=/dev/vboxguest
|
|
|
|
userdev=/dev/vboxuser
|
|
|
|
-config=/var/lib/VBoxGuestAdditions/config
|
|
|
|
owner=vboxadd
|
|
|
|
group=1
|
|
|
|
|
2016-07-26 18:15:55 +02:00
|
|
|
@@ -146,12 +148,6 @@ do_vboxguest_non_udev()
|
2010-12-23 11:08:49 +01:00
|
|
|
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
|
2016-07-26 18:15:55 +02:00
|
|
|
@@ -162,12 +158,6 @@ do_vboxguest_non_udev()
|
2010-12-23 11:08:49 +01:00
|
|
|
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
|
|
|
|
}
|
2016-07-26 18:15:55 +02:00
|
|
|
@@ -177,13 +167,6 @@ start()
|
|
|
|
begin "Starting the VirtualBox Guest Additions" console;
|
|
|
|
# If we got this far assume that the slow set-up has been done.
|
|
|
|
QUICKSETUP=yes
|
2016-05-16 23:36:43 +02:00
|
|
|
- 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"
|
2015-05-15 17:49:23 +02:00
|
|
|
uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null &&
|
2013-03-03 11:58:46 +01:00
|
|
|
ps -A -o comm | grep -q '/*udevd$' 2>/dev/null ||
|
|
|
|
no_udev=1
|
2016-07-26 18:15:55 +02:00
|
|
|
@@ -199,7 +182,7 @@ start()
|
|
|
|
$MODPROBE vboxguest >/dev/null 2>&1 || {
|
|
|
|
setup
|
|
|
|
$MODPROBE vboxguest >/dev/null 2>&1 || {
|
|
|
|
- /sbin/rcvboxadd-x11 cleanup
|
|
|
|
+ #/sbin/rcvboxadd-x11 cleanup
|
|
|
|
fail "modprobe vboxguest failed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -223,7 +206,7 @@ start()
|
|
|
|
}
|
2016-05-16 23:36:43 +02:00
|
|
|
|
|
|
|
# Put the X.Org driver in place. This is harmless if it is not needed.
|
|
|
|
- /sbin/rcvboxadd-x11 setup
|
2016-07-26 18:15:55 +02:00
|
|
|
+ #/sbin/rcvboxadd-x11 setup
|
2016-05-16 23:36:43 +02:00
|
|
|
# Install the guest OpenGL drivers. For now we don't support
|
|
|
|
# multi-architecture installations
|
2016-07-26 18:15:55 +02:00
|
|
|
rm -f /etc/ld.so.conf.d/00vboxvideo.conf
|
|
|
|
@@ -424,7 +407,7 @@ extra_setup()
|
2016-05-16 23:36:43 +02:00
|
|
|
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
|
2016-07-26 18:15:55 +02:00
|
|
|
+ #ln -sf "$lib_path/$PACKAGE/vboxadd-x11" /sbin/rcvboxadd-x11
|
|
|
|
# And a post-installation script for rebuilding modules when a new kernel
|
|
|
|
# is installed.
|
|
|
|
mkdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d
|
|
|
|
@@ -457,49 +440,13 @@ EOF
|
2011-01-19 14:48:53 +01:00
|
|
|
# setup_script
|
|
|
|
setup()
|
|
|
|
{
|
2016-07-26 18:15:55 +02:00
|
|
|
- begin "Building Guest Additions kernel modules" console
|
2012-10-02 16:03:09 +02:00
|
|
|
- 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
|
|
|
|
-
|
2015-12-27 10:25:33 +01:00
|
|
|
- rm -f $LOG
|
2012-10-02 16:03:09 +02:00
|
|
|
- MODULE_SRC="$INSTALL_DIR/src/vboxguest-$INSTALL_VER"
|
|
|
|
- BUILDINTMP="$MODULE_SRC/build_in_tmp"
|
|
|
|
- chcon -t bin_t "$BUILDINTMP" > /dev/null 2>&1
|
|
|
|
-
|
2016-07-26 18:15:55 +02:00
|
|
|
- if setup_modules; then
|
|
|
|
- mod_succ=0
|
|
|
|
- else
|
|
|
|
- mod_succ=1
|
|
|
|
- show_error "Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed."
|
|
|
|
- fi
|
|
|
|
- test -n "${QUICKSETUP}" && return "${mod_succ}"
|
2011-01-19 14:48:53 +01:00
|
|
|
- extra_setup
|
|
|
|
- if [ "$mod_succ" -eq "0" ]; then
|
|
|
|
- if running_vboxguest || running_vboxadd; then
|
2016-07-26 18:15:55 +02:00
|
|
|
- begin "You should restart your guest to make sure the new modules are actually used" console
|
2011-01-19 14:48:53 +01:00
|
|
|
- fi
|
|
|
|
- fi
|
2016-07-26 18:15:55 +02:00
|
|
|
- return "${mod_succ}"
|
2012-10-02 16:03:09 +02:00
|
|
|
+ begin "Recompiling VirtualBox kernel module, NOT. It has been packaged."
|
2011-01-19 14:48:53 +01:00
|
|
|
+ succ_msg
|
|
|
|
}
|
|
|
|
|
|
|
|
# cleanup_script
|
2016-05-16 23:36:43 +02:00
|
|
|
cleanup()
|
|
|
|
{
|
|
|
|
- if test -r $config; then
|
|
|
|
- . $config
|
|
|
|
- test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
|
|
|
|
- fail "Configuration file $config not complete"
|
|
|
|
- else
|
|
|
|
- fail "Configuration file $config not found"
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
# Delete old versions of VBox modules.
|
|
|
|
cleanup_modules
|
2016-07-26 18:15:55 +02:00
|
|
|
for i in /lib/modules/*; do
|
|
|
|
@@ -512,12 +459,12 @@ cleanup()
|
2016-05-16 23:36:43 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# Clean-up X11-related bits
|
|
|
|
- /sbin/rcvboxadd-x11 cleanup
|
2016-07-26 18:15:55 +02:00
|
|
|
+ #/sbin/rcvboxadd-x11 cleanup
|
2016-05-16 23:36:43 +02:00
|
|
|
|
|
|
|
# Remove other files
|
|
|
|
rm /sbin/mount.vboxsf 2>/dev/null
|
|
|
|
rm /sbin/rcvboxadd 2>/dev/null
|
|
|
|
- rm /sbin/rcvboxadd-x11 2>/dev/null
|
2016-07-26 18:15:55 +02:00
|
|
|
+ #rm /sbin/rcvboxadd-x11 2>/dev/null
|
|
|
|
rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd
|
|
|
|
rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null
|
2016-05-16 23:36:43 +02:00
|
|
|
rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
|