1
0
forked from pool/virtualbox
virtualbox/vbox-vboxadd-init-script.diff
2012-10-02 14:03:09 +00:00

97 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
@@ -19,15 +19,16 @@
# chkconfig: 357 30 70
# description: VirtualBox Linux Additions kernel modules
#
### 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
PACKAGE=VBoxGuestAdditions
LOG="/var/log/vboxadd-install.log"
@@ -248,32 +249,20 @@ do_vboxguest_non_udev()
mknod -m 0664 $dev c $maj $min || {
rmmod vboxguest 2>/dev/null
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
min=`sed -n 's;\([0-9]\+\) vboxuser;\1;p' /proc/misc`
if [ ! -z "$min" ]; then
mknod -m 0666 $userdev c $maj $min || {
rm -f $dev 2>/dev/null
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
}
start()
@@ -478,36 +467,12 @@ 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
cleanup()
{