1
0
forked from pool/virtualbox
virtualbox/vbox-vboxadd-init-script.diff
2012-05-15 12:27:37 +00:00

115 lines
3.3 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,14 +21,18 @@
#
### 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
-. /var/lib/VBoxGuestAdditions/config
+if [ -f /var/lib/VBoxGuestAdditions/config ]; then
+ . /var/lib/VBoxGuestAdditions/config
+fi
+
export BUILD_TYPE
export USERNAME
@@ -169,8 +173,6 @@ fi
dev=/dev/vboxguest
userdev=/dev/vboxuser
-owner=vboxadd
-group=1
test_for_gcc_and_make()
{
@@ -256,12 +258,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
@@ -272,12 +268,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
}
@@ -308,8 +298,7 @@ start()
do_vboxguest_non_udev;;
esac
- if [ -n "$BUILDVBOXSF" ]; then
- running_vboxsf || {
+ running_vboxsf || {
$MODPROBE vboxsf > /dev/null 2>&1 || {
if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then
fail_msg
@@ -319,8 +308,7 @@ start()
fi
fail "modprobe vboxsf failed"
}
- }
- fi
+ }
# Mount all shared folders from /etc/fstab. Normally this is done by some
# other startup script but this requires the vboxdrv kernel module loaded.
@@ -337,10 +325,8 @@ stop()
if ! umount -a -t vboxsf 2>/dev/null; then
fail "Cannot unmount vboxsf folders"
fi
- if [ -n "$BUILDVBOXSF" ]; then
- if running_vboxsf; then
- rmmod vboxsf 2>/dev/null || fail "Cannot unload module vboxsf"
- fi
+ if running_vboxsf; then
+ rmmod vboxsf 2>/dev/null || fail "Cannot unload module vboxsf"
fi
if running_vboxguest; then
rmmod vboxguest 2>/dev/null || fail "Cannot unload module vboxguest"
@@ -500,16 +486,8 @@ extra_setup()
# setup_script
setup()
{
- 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