1 | #!/bin/sh
|
---|
2 | # innotek VirtualBox
|
---|
3 | # VirtualBox postinstall script for Solaris.
|
---|
4 | #
|
---|
5 | # Copyright (C) 2008 innotek GmbH
|
---|
6 | #
|
---|
7 | # innotek GmbH confidential
|
---|
8 | # All rights reserved
|
---|
9 | #
|
---|
10 |
|
---|
11 | echo "innotek VirtualBox Guest Additions - postinstall script"
|
---|
12 | echo "This script will setup and load the VirtualBox Guest kernel module..."
|
---|
13 |
|
---|
14 | sync
|
---|
15 | vboxadditions_path="/opt/VirtualBoxAdditions"
|
---|
16 |
|
---|
17 | # vboxguest.sh would've been installed, we just need to call it.
|
---|
18 | $vboxadditions_path/vboxguest.sh restart silentunload
|
---|
19 |
|
---|
20 | # suid permissions for timesync
|
---|
21 | echo "Setting permissions..."
|
---|
22 | chmod 04755 $vboxadditions_path/VBoxService
|
---|
23 |
|
---|
24 | # create links
|
---|
25 | echo "Creating links..."
|
---|
26 | /usr/sbin/installf -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
|
---|
27 | /usr/sbin/installf -c none $PKGINST /usr/bin/VBoxClient=$vboxadditions_path/VBoxClient s
|
---|
28 | /usr/sbin/installf -c none $PKGINST /usr/bin/VBoxService=$vboxadditions_path/VBoxService s
|
---|
29 |
|
---|
30 | # Install Xorg components to the required places
|
---|
31 | xorgversion_long=`/usr/bin/X11/Xorg -version 2>&1 | grep "X Window System Version"`
|
---|
32 | xorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X Window System Version \([^ ]*\)'`
|
---|
33 |
|
---|
34 | vboxmouse_src=""
|
---|
35 | vboxvideo_src=""
|
---|
36 |
|
---|
37 | case "$xorgversion" in
|
---|
38 | 1.3.* )
|
---|
39 | vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
|
---|
40 | vboxvideo_src="$vboxadditions_path/vboxvideo_drv_13.so"
|
---|
41 | ;;
|
---|
42 | 1.4.* )
|
---|
43 | vboxmouse_src="$vboxadditions_path/vboxmouse_drv_14.so"
|
---|
44 | vboxvideo_src="$vboxadditions_path/vboxvideo_drv_14.so"
|
---|
45 | ;;
|
---|
46 | 7.1.* | *7.2.* )
|
---|
47 | vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
|
---|
48 | vboxvideo_src="$vboxadditions_path/vboxvideo_drv_71.so"
|
---|
49 | ;;
|
---|
50 | 6.9.* | 7.0.* )
|
---|
51 | vboxmouse_src="$vboxadditions_path/vboxmouse_drv_70.so"
|
---|
52 | vboxvideo_src="$vboxadditions_path/vboxvideo_drv_70.so"
|
---|
53 | ;;
|
---|
54 | esac
|
---|
55 |
|
---|
56 | if test -z "$vboxmouse_src"; then
|
---|
57 | echo "Unknown version of the X Window System installed."
|
---|
58 | echo "Failed to install the VirtualBox X Window System drivers."
|
---|
59 | else
|
---|
60 | vboxmouse_dest="/usr/lib/X11/modules/input/vboxmouse_drv.so"
|
---|
61 | vboxvideo_dest="/usr/lib/X11/modules/input/vboxvideo_drv.so"
|
---|
62 | /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
|
---|
63 | /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
|
---|
64 | cp "$vboxmouse_src" "$vboxmouse_dest"
|
---|
65 | cp "$vboxvideo_src" "$vboxvideo_dest"
|
---|
66 | echo "Installed VirtualBox mouse and video drivers for Xorg $xorgversion"
|
---|
67 |
|
---|
68 | # Removing redudant files
|
---|
69 | /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null 2>/dev/null
|
---|
70 | /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null 2>/dev/null
|
---|
71 | rm -f $vboxadditions_path/vboxmouse_drv_*
|
---|
72 | rm -f $vboxadditions_path/vboxvideo_drv_*
|
---|
73 | /usr/sbin/removef -f $PKGINST
|
---|
74 | fi
|
---|
75 |
|
---|
76 | echo "Configuring Xorg..."
|
---|
77 | $vboxadditions_path/x11config.pl
|
---|
78 |
|
---|
79 | /usr/sbin/installf -f $PKGINST
|
---|
80 |
|
---|
81 | # Setup our VBoxService SMF service
|
---|
82 | echo "Configuring service..."
|
---|
83 |
|
---|
84 | /usr/sbin/svccfg import /var/svc/manifest/system/virtualbox/vboxservice.xml
|
---|
85 | /usr/sbin/svcadm enable svc:/system/virtualbox/vboxservice
|
---|
86 |
|
---|
87 | echo "Done."
|
---|
88 |
|
---|