1 | #!/bin/sh
|
---|
2 | set -x
|
---|
3 | #
|
---|
4 | # Figure out the environment and locations.
|
---|
5 | #
|
---|
6 |
|
---|
7 | # Sudo isn't native solaris, but it's very convenient...
|
---|
8 | if test -z "$SUDO" && test "`whoami`" != "root"; then
|
---|
9 | SUDO=sudo
|
---|
10 | fi
|
---|
11 |
|
---|
12 | script_dir=`dirname "$0"`
|
---|
13 | # src/VBox/HostDrivers/solaris/ residence:
|
---|
14 | script_dir=`cd "$script_dir/../../../../.." ; /bin/pwd`
|
---|
15 | ## root residence:
|
---|
16 | #script_dir=`cd "$script_dir" ; /bin/pwd`
|
---|
17 |
|
---|
18 | set -e
|
---|
19 | if test -z "$BUILD_TARGET"; then
|
---|
20 | export BUILD_TARGET=solaris
|
---|
21 | fi
|
---|
22 | if test -z "$BUILD_TARGET_ARCH"; then
|
---|
23 | export BUILD_TARGET_ARCH=x86
|
---|
24 | fi
|
---|
25 | if test -z "$BUILD_TYPE"; then
|
---|
26 | export BUILD_TYPE=debug
|
---|
27 | fi
|
---|
28 |
|
---|
29 | DIR=$script_dir/out/$BUILD_TARGET.$BUILD_TARGET_ARCH/$BUILD_TYPE/bin/
|
---|
30 |
|
---|
31 | VBOXDRV_CONF_DIR=/platform/i86pc/kernel/drv
|
---|
32 | if test "$BUILD_TARGET_ARCH" = "amd64"; then
|
---|
33 | VBOXDRV_DIR=$VBOXDRV_CONF_DIR/amd64
|
---|
34 | else
|
---|
35 | VBOXDRV_DIR=$VBOXDRV_CONF_DIR
|
---|
36 | fi
|
---|
37 |
|
---|
38 | #
|
---|
39 | # Do the job.
|
---|
40 | #
|
---|
41 | $SUDO cp $DIR/vboxdrv $VBOXDRV_DIR/vboxdrv
|
---|
42 | $SUDO cp $script_dir/src/VBox/HostDrivers/Support/solaris/vboxdrv.conf $VBOXDRV_CONF_DIR/vboxdrv.conf
|
---|
43 | old_id=`/usr/sbin/modinfo | grep vbox | cut -f 1 -d ' ' `
|
---|
44 | if test -n "$old_id"; then
|
---|
45 | echo "* unloading $old_id..."
|
---|
46 | sync
|
---|
47 | sync
|
---|
48 | $SUDO /usr/sbin/modunload -i $old_id
|
---|
49 | else
|
---|
50 | echo "* If it fails below, run: $SUDO add_drv -m'* 0666 root sys' vboxdrv"
|
---|
51 | fi
|
---|
52 | echo "* loading vboxdrv..."
|
---|
53 | sync
|
---|
54 | sync
|
---|
55 | $SUDO /usr/sbin/modload $VBOXDRV_DIR/vboxdrv
|
---|
56 | /usr/sbin/modinfo | grep vboxdrv
|
---|
57 | echo "* dmesg:"
|
---|
58 | dmesg | tail -20
|
---|
59 | $SUDO chmod a+rw /devices/pseudo/vboxdrv*
|
---|
60 |
|
---|