VirtualBox

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

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

Additions: added VBoxControl to the Linux, Solaris and FreeBSD installers

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