- Timestamp:
- 02/05/09 01:38:24 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pkg/boss/main/virtualbox-ose/trunk/debian/patches/09-initscript.dpatch
r4744 r4946 6 6 @DPATCH@ 7 7 8 diff -Naurp virtualbox-ose-2. 0.4-dfsg.orig/src/VBox/Installer/linux/vboxnet.sh.in virtualbox-ose-2.0.4-dfsg/src/VBox/Installer/linux/vboxnet.sh.in9 --- virtualbox-ose-2. 0.4-dfsg.orig/src/VBox/Installer/linux/vboxnet.sh.in 2008-11-21 12:44:47.000000000 +000010 +++ virtualbox-ose-2. 0.4-dfsg/src/VBox/Installer/linux/vboxnet.sh.in 2008-11-21 12:45:40.000000000 +000011 @@ -3 4,7 +34,12@@12 TAPDEV="/dev/net/tun"8 diff -Naurp virtualbox-ose-2.1.0-dfsg.orig/src/VBox/Installer/linux/vboxdrv.sh.in virtualbox-ose-2.1.0-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in 9 --- virtualbox-ose-2.1.0-dfsg.orig/src/VBox/Installer/linux/vboxdrv.sh.in 2008-12-18 16:30:08.000000000 +0100 10 +++ virtualbox-ose-2.1.0-dfsg/src/VBox/Installer/linux/vboxdrv.sh.in 2008-12-18 16:36:51.000000000 +0100 11 @@ -32,6 +32,8 @@ 12 LOG="/var/log/vbox-install.log" 13 13 NOLSB=%NOLSB% 14 14 15 -[ -f /lib/lsb/init-functions ] || NOLSB=yes16 15 +# Include virtualbox-ose defaults if available 17 +if [ -f /etc/default/virtualbox-ose ] ; then 18 + . /etc/default/virtualbox-ose 19 +fi 20 + 21 +[ -f /lib/lsb/init-functions ] && NOLSB= 16 +[ -f /etc/default/virtualbox-ose ] && . /etc/default/virtualbox-ose 17 [ -f /lib/lsb/init-functions ] && NOLSB= 18 [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg 22 19 23 if [ -n "$NOLSB" ]; then 24 if [ -f /etc/redhat-release ]; then 25 @@ -168,13 +173,6 @@ 26 if ! VBoxTunctl -h 2>&1 | grep VBoxTunctl > /dev/null; then 27 failure "VBoxTunctl not found" 20 @@ -153,8 +155,10 @@ 21 if ! rm -f $DEVICE; then 22 failure "Cannot remove $DEVICE" 23 fi 24 - if ! modprobe vboxdrv > /dev/null 2>&1; then 25 - failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why" 26 + if [ "$LOAD_VBOXDRV_MODULE" = 1 ]; then 27 + if ! modprobe vboxdrv > /dev/null 2>&1; then 28 + failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why" 29 + fi 30 fi 31 sleep .2 28 32 fi 29 - # Fail if we don't have the kernel tun device 30 - # Make sure that the tun module is loaded (Ubuntu 7.10 needs this) 31 - modprobe tun > /dev/null 2>&1 32 - if ! cat /proc/misc 2>/dev/null | grep tun > /dev/null; then 33 - failure "Linux tun/tap subsystem not available" 34 - fi 35 - succ_msg 36 # Read the configuration file entries line by line and create the 37 # interfaces 38 while read line; do 39 @@ -185,6 +183,19 @@ 40 # or two non-comment entries, possibly followed by a comment). 41 if ((! expr match "$2" "#" > /dev/null) && 42 (test -z "$4" || expr match "$4" "#" > /dev/null)); then 43 + if [ "$module_available" != 1 ] 44 + then 45 + # Fail if we don't have the kernel tun device 46 + # Make sure that the tun module is loaded (Ubuntu 7.10 needs this) 47 + # We only test this once, but we have to do it here, because otherwise an empty 48 + # configuration file would trigger the modprobe too. 49 + modprobe tun > /dev/null 2>&1 50 + if ! cat /proc/misc 2>/dev/null | grep tun > /dev/null 51 + then 52 + failure "Linux tun/tap subsystem not available" 53 + fi 54 + module_available=1 55 + fi 56 # Name our parameters, to make this script slightly less unreadable 57 interface=$1 58 user=$2 59 @@ -238,6 +249,7 @@ 60 fi 61 fi 62 done < "$CONFIG" 63 + succ_msg 64 return 0 33 @@ -184,8 +188,10 @@ 34 rmmod vboxdrv 2>/dev/null 35 failure "Cannot change owner $GROUPNAME for device $DEVICE" 36 fi 37 - if ! modprobe vboxnetflt > /dev/null 2>&1; then 38 - failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why" 39 + if [ "$LOAD_VBOXDRV_MODULE" = 1 ]; then 40 + if ! modprobe vboxnetflt > /dev/null 2>&1; then 41 + failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why" 42 + fi 43 fi 44 succ_msg 65 45 } 66 67 @@ -331,10 +343,17 @@68 69 case "$1" in70 start)71 + # try to insert module but do not fail if not possible72 + if [ "$LOAD_VBOXDRV_MODULE" = 1 ]; then73 + /sbin/modprobe -q vboxdrv || true74 + fi75 start_network76 ;;77 stop)78 stop_network79 + if [ "$LOAD_VBOXDRV_MODULE" = 1 ]; then80 + /sbin/modprobe -qr vboxdrv || true81 + fi82 ;;83 restart|reload)84 stop_network && start_network
Note: See TracChangeset
for help on using the changeset viewer.


