VirtualBox

source: vbox/trunk/src/VBox/Installer/solaris/postinstall.sh@ 20269

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

Solaris/Installer: wording minor change.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1#!/bin/sh
2## @file
3# Sun VirtualBox
4# VirtualBox postinstall script for Solaris.
5#
6
7#
8# Copyright (C) 2007-2009 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19# Clara, CA 95054 USA or visit http://www.sun.com if you need
20# additional information or have any questions.
21#
22
23# Check for xVM/Xen
24currentisa=`uname -i`
25if test "$currentisa" = "i86xpv"; then
26 echo "## VirtualBox cannot run under xVM Dom0! Fatal Error, Aborting installation!"
27 exit 2
28fi
29
30osversion=`uname -r`
31currentzone=`zonename`
32if test "$currentzone" = "global"; then
33 echo "Loading VirtualBox kernel modules..."
34 /opt/VirtualBox/vboxdrv.sh stopall silentunload checkarch
35 rc=$?
36 if test "$rc" -eq 0; then
37 /opt/VirtualBox/vboxdrv.sh start
38 rc=$?
39
40 # VBoxDrv loaded successfully, proceed with the rest...
41 if test "$rc" -eq 0; then
42 # Load VBoxNetAdapter vboxnet
43 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
44 /opt/VirtualBox/vboxdrv.sh netstart
45 rc=$?
46
47 # nwam/dhcpagent fix
48 nwamfile=/etc/nwam/llp
49 nwambackupfile=$nwamfile.vbox
50 if test "$rc" -eq 0 && test -f "$nwamfile"; then
51 sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
52 echo "vboxnet0 static 192.168.56.1" >> $nwambackupfile
53 mv -f $nwambackupfile $nwamfile
54 fi
55 fi
56
57 # Load VBoxNetFilter vboxflt
58 if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
59 /opt/VirtualBox/vboxdrv.sh fltstart
60 rc=$?
61 fi
62
63 # Load VBoxUSBMon vboxusbmon (do NOT load for Solaris 10)
64 if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
65 /opt/VirtualBox/vboxdrv.sh usbstart
66 rc=$?
67 if test "$rc" -eq 0; then
68 # Add vboxusbmon to the devlink.tab
69 sed -e '
70 /name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
71 echo "type=ddi_pseudo;name=vboxusbmon \D" >> /etc/devlink.vbox
72 mv -f /etc/devlink.vbox /etc/devlink.tab
73 fi
74 fi
75 fi
76 fi
77
78 # Fail on any errors while unloading previous modules because it makes it very hard to
79 # track problems when older vboxdrv is hanging about in memory and add_drv of the new
80 # one suceeds and it appears as though the new one is being used.
81 if test "$rc" -ne 0; then
82 echo "## Loading failed. Aborting installation."
83 exit 2
84 fi
85fi
86
87echo "Configuring services and drivers..."
88
89if test "$currentzone" = "global"; then
90 # Web service
91 if test -f /var/svc/manifest/application/virtualbox/webservice.xml; then
92 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/webservice.xml
93 /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default
94 fi
95
96 # Add vboxdrv to the devlink.tab
97 sed -e '
98/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
99 echo "type=ddi_pseudo;name=vboxdrv \D" >> /etc/devlink.vbox
100 mv -f /etc/devlink.vbox /etc/devlink.tab
101
102 # Create the device link
103 /usr/sbin/devfsadm -i vboxdrv
104
105 # Don't create link for Solaris 10
106 if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
107 /usr/sbin/devfsadm -i vboxusbmon
108 fi
109 sync
110
111 # We need to touch the desktop link in order to add it to the menu right away
112 if test -f "/usr/share/applications/virtualbox.desktop"; then
113 touch /usr/share/applications/virtualbox.desktop
114 fi
115
116 # Zone access service
117 if test -f /var/svc/manifest/application/virtualbox/zoneaccess.xml; then
118 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/zoneaccess.xml
119 /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
120 fi
121fi
122
123#
124# Install python bindings
125#
126if test -f "/opt/VirtualBox/sdk/installer/vboxapisetup.py" || test -h "/opt/VirtualBox/sdk/installer/vboxapisetup.py"; then
127 PYTHONBIN=`which python`
128 if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then
129 echo "Installing Python bindings..."
130
131 cd /opt/VirtualBox/sdk/installer
132 /opt/VirtualBox/sdk/installer/vboxapisetup.py install
133 else
134 echo "** WARNING! Python not found, skipped installed Python bindings."
135 echo " Manually run '/opt/VirtualBox/sdk/installer/vboxapisetup.py install'"
136 echo " to install the bindings when python is available."
137 fi
138fi
139
140/usr/sbin/installf -f $PKGINST
141
142echo "Done."
143
144# return 20 = requires reboot, 2 = partial failure, 0 = success
145exit 0
146
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