postinstall.sh revision 9ced981a0263f6280ccbf5dc64c0e81fbe4a2fda
332d68e9666b04a5aa788a586d9f4c6b1f19c700vboxsync# innotek VirtualBox
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync# VirtualBox postinstall script for Solaris.
332d68e9666b04a5aa788a586d9f4c6b1f19c700vboxsync# Copyright (C) 2008 innotek GmbH
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# available from http://www.virtualbox.org. This file is free software;
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# you can redistribute it and/or modify it under the terms of the GNU
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# General Public License (GPL) as published by the Free Software
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9496b6f77d66eb89f088668752b8838d578d6e10vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsyncecho "innotek VirtualBox Guest Additions - postinstall script"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsyncecho "This script will setup and load the VirtualBox Guest kernel module..."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# vboxguest.sh would've been installed, we just need to call it.
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync$vboxadditions_path/vboxguest.sh restart silentunload
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# suid permissions for timesync
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncecho "Setting permissions..."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# create links
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncecho "Creating links..."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync/usr/sbin/installf -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxClient=$vboxadditions_path/VBoxClient s
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxService=$vboxadditions_path/VBoxService s
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync/usr/sbin/installf -c none $PKGINST /usr/bin/VBoxRandR=$vboxadditions_path/VBoxRandR.sh s
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# Install Xorg components to the required places
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncxorgversion_long=`/usr/bin/X11/Xorg -version 2>&1 | grep "X Window System Version"`
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncxorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X Window System Version \([^ ]*\)'`
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync vboxvideo_src="$vboxadditions_path/vboxvideo_drv_13.so"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync vboxmouse_src="$vboxadditions_path/vboxmouse_drv_14.so"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync vboxvideo_src="$vboxadditions_path/vboxvideo_drv_14.so"
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync vboxmouse_src="$vboxadditions_path/vboxmouse_drv_71.so"
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync vboxvideo_src="$vboxadditions_path/vboxvideo_drv_71.so"
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync vboxmouse_src="$vboxadditions_path/vboxmouse_drv_70.so"
9a08dd6ed47cffa9cacbb9d53db1ce71d04db61fvboxsync vboxvideo_src="$vboxadditions_path/vboxvideo_drv_70.so"
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsyncif test -z "$vboxmouse_src"; then
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync echo "*** Unknown version of the X Window System installed."
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync echo "*** Failed to install the VirtualBox X Window System drivers."
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync # Exit as partially failed installation
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync vboxmouse_dest="/usr/lib/X11/modules/input/vboxmouse_drv.so"
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync vboxvideo_dest="/usr/lib/X11/modules/input/vboxvideo_drv.so"
b459362b1c9b5ce5e6bf4ceb32ffe1294c08be07vboxsync /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
b459362b1c9b5ce5e6bf4ceb32ffe1294c08be07vboxsync /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync echo "Installed VirtualBox mouse and video drivers for Xorg $xorgversion"
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync # Removing redudant files
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null 2>/dev/null
53e1c27c7564c45ad0b92676ddea561591a3e869vboxsync /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null 2>/dev/null
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync # Some distros like Indiana have no xorg.conf, deal with this
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync mv -f $vboxadditions_path/solaris_xorg.conf /etc/X11/.xorg.conf
0c8b774aca1168c2007424a49f6fa159fc23e42bvboxsync echo "Configuring Xorg..."
f4ccb18a71e0e531719734918583f84fbc72ebfevboxsync# Setup our VBoxClient
7bff28e0cedd8656acd24b420759649184d8cf00vboxsyncecho "Configuring client..."
cfd41a3683178a30bac4417128b4673806653797vboxsyncif test -d "$vboxclient_dest"; then
cfd41a3683178a30bac4417128b4673806653797vboxsync /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/1099.vboxclient" f
cfd41a3683178a30bac4417128b4673806653797vboxsync cp "$vboxclient_src/1099.vboxclient" "$vboxclient_dest/1099.vboxclient"
cfd41a3683178a30bac4417128b4673806653797vboxsync /usr/sbin/installf -c none $PKGINST "$vboxclient_dest/vboxclient.desktop" f
cfd41a3683178a30bac4417128b4673806653797vboxsync cp "$vboxclient_src/vboxclient.desktop" "$vboxclient_dest/vboxclient.desktop"
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsync echo "*** Failed to configure client!! Couldn't find autostart directory."
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsync# Remove redundant files
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsync/usr/sbin/removef $PKGINST $vboxadditions_path/etc/devlink.tab 1>/dev/null
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync/usr/sbin/removef $PKGINST $vboxadditions_path/etc 1>/dev/null
b8b61ff747c97d77b48c572a474969b1892d591dvboxsync# Setup our VBoxService SMF service
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsyncecho "Configuring service..."
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync/usr/sbin/svccfg import /var/svc/manifest/system/virtualbox/vboxservice.xml
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync/usr/sbin/svcadm enable svc:/system/virtualbox/vboxservice
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsyncecho "Done."
77c85c820fe4467a0856134e0c9e5c5790cd847evboxsync echo "Please restart X Window System for activating the X11 guest additions."