d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# For development.
5ac633771fea62a5236149adb3353126380945f6vboxsync# Copyright (C) 2006-2015 Oracle Corporation
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# available from http://www.virtualbox.org. This file is free software;
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# you can redistribute it and/or modify it under the terms of the GNU
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# General Public License (GPL) as published by the Free Software
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# The contents of this file may alternatively be used under the terms
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# of the Common Development and Distribution License Version 1.0
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# VirtualBox OSE distribution, in which case the provisions of the
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# CDDL are applicable instead of those of the GPL.
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# You may elect to license modified versions of this file under the
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# terms and conditions of either the GPL or the CDDL or both.
c7cd98a3e0c214e3bb1adf79883105c008ec317avboxsyncDRIVERS_USING_IT="vboxusb vboxusbmon vboxnet vboxflt vboxbow"
d318c6184dca5599e44f8c67a7983b30065448f9vboxsyncif [ ! -f "$DRVFILE" ]; then
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: Cannot find $DRVFILE or it's not a file..."
d318c6184dca5599e44f8c67a7983b30065448f9vboxsyncif [ ! -f "$DRVFILE.conf" ]; then
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: Cannot find $DRVFILE.conf or it's not a file..."
c7cd98a3e0c214e3bb1adf79883105c008ec317avboxsync# Disable the zone access service.
5ac633771fea62a5236149adb3353126380945f6vboxsyncservicefound=`svcs -H "virtualbox/zoneaccess" 2>/dev/null | grep '^online'`
5ac633771fea62a5236149adb3353126380945f6vboxsyncif test ! -z "$servicefound"; then
5ac633771fea62a5236149adb3353126380945f6vboxsync $SUDO svcadm disable svc:/application/virtualbox/zoneaccess:default
99a5f7beff5f7bbf1f73923087d60070ddb717d4vboxsync# Unload driver that may depend on the driver we're going to (re-)load
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# as well as the driver itself.
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync if test -n "$LOADED"; then
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync if test -n "$LOADED"; then
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: failed to unload $drv";
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# Reconfigure the driver so it get a major number.
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# Note! We have to copy the driver and config files to somewhere the kernel can
99a5f7beff5f7bbf1f73923087d60070ddb717d4vboxsync# find them. It is searched for as drv/${DRVNAME}.conf in
99a5f7beff5f7bbf1f73923087d60070ddb717d4vboxsync# kobj_module_path, which is usually:
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# To try prevent bad drivers from being loaded on the next boot, we remove
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync# always the files.
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync$SUDO cp "${DRVFILE}" /platform/i86pc/kernel/drv/amd64/
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync$SUDO cp "${DRVFILE}.conf" /platform/i86pc/kernel/drv/
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync if $SUDO modload "/platform/i86pc/kernel/drv/amd64/${DRVNAME}"; then
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: successfully loaded the driver"
5ac633771fea62a5236149adb3353126380945f6vboxsync if test ! -h "/dev/vboxdrv"; then
5ac633771fea62a5236149adb3353126380945f6vboxsync $SUDO ln -sf "/devices/pseudo/vboxdrv@0:vboxdrv" /dev/vboxdrv
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: modload failed"
d318c6184dca5599e44f8c67a7983b30065448f9vboxsync echo "load.sh: add_drv failed."