Changeset 8092 in vbox
- Timestamp:
- Apr 17, 2008 12:33:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/load.sh
r7193 r8092 1 1 #!/bin/bash 2 ## @file 3 # For development. 4 # 2 5 3 #4 # For development.5 6 # 6 7 # Copyright (C) 2006-2007 innotek GmbH … … 24 25 # 25 26 27 DRVNAME="VBoxDrv.kext" 28 BUNDLE="org.virtualbox.kext.VBoxDrv" 26 29 27 DIR="VBoxDrv.kext" 28 30 DIR=`dirname "$0"` 31 DIR=`cd "$DIR" && pwd` 32 DIR="$DIR/$DRVNAME" 29 33 if [ ! -d "$DIR" ]; then 30 34 echo "Cannot find $DIR or it's not a directory..." … … 38 42 39 43 trap "sudo chown -R `whoami` $DIR; exit 1" INT 40 set -x 44 45 # Try unload any existing instance first. 46 LOADED=`kextstat -b $BUNDLE -l` 47 if test -n "$LOADED"; then 48 echo "load.sh: Unloading $BUNDLE..." 49 sudo kextunload -v 6 -b $BUNDLE 50 LOADED=`kextstat -b $BUNDLE -l` 51 if test -n "$LOADED"; then 52 echo "load.sh: failed to unload $BUNDLE, see above..." 53 exit 1; 54 fi 55 echo "load.sh: Successfully unloaded $BUNDLE" 56 fi 57 58 set -e 59 # On smbfs, this might succeed just fine but make no actual changes, 60 # so we might have to temporarily copy the driver to a local directory. 41 61 sudo chown -R root:wheel "$DIR" 62 OWNER=`stat -f "%u" "$DIR"` 63 if test "$OWNER" -ne 0; then 64 TMP_DIR=/tmp/loaddrv.tmp 65 echo "load.sh: chown didn't work on $DIR, using temp location $TMP_DIR/$DRVNAME" 66 67 # clean up first (no sudo rm) 68 if test -e "$TMP_DIR"; then 69 sudo chown -R `whoami` "$TMP_DIR" 70 rm -Rf "$TMP_DIR" 71 fi 72 73 # make a copy and switch over DIR 74 mkdir -p "$TMP_DIR/" 75 cp -Rp "$DIR" "$TMP_DIR/" 76 DIR="$TMP_DIR/$DRVNAME" 77 78 # retry 79 sudo chown -R root:wheel "$DIR" 80 fi 42 81 sudo chmod -R o-rwx "$DIR" 43 82 sync 83 echo "load.sh: loading $DIR..." 44 84 sudo kextload $OPTS "$DIR" 85 sync 45 86 sudo chown -R `whoami` "$DIR" 46 sudo chmod 666 /dev/vboxdrv 87 #sudo chmod 666 /dev/vboxdrv 88 kextstat | grep org.virtualbox.kext 89
Note:
See TracChangeset
for help on using the changeset viewer.