Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2
virtualbox-ose
virtualbox-ose-init-scripts.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File virtualbox-ose-init-scripts.diff of Package virtualbox-ose
Index: src/VBox/Additions/linux/installer/vboxadd.sh =================================================================== --- src/VBox/Additions/linux/installer/vboxadd.sh.orig +++ src/VBox/Additions/linux/installer/vboxadd.sh @@ -28,14 +28,9 @@ # Default-Start: 2 3 4 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 -BUILDVBOXADD=`/bin/ls /usr/src/vboxadd*/build_in_tmp 2>/dev/null|cut -d' ' -f1` -BUILDVBOXVFS=`/bin/ls /usr/src/vboxvfs*/build_in_tmp 2>/dev/null|cut -d' ' -f1` -BUILDVBOXVIDEO=`/bin/ls /usr/src/vboxvideo*/build_in_tmp 2>/dev/null|cut -d' ' -f1` -LOG="/var/log/vboxadd-install.log" - if [ -f /etc/arch-release ]; then system=arch elif [ -f /etc/redhat-release ]; then @@ -143,8 +138,6 @@ dev=/dev/vboxadd userdev=/dev/vboxuser -owner=vboxadd -group=1 fail() { @@ -204,12 +197,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 vboxadd 2>/dev/null - fail "Cannot change owner $owner:$group for device $dev" - } if [ ! -c $userdev ]; then maj=10 @@ -220,28 +207,20 @@ rmmod vboxadd 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 vboxadd 2>/dev/null - fail "Cannot change owner $owner:$group for device $userdev" - } fi fi - if [ -n "$BUILDVBOXVFS" ]; then - running_vboxvfs || { - modprobe vboxvfs > /dev/null 2>&1 || { - if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then - fail_msg - echo "Unable to start shared folders support. Make sure that your VirtualBox build" - echo "supports this feature." - exit 1 - fi - fail "modprobe vboxvfs failed" - } + running_vboxvfs || { + modprobe vboxvfs > /dev/null 2>&1 || { + if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then + fail_msg + echo "Unable to start shared folders support. Make sure that your VirtualBox build" + echo "supports this feature." + exit 1 + fi + fail "modprobe vboxvfs 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. @@ -254,14 +233,14 @@ stop() { begin "Stopping VirtualBox Additions "; - if !umount -a -t vboxsf 2>/dev/null; then + if ! umount -a -t vboxsf 2>/dev/null; then fail "Cannot unmount vboxsf folders" fi - if [ -n "$BUILDVBOXVFS" ]; then - if running_vboxvfs; then + + if running_vboxvfs; then rmmod vboxvfs 2>/dev/null || fail "Cannot unload module vboxvfs" - fi fi + if running_vboxadd; then rmmod vboxadd 2>/dev/null || fail "Cannot unload module vboxadd" rm -f $userdev || fail "Cannot unlink $userdev" @@ -279,40 +258,10 @@ setup() { - # don't stop the old modules here -- they might be in use - if find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|grep -q vboxvfs; then - begin "Removing old VirtualBox vboxvfs kernel module" - find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|xargs rm -f 2>/dev/null - succ_msg - fi - if find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|grep -q vboxadd; then - begin "Removing old VirtualBox vboxadd kernel module" - find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|xargs rm -f 2>/dev/null - succ_msg - fi - begin "Recompiling VirtualBox kernel modules" - if ! $BUILDVBOXADD \ - --save-module-symvers /tmp/vboxadd-Module.symvers \ - --no-print-directory install > $LOG 2>&1; then - fail "Look at $LOG to find out what went wrong" - fi - if [ -n "$BUILDVBOXVFS" ]; then - if ! $BUILDVBOXVFS \ - --use-module-symvers /tmp/vboxadd-Module.symvers \ - --no-print-directory install >> $LOG 2>&1; then - fail "Look at $LOG to find out what went wrong" - fi - fi - if [ -n "$BUILDVBOXVIDEO" ]; then - if ! $BUILDVBOXVIDEO \ - --use-module-symvers /tmp/vboxadd-Module.symvers \ - --no-print-directory install >> $LOG 2>&1; then - fail "Look at $LOG to find out what went wrong" - fi - fi + # don't restart the module + begin_msg "Recompiling VirtualBox vboxadd kernel module, NOT. It has been packaged." + begin_msg "Recompiling VirtualBox vboxvfs kernel module, NOT. It has been packaged." succ_msg - start - echo echo "You should reboot your guest to make sure the new modules are actually used" } @@ -325,6 +274,16 @@ fi } +reload() +{ + if [ "$system" = "suse" ]; then + rc_failed 3 + rc_status -v + else + exit 3 + fi +} + case "$1" in start) start @@ -341,8 +300,11 @@ status) dmnstatus ;; +reload) + reload + ;; *) - echo "Usage: $0 {start|stop|restart|status}" + echo "Usage: $0 {start|stop|restart|status|reload}" exit 1 esac Index: src/VBox/Installer/linux/vboxdrv.sh.in =================================================================== --- src/VBox/Installer/linux/vboxdrv.sh.in.orig +++ src/VBox/Installer/linux/vboxdrv.sh.in @@ -19,121 +19,45 @@ # ### BEGIN INIT INFO # Provides: vboxdrv -# Required-Start: $syslog -# Required-Stop: +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: VirtualBox Linux kernel module +# Description: VirtualBox Linux kernel module ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH DEVICE=/dev/vboxdrv GROUPNAME=vboxusers LOG="/var/log/vbox-install.log" -NOLSB=%NOLSB% [ -f /lib/lsb/init-functions ] || NOLSB=yes [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg -if [ -n "$INSTALL_DIR" ]; then - VBOXMANAGE="$INSTALL_DIR/VBoxManage" - BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp" - BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp" - BUILDVBOXNETADP="$INSTALL_DIR/src/vboxnetadp/build_in_tmp" -else - VBOXMANAGE="/usr/lib/%PACKAGE%/VBoxManage" - BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxdrv/build_in_tmp" - BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxnetflt/build_in_tmp" - BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxnetadp/build_in_tmp" -fi - -if [ -n "$NOLSB" ]; then - if [ -f /etc/redhat-release ]; then - system=redhat - elif [ -f /etc/SuSE-release ]; then - system=suse - elif [ -f /etc/gentoo-release ]; then - system=gentoo - fi -fi +VBOXMANAGE="$INSTALL_DIR/VBoxManage" -[ -r /etc/default/%PACKAGE% ] && . /etc/default/%PACKAGE% +[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox -if [ -z "$NOLSB" ]; then - . /lib/lsb/init-functions - fail_msg() { - echo "" - log_failure_msg "$1" - } - succ_msg() { - log_success_msg " done." - } - begin_msg() { - log_daemon_msg "$@" - } -else - if [ "$system" = "redhat" ]; then - . /etc/init.d/functions - fail_msg() { - echo -n " " - echo_failure - echo - echo " ($1)" - } - succ_msg() { - echo -n " " - echo_success - echo - } - elif [ "$system" = "suse" ]; then - . /etc/rc.status - fail_msg() { - rc_failed 1 - rc_status -v - echo " ($1)" - } - succ_msg() { - rc_reset - rc_status -v - } - elif [ "$system" = "gentoo" ]; then - if [ -f /sbin/functions.sh ]; then - . /sbin/functions.sh - elif [ -f /etc/init.d/functions.sh ]; then - . /etc/init.d/functions.sh - fi - fail_msg() { - eerror "$1" - } - succ_msg() { - eend "$?" - } - begin_msg() { - ebegin "$1" - } - if [ "`which $0`" = "/sbin/rc" ]; then - shift - fi +. /etc/rc.status + +fail_msg() { + rc_failed 1 + rc_status -v + echo " ($1)" +} +succ_msg() { + rc_reset + rc_status -v +} +begin_msg() { + [ -z "${1:-}" ] && return 1 + if [ -z "${2:-}" ]; then + echo -n "$1" else - fail_msg() { - echo " ...failed!" - echo " ($1)" - } - succ_msg() { - echo " ...done." - } - fi - if [ "$system" != "gentoo" ]; then - begin_msg() { - [ -z "${1:-}" ] && return 1 - if [ -z "${2:-}" ]; then - echo -n "$1" - else - echo -n "$1: $2" - fi - } + echo -n "$1: $2" fi -fi +} failure() { @@ -182,13 +106,6 @@ failure "Cannot create device $DEVICE with major $MAJOR and minor $MINOR" fi fi - # ensure permissions - if ! chown :$GROUPNAME $DEVICE 2>/dev/null; then - rmmod vboxnetadp 2>/dev/null - rmmod vboxnetflt 2>/dev/null - rmmod vboxdrv 2>/dev/null - failure "Cannot change owner $GROUPNAME for device $DEVICE" - fi if ! modprobe vboxnetflt > /dev/null 2>&1; then failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why" fi @@ -222,7 +139,7 @@ succ_msg } -# enter the following variables in /etc/default/%PACKAGE%: +# enter the following variables in /etc/default/virtualbox # SHUTDOWN_USERS="foo bar" # check for running VMs of user foo and user bar # SHUTDOWN=poweroff @@ -272,38 +189,8 @@ setup() { stop - if find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|grep -q vboxnetadp; then - begin_msg "Removing old VirtualBox netadp kernel module" - find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2>/dev/null - succ_msg - fi - if find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|grep -q vboxnetflt; then - begin_msg "Removing old VirtualBox netflt kernel module" - find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null - succ_msg - fi - if find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then - begin_msg "Removing old VirtualBox kernel module" - find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null - succ_msg - fi - begin_msg "Recompiling VirtualBox kernel module" - if ! $BUILDVBOXDRV \ - --save-module-symvers /tmp/vboxdrv-Module.symvers \ - --no-print-directory install > $LOG 2>&1; then - failure "Look at $LOG to find out what went wrong" - fi - if ! $BUILDVBOXNETFLT \ - --use-module-symvers /tmp/vboxdrv-Module.symvers \ - --no-print-directory install >> $LOG 2>&1; then - failure "Look at $LOG to find out what went wrong" - fi - if ! $BUILDVBOXNETADP \ - --use-module-symvers /tmp/vboxdrv-Module.symvers \ - --no-print-directory install >> $LOG 2>&1; then - failure "Look at $LOG to find out what went wrong" - fi - rm -f /etc/vbox/module_not_compiled + begin_msg "Recompiling VirtualBox kernel module, NOT. It has been packaged." + begin_msg "Recompiling VirtualBox netflt kernel module, NOT. It has been packaged." succ_msg start }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor