]> git.pld-linux.org Git - packages/VirtualBox-bin.git/commitdiff
- script for preloading vboxnetflt kernel driver at system startup auto/th/VirtualBox-2_1_0-1 auto/ti/VirtualBox-2_1_0-1
authorhawk <hawk@pld-linux.org>
Fri, 19 Dec 2008 14:29:07 +0000 (14:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  note: upstream confirmed that when run on unprivileged user VirtualBox
  will not be able to load vboxnetflt (on host) or vboxvfs (on guest)

Changed files:
    VirtualBox-vboxnetflt.init -> 1.1

VirtualBox-vboxnetflt.init [new file with mode: 0644]

diff --git a/VirtualBox-vboxnetflt.init b/VirtualBox-vboxnetflt.init
new file mode 100644 (file)
index 0000000..d4e7050
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# virtualbox   VirtualBox virtualizer for x86 hardware
+#
+# chkconfig:   345 84 25
+#
+# description: InnoTek VirtualBox is a general-purpose full virtualizer for x86 
+#              hardware. Targeted at server, desktop and embedded use.
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+VBOX_DEVICE="/dev/vboxnetflt"
+VBOX_MODULE="vboxnetflt"
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
+
+start() {
+       if [ ! -f /var/lock/subsys/vboxnetflt ]; then
+               modprobe -s $VBOX_MODULE
+               # set proper /dev/vboxdrv for systems with static dev
+               touch /var/lock/subsys/vboxnetflt
+       fi
+}
+
+stop() {
+       # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
+       /sbin/rmmod $VBOX_MODULE
+       rm -f /var/lock/subsys/vboxnetflt
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  status)
+       if ! is_module $VBOX_MODULE; then
+               echo "$VBOX_MODULE module is loaded"
+       else
+               echo "$VBOX_MODULE module is not loaded"
+               RETVAL=3
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|status}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.090545 seconds and 4 git commands to generate.