1
0
forked from pool/virtualbox
virtualbox/vbox-vboxadd-init-script.diff

93 lines
2.8 KiB
Diff
Raw Normal View History

--- src/VBox/Additions/linux/installer/vboxadd.sh.orig 2015-12-18 17:17:03.000000000 +0100
+++ src/VBox/Additions/linux/installer/vboxadd.sh 2016-01-14 15:45:13.793994484 +0100
@@ -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
@@ -224,12 +227,6 @@
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
@@ -240,12 +237,6 @@
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
}
@@ -260,6 +251,13 @@
fi
test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
fail "Configuration file $config not complete"
+
+ if [ -x /usr/bin/systemd-detect-virt ]; then
+ if [ "x$(systemd-detect-virt)" != "xoracle" ]; then
+ fail "Not running on a virtualbox guest"
+ fi
+ fi
+
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
@@ -470,33 +468,8 @@
# 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