VirtualBox

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

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

Solaris/additions installer: eliminate devlink.tab, use devfsadm and dev tree, rather than the device tree.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 6.2 KB
Line 
1#!/bin/sh
2# Sun xVM VirtualBox
3# VirtualBox postinstall script for Solaris.
4#
5# Copyright (C) 2008 Sun Microsystems, Inc.
6#
7# This file is part of VirtualBox Open Source Edition (OSE), as
8# available from http://www.virtualbox.org. This file is free software;
9# you can redistribute it and/or modify it under the terms of the GNU
10# General Public License (GPL) as published by the Free Software
11# Foundation, in version 2 as it comes in the "COPYING" file of the
12# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14#
15# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
16# Clara, CA 95054 USA or visit http://www.sun.com if you need
17# additional information or have any questions.
18#
19
20echo "Configuring VirtualBox guest kernel module..."
21
22vboxadditions_path="/opt/VirtualBoxAdditions"
23vboxadditions64_path=$vboxadditions_path/amd64
24solaris64dir="amd64"
25
26# vboxguest.sh would've been installed, we just need to call it.
27$vboxadditions_path/vboxguest.sh restart silentunload
28
29sed -e '
30/name=vboxguest/d' /etc/devlink.tab > /etc/devlink.vbox
31echo "type=ddi_pseudo;name=vboxguest \D" >> /etc/devlink.vbox
32mv -f /etc/devlink.vbox /etc/devlink.tab
33
34# create the device link
35/usr/sbin/devfsadm -i vboxguest
36sync
37
38# get what ISA the guest is running
39cputype=`isainfo -k`
40isadir=""
41if test "$cputype" = "amd64"; then
42 isadir="amd64"
43fi
44
45# create links
46echo "Creating links..."
47/usr/sbin/installf -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
48/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxClient=$vboxadditions_path/VBox.sh s
49/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxService=$vboxadditions_path/VBox.sh s
50/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxControl=$vboxadditions_path/VBox.sh s
51/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxRandR=$vboxadditions_path/VBoxRandR.sh s
52
53# Install Xorg components to the required places
54xorgversion_long=`/usr/X11/bin/Xorg -version 2>&1 | grep "X Window System Version"`
55xorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X Window System Version \([^ ]*\)'`
56
57vboxmouse_src=""
58vboxvideo_src=""
59
60case "$xorgversion" in
61 1.3.* )
62 vboxmouse_src="vboxmouse_drv_71.so"
63 vboxvideo_src="vboxvideo_drv_13.so"
64 ;;
65 1.4.* )
66 vboxmouse_src="vboxmouse_drv_14.so"
67 vboxvideo_src="vboxvideo_drv_14.so"
68 ;;
69 7.1.* | *7.2.* )
70 vboxmouse_src="vboxmouse_drv_71.so"
71 vboxvideo_src="vboxvideo_drv_71.so"
72 ;;
73 6.9.* | 7.0.* )
74 vboxmouse_src="vboxmouse_drv_70.so"
75 vboxvideo_src="vboxvideo_drv_70.so"
76 ;;
77esac
78
79retval=0
80if test -z "$vboxmouse_src"; then
81 echo "*** Unknown version of the X Window System installed."
82 echo "*** Failed to install the VirtualBox X Window System drivers."
83
84 # Exit as partially failed installation
85 retval=2
86else
87 echo "Configuring Xorg..."
88
89 # 32-bit x11 drivers
90 if test -f "$vboxadditions_path/$vboxmouse_src"; then
91 vboxmouse_dest="/usr/X11/lib/modules/input/vboxmouse_drv.so"
92 vboxvideo_dest="/usr/X11/lib/modules/drivers/vboxvideo_drv.so"
93 /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
94 /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
95 cp "$vboxadditions_path/$vboxmouse_src" "$vboxmouse_dest"
96 cp "$vboxadditions_path/$vboxvideo_src" "$vboxvideo_dest"
97
98 # Removing redundent files
99 /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null 2>/dev/null
100 /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null 2>/dev/null
101 rm -f $vboxadditions_path/vboxmouse_drv_*
102 rm -f $vboxadditions_path/vboxvideo_drv_*
103 fi
104
105 # 64-bit x11 drivers
106 if test -f "$vboxadditions64_path/$vboxmouse_src"; then
107 vboxmouse_dest="/usr/X11/lib/modules/input/$solaris64dir/vboxmouse_drv.so"
108 vboxvideo_dest="/usr/X11/lib/modules/drivers/$solaris64dir/vboxvideo_drv.so"
109 /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
110 /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
111 cp "$vboxadditions64_path/$vboxmouse_src" "$vboxmouse_dest"
112 cp "$vboxadditions64_path/$vboxvideo_src" "$vboxvideo_dest"
113
114 # Removing redundent files
115 /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxmouse_drv_* 1>/dev/null 2>/dev/null
116 /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxvideo_drv_* 1>/dev/null 2>/dev/null
117 rm -f $vboxadditions64_path/vboxmouse_drv_*
118 rm -f $vboxadditions64_path/vboxvideo_drv_*
119 fi
120
121 # Some distros like Indiana have no xorg.conf, deal with this
122 if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
123 mv -f $vboxadditions_path/solaris_xorg.conf /etc/X11/.xorg.conf
124 fi
125
126 $vboxadditions_path/x11config.pl
127fi
128
129
130# Setup our VBoxClient
131echo "Configuring client..."
132vboxclient_src=$vboxadditions_path
133vboxclient_dest="/usr/dt/config/Xsession.d"
134if test -d "$vboxclient_dest"; then
135 /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/1099.vboxclient" f
136 cp "$vboxclient_src/1099.vboxclient" "$vboxclient_dest/1099.vboxclient"
137 chmod a+rx "$vboxclient_dest/1099.vboxclient"
138elif test -d "/usr/share/gnome/autostart"; then
139 vboxclient_dest="/usr/share/gnome/autostart"
140 /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/vboxclient.desktop" f
141 cp "$vboxclient_src/vboxclient.desktop" "$vboxclient_dest/vboxclient.desktop"
142else
143 echo "*** Failed to configure client!! Couldn't find autostart directory."
144 retval=2
145fi
146
147
148# Remove redundant files
149/usr/sbin/removef $PKGINST $vboxadditions_path/etc/devlink.tab 1>/dev/null
150/usr/sbin/removef $PKGINST $vboxadditions_path/etc 1>/dev/null
151rm -rf $vboxadditions_path/etc
152
153# Finalize
154/usr/sbin/removef -f $PKGINST
155/usr/sbin/installf -f $PKGINST
156
157
158# Setup our VBoxService SMF service
159echo "Configuring service..."
160
161/usr/sbin/svccfg import /var/svc/manifest/system/virtualbox/vboxservice.xml
162/usr/sbin/svcadm enable svc:/system/virtualbox/vboxservice
163
164/usr/sbin/devfsadm -i vboxguest
165
166echo "Done."
167if test $retval -eq 0; then
168 echo "Please re-login to activate the X11 guest additions."
169 echo "If you have just un-installed the previous guest additions a REBOOT is required."
170fi
171exit $retval
172
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