VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuest/solaris/load.sh@ 69496

Last change on this file since 69496 was 69109, checked in by vboxsync, 7 years ago

scm updates

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1#!/bin/bash
2# $Id: load.sh 69109 2017-10-17 14:22:06Z vboxsync $
3## @file
4# For GA development.
5#
6
7#
8# Copyright (C) 2006-2017 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18# The contents of this file may alternatively be used under the terms
19# of the Common Development and Distribution License Version 1.0
20# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21# VirtualBox OSE distribution, in which case the provisions of the
22# CDDL are applicable instead of those of the GPL.
23#
24# You may elect to license modified versions of this file under the
25# terms and conditions of either the GPL or the CDDL or both.
26#
27
28DRVNAME="vboxguest"
29DRIVERS_USING_IT="vboxfs"
30
31DRVFILE=`dirname "$0"`
32DRVFILE=`cd "$DRVFILE" && pwd`
33DRVFILE="$DRVFILE/$DRVNAME"
34if [ ! -f "$DRVFILE" ]; then
35 echo "load.sh: Cannot find $DRVFILE or it's not a file..."
36 exit 1;
37fi
38
39SUDO=sudo
40#set -x
41
42# Unload driver that may depend on the driver we're going to (re-)load
43# as well as the driver itself.
44for drv in $DRIVERS_USING_IT $DRVNAME;
45do
46 LOADED=`modinfo | grep -w "$drv"`
47 if test -n "$LOADED"; then
48 MODID=`echo "$LOADED" | cut -d ' ' -f 1`
49 $SUDO modunload -i $MODID;
50 LOADED=`modinfo | grep -w "$drv"`;
51 if test -n "$LOADED"; then
52 echo "load.sh: failed to unload $drv";
53 dmesg | tail
54 exit 1;
55 fi
56 fi
57done
58
59#
60# Update the devlink.tab file so we get a /dev/vboxguest node.
61#
62set -e
63sed -e '/name=vboxguest/d' /etc/devlink.tab > /tmp/devlink.vbox
64echo -e "type=ddi_pseudo;name=vboxguest\t\D" >> /tmp/devlink.vbox
65$SUDO cp /tmp/devlink.vbox /etc/devlink.tab
66$SUDO ln -fs ../devices/pci@0,0/pci80ee,cafe@4:vboxguest /dev/vboxguest
67set +e
68
69#
70# The add_drv command will load the driver, so we need to temporarily put it
71# in a place that is searched in order to load it.
72#
73MY_RC=1
74set -e
75$SUDO rm -f \
76 "/usr/kernel/drv/${DRVNAME}" \
77 "/usr/kernel/drv/amd64/${DRVNAME}"
78sync
79$SUDO cp "${DRVFILE}" /platform/i86pc/kernel/drv/amd64/
80set +e
81
82$SUDO rem_drv $DRVNAME
83if $SUDO add_drv -ipci80ee,cafe -m"* 0666 root sys" -v $DRVNAME; then
84 sync
85 $SUDO /usr/sbin/devfsadm -i $DRVNAME
86 MY_RC=0
87else
88 dmesg | tail
89 echo "load.sh: add_drv failed."
90fi
91
92$SUDO rm -f \
93 "/usr/kernel/drv/${DRVNAME}" \
94 "/usr/kernel/drv/amd64/${DRVNAME}"
95sync
96
97exit $MY_RC;
98
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