2013-09-15 19:19:55 +02:00
|
|
|
Index: src/VBox/Additions/linux/installer/vboxadd.sh
|
|
|
|
===================================================================
|
2010-12-23 11:08:49 +01:00
|
|
|
--- src/VBox/Additions/linux/installer/vboxadd.sh.orig
|
|
|
|
+++ src/VBox/Additions/linux/installer/vboxadd.sh
|
2013-03-03 11:58:46 +01:00
|
|
|
@@ -21,11 +21,12 @@
|
2010-12-23 11:08:49 +01:00
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: vboxadd
|
|
|
|
-# Required-Start:
|
|
|
|
-# Required-Stop:
|
|
|
|
-# Default-Start: 2 3 4 5
|
|
|
|
+# Required-Start: $remote_fs
|
|
|
|
+# Required-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
|
|
|
|
|
2012-10-02 16:03:09 +02:00
|
|
|
PATH=$PATH:/bin:/sbin:/usr/sbin
|
2013-03-03 11:58:46 +01:00
|
|
|
@@ -255,12 +256,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
|
2013-03-03 11:58:46 +01:00
|
|
|
@@ -271,12 +266,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
|
|
|
|
}
|
2013-03-03 11:58:46 +01:00
|
|
|
@@ -284,6 +273,13 @@ do_vboxguest_non_udev()
|
2012-10-02 16:03:09 +02:00
|
|
|
start()
|
2013-03-03 11:58:46 +01:00
|
|
|
{
|
|
|
|
begin "Starting the VirtualBox Guest Additions ";
|
|
|
|
+
|
|
|
|
+ if [ -x /usr/bin/systemd-detect-virt ]; then
|
|
|
|
+ if [ "x$(systemd-detect-virt)" != "xoracle" ]; then
|
|
|
|
+ fail "Not running on a virtualbox guest"
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+
|
2013-09-15 19:19:55 +02:00
|
|
|
uname -r | grep -q -E '^2\.6|^3' 2>/dev/null &&
|
2013-03-03 11:58:46 +01:00
|
|
|
ps -A -o comm | grep -q '/*udevd$' 2>/dev/null ||
|
|
|
|
no_udev=1
|
|
|
|
@@ -491,32 +487,8 @@ extra_setup()
|
2011-01-19 14:48:53 +01:00
|
|
|
# setup_script
|
|
|
|
setup()
|
|
|
|
{
|
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
|
|
|
|
-
|
|
|
|
- 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
|
|
|
|
-
|
2011-01-19 14:48:53 +01:00
|
|
|
- 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
|
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
|