vboxdrv.sh.in revision 31620f279590f4ccc82e9e8ca1d81961095e9404
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Oracle VM VirtualBox
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Linux kernel module init script
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Copyright (C) 2006-2010 Oracle Corporation
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# available from http://www.virtualbox.org. This file is free software;
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# you can redistribute it and/or modify it under the terms of the GNU
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# General Public License (GPL) as published by the Free Software
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# chkconfig: 35 30 70
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# description: VirtualBox Linux kernel module
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync### BEGIN INIT INFO
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Provides: vboxdrv
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Required-Start: $syslog
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Required-Stop:
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Default-Start: 2 3 4 5
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Default-Stop: 1
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync# Short-Description: VirtualBox Linux kernel module
5bf0ee311caa414469f26237ff607cb1b3591508vboxsync### END INIT INFO
5bf0ee311caa414469f26237ff607cb1b3591508vboxsyncif $MODPROBE -c | grep -q '^allow_unsupported_modules *0'; then
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsyncif [ -n "$INSTALL_DIR" ]; then
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXDRV="$INSTALL_DIR/src/vboxhost/vboxdrv/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxhost/vboxnetflt/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXNETADP="$INSTALL_DIR/src/vboxhost/vboxnetadp/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxhost/vboxdrv/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxhost/vboxnetflt/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxhost/vboxnetadp/build_in_tmp"
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync# silently exit if the package was uninstalled but not purged,
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync# applies to Debian packages only
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsync[ -z "$DEBIAN" -o -x $VBOXMANAGE -a -x $BUILDVBOXDRV ] || exit 0
6f82db701c69ae6925eb7e8bf1dfe25c9f951bddvboxsyncif [ -n "$NOLSB" ]; then
if [ -z "$NOLSB" ]; then
rc_status -v
rc_status -v
if [ -e /proc/sys/kernel/perf_counter_paranoid ]; then
echo 2 > /proc/sys/kernel/perf_counter_paranoid
sleep .2
if [ ! -c $DEVICE ]; then
MINOR=0
MAJOR=10
if ! chown :$GROUPNAME $DEVICE 2>/dev/null; then
rmmod vboxnetadp 2>/dev/null
rmmod vboxnetflt 2>/dev/null
if ! $MODPROBE vboxnetflt > /dev/null 2>&1; then
if ! $MODPROBE vboxnetadp > /dev/null 2>&1; then
if running vboxnetadp; then
if ! rmmod vboxnetadp 2>/dev/null; then
if running vboxnetflt; then
if ! rmmod vboxnetflt 2>/dev/null; then
for i in $SHUTDOWN_USERS; do
if ! $BUILDVBOXDRV \
if ! $BUILDVBOXNETFLT \
--use-module-symvers /tmp/vboxdrv-Module.symvers \
if ! $BUILDVBOXNETADP \
--use-module-symvers /tmp/vboxdrv-Module.symvers \
rm -f /etc/vbox/module_not_compiled
if running vboxnetflt; then
if running vboxnetadp; then
for i in $SHUTDOWN_USERS; do
stop && start