VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/solaris/mod.sh@ 20413

Last change on this file since 20413 was 13296, checked in by vboxsync, 16 years ago

solaris/mod.sh: unload hack.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Id Revision
File size: 2.0 KB
Line 
1#!/bin/sh
2set -x
3#
4# Figure out the environment and locations.
5#
6
7# Sudo isn't native solaris, but it's very convenient...
8if test -z "$SUDO" && test "`whoami`" != "root"; then
9 SUDO=sudo
10fi
11
12script_dir=`dirname "$0"`
13# src/VBox/HostDrivers/solaris/ residence:
14script_dir=`cd "$script_dir/../../../../.." ; /bin/pwd`
15## root residence:
16#script_dir=`cd "$script_dir" ; /bin/pwd`
17
18set -e
19if test -z "$BUILD_TARGET"; then
20 export BUILD_TARGET=solaris
21fi
22if test -z "$BUILD_TARGET_ARCH"; then
23 export BUILD_TARGET_ARCH=x86
24fi
25if test -z "$BUILD_TYPE"; then
26 export BUILD_TYPE=debug
27fi
28
29DIR=$script_dir/out/$BUILD_TARGET.$BUILD_TARGET_ARCH/$BUILD_TYPE/bin/
30
31VBOXDRV_CONF_DIR=/platform/i86pc/kernel/drv
32if test "$BUILD_TARGET_ARCH" = "amd64"; then
33 VBOXDRV_DIR=$VBOXDRV_CONF_DIR/amd64
34else
35 VBOXDRV_DIR=$VBOXDRV_CONF_DIR
36fi
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
43old_id=`/usr/sbin/modinfo | /usr/xpg4/bin/grep vbox | cut -f 1 -d ' ' | sort -n -r `
44if 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"
51fi
52$SUDO /usr/sbin/rem_drv vboxdrv || echo "* ignored rem_drv failure..."
53$SUDO /usr/sbin/add_drv vboxdrv
54
55if /usr/xpg4/bin/grep -q vboxdrv /etc/devlink.tab; then
56 echo "* vboxdrv already present in /etc/devlink.tab"
57else
58 echo "* Adding vboxdrv to /etc/devlink.tab"
59 $SUDO rm -f /tmp/devlink.tab.vboxdrv
60 echo "" > /tmp/devlink.tab.vboxdrv
61 echo '# vbox' >> /tmp/devlink.tab.vboxdrv
62 echo 'type=ddi_pseudo;name=vboxdrv \D' >> /tmp/devlink.tab.vboxdrv
63 $SUDO /bin/sh -c 'cat /tmp/devlink.tab.vboxdrv >> /etc/devlink.tab'
64fi
65
66echo "* loading vboxdrv..."
67sync
68sync
69$SUDO /usr/sbin/modload $VBOXDRV_DIR/vboxdrv
70/usr/sbin/modinfo | /usr/xpg4/bin/grep vboxdrv
71echo "* dmesg:"
72dmesg | tail -20
73if test ! -h /dev/vboxdrv; then
74 $SUDO /usr/sbin/devfsadm -i vboxdrv
75fi
76ls -laL /dev/vboxdrv
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