VirtualBox

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

Last change on this file since 12230 was 12144, checked in by vboxsync, 17 years ago

Solaris/additions: backed out combined installer for now.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 5.3 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
22sync
23vboxadditions_path="/opt/VirtualBoxAdditions"
24
25# vboxguest.sh would've been installed, we just need to call it.
26$vboxadditions_path/vboxguest.sh restart silentunload
27
28# get what ISA the guest is running
29cputype=`isainfo -k`
30isadir=""
31if test "$cputype" = "amd64"; then
32 isadir="amd64"
33fi
34
35
36# suid permissions for timesync
37chmod 04755 $vboxadditions_path/VBoxService
38chmod a+x $vboxadditions_path/VBoxClient
39chmod a+x $vboxadditions_path/VBoxControl
40chmod a+x $vboxadditions_path/VBoxRandR.sh
41
42# create links
43echo "Creating links..."
44/usr/sbin/installf -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
45/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxClient=$vboxadditions_path/VBoxClient s
46/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxService=$vboxadditions_path/VBoxService s
47/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxControl=$vboxadditions_path/VBoxControl s
48/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxRandR=$vboxadditions_path/VBoxRandR.sh s
49
50# Install Xorg components to the required places
51xorgversion_long=`/usr/X11/bin/Xorg -version 2>&1 | grep "X Window System Version"`
52xorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X Window System Version \([^ ]*\)'`
53
54vboxmouse_src=""
55vboxvideo_src=""
56
57case "$xorgversion" in
58 1.3.* )
59 vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
60 vboxvideo_src="$vboxadditions_path/vboxvideo_drv_13.so"
61 ;;
62 1.4.* )
63 vboxmouse_src="$vboxadditions_path/vboxmouse_drv_14.so"
64 vboxvideo_src="$vboxadditions_path/vboxvideo_drv_14.so"
65 ;;
66 7.1.* | *7.2.* )
67 vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
68 vboxvideo_src="$vboxadditions_path/vboxvideo_drv_71.so"
69 ;;
70 6.9.* | 7.0.* )
71 vboxmouse_src="$vboxadditions_path/vboxmouse_drv_70.so"
72 vboxvideo_src="$vboxadditions_path/vboxvideo_drv_70.so"
73 ;;
74esac
75
76retval=0
77if test -z "$vboxmouse_src"; then
78 echo "*** Unknown version of the X Window System installed."
79 echo "*** Failed to install the VirtualBox X Window System drivers."
80
81 # Exit as partially failed installation
82 retval=2
83else
84 echo "Configuring Xorg..."
85
86 vboxmouse_dest="/usr/X11/lib/modules/input/$isadir/vboxmouse_drv.so"
87 vboxvideo_dest="/usr/X11/lib/modules/drivers/$isadir/vboxvideo_drv.so"
88 /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
89 /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
90 cp "$vboxmouse_src" "$vboxmouse_dest"
91 cp "$vboxvideo_src" "$vboxvideo_dest"
92
93 # Removing redudant files
94 /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null 2>/dev/null
95 /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null 2>/dev/null
96 rm -f $vboxadditions_path/vboxmouse_drv_*
97 rm -f $vboxadditions_path/vboxvideo_drv_*
98
99 /usr/sbin/removef -f $PKGINST
100
101 # Some distros like Indiana have no xorg.conf, deal with this
102 if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
103 mv -f $vboxadditions_path/solaris_xorg.conf /etc/X11/.xorg.conf
104 fi
105
106 $vboxadditions_path/x11config.pl
107fi
108
109
110# Setup our VBoxClient
111echo "Configuring client..."
112vboxclient_src=$vboxadditions_path
113vboxclient_dest="/usr/dt/config/Xsession.d"
114if test -d "$vboxclient_dest"; then
115 /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/1099.vboxclient" f
116 cp "$vboxclient_src/1099.vboxclient" "$vboxclient_dest/1099.vboxclient"
117 chmod a+rx "$vboxclient_dest/1099.vboxclient"
118elif test -d "/usr/share/gnome/autostart"; then
119 vboxclient_dest="/usr/share/gnome/autostart"
120 /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/vboxclient.desktop" f
121 cp "$vboxclient_src/vboxclient.desktop" "$vboxclient_dest/vboxclient.desktop"
122else
123 echo "*** Failed to configure client!! Couldn't find autostart directory."
124 retval=2
125fi
126
127
128# Remove redundant files
129/usr/sbin/removef $PKGINST $vboxadditions_path/etc/devlink.tab 1>/dev/null
130/usr/sbin/removef $PKGINST $vboxadditions_path/etc 1>/dev/null
131rm -rf $vboxadditions_path/etc
132/usr/sbin/removef -f $PKGINST
133
134/usr/sbin/installf -f $PKGINST
135
136
137# Setup our VBoxService SMF service
138echo "Configuring service..."
139
140/usr/sbin/svccfg import /var/svc/manifest/system/virtualbox/vboxservice.xml
141/usr/sbin/svcadm enable svc:/system/virtualbox/vboxservice
142
143/usr/sbin/devfsadm -i vboxguest
144
145echo "Done."
146if test $retval -eq 0; then
147 echo "Please re-login to activate the X11 guest additions."
148 echo "If you have just un-installed the previous guest additions a REBOOT is required."
149fi
150exit $retval
151
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette