VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxUSB/darwin/loadusb.sh@ 88675

Last change on this file since 88675 was 87376, checked in by vboxsync, 4 years ago

USB/Darwin: Capture USB devices directly through IOUSBLib, no longer use VBoxUSB.kext (see bugref:9808).

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1#!/bin/bash
2## @file
3# For development.
4#
5
6#
7# Copyright (C) 2006-2020 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27SCRIPT_NAME="loadusb"
28XNU_VERSION=`LC_ALL=C uname -r | LC_ALL=C cut -d . -f 1`
29
30DRVNAME="VBoxUSB.kext"
31BUNDLE="org.virtualbox.kext.VBoxUSB"
32
33DEP_DRVNAME="VBoxDrv.kext"
34DEP_BUNDLE="org.virtualbox.kext.VBoxDrv"
35
36
37DIR=`dirname "$0"`
38DIR=`cd "$DIR" && pwd`
39DEP_DIR="$DIR/$DEP_DRVNAME"
40DIR="$DIR/$DRVNAME"
41if [ ! -d "$DIR" ]; then
42 echo "Cannot find $DIR or it's not a directory..."
43 exit 1;
44fi
45if [ ! -d "$DEP_DIR" ]; then
46 echo "Cannot find $DEP_DIR or it's not a directory... (dependency)"
47 exit 1;
48fi
49if [ -n "$*" ]; then
50 OPTS="$*"
51else
52 OPTS="-t"
53fi
54
55trap "sudo chown -R `whoami` $DIR $DEP_DIR; exit 1" INT
56
57# Try unload any existing instance first.
58LOADED=`kextstat -b $BUNDLE -l`
59if test -n "$LOADED"; then
60 echo "${SCRIPT_NAME}.sh: Unloading $BUNDLE..."
61 sudo kextunload -v 6 -b $BUNDLE
62 LOADED=`kextstat -b $BUNDLE -l`
63 if test -n "$LOADED"; then
64 echo "${SCRIPT_NAME}.sh: failed to unload $BUNDLE, see above..."
65 exit 1;
66 fi
67 echo "${SCRIPT_NAME}.sh: Successfully unloaded $BUNDLE"
68fi
69
70# We are now done since VBoxUSB.kext is no longer used.
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette