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

96 lines
2.9 KiB
Diff

Index: src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- src/VBox/Additions/linux/installer/vboxadd.sh.orig
+++ src/VBox/Additions/linux/installer/vboxadd.sh
@@ -21,11 +21,12 @@
#
### 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
PATH=$PATH:/bin:/sbin:/usr/sbin
@@ -255,12 +256,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
@@ -271,12 +266,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
}
@@ -284,6 +273,13 @@ do_vboxguest_non_udev()
start()
{
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
+
uname -r | grep -q -E '^2\.6|^3' 2>/dev/null &&
ps -A -o comm | grep -q '/*udevd$' 2>/dev/null ||
no_udev=1
@@ -491,32 +487,8 @@ 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
-
- 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