postinstall.sh revision 61aab69cad4c5f9572bc6d00fb4acee64a1d37e9
#
# VirtualBox postinstall script for Solaris.
#
# Copyright (C) 2008-2010 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
LANG=C
export LANG
# uncompress(directory, file)
# Updates package metadata and uncompresses the file.
{
if test -z "$1" || test -z "$2"; then
echo "missing argument to uncompress_file()"
return 1
fi
# Remove compressed path from the pkg
# Add uncompressed path to the pkg
# Uncompress the file (removes compressed file when done)
}
{
# VBox guest files
uncompress_file "$1" "VBoxClient"
uncompress_file "$1" "VBoxService"
uncompress_file "$1" "VBoxControl"
# VBox Xorg Video drivers
# VBox Xorg Mouse drivers
}
solaris64dir="amd64"
solaris32dir="i386"
# get the current zone
# get what ISA the guest is running
if test "$cputype" = "amd64"; then
else
isadir=""
fi
# uncompress if necessary
if test -f "$vboxadditions32_path/VBoxClient.Z" || test -f "$vboxadditions64_path/VBoxClient.Z"; then
echo "Uncompressing files..."
if test -f "$vboxadditions32_path/VBoxClient.Z"; then
fi
if test -f "$vboxadditions64_path/VBoxClient.Z"; then
fi
fi
if test "$currentzone" = "global"; then
# vboxguest.sh would've been installed, we just need to call it.
echo "Configuring VirtualBox guest kernel module..."
# stop all previous moduels (vboxguest, vboxfs) and start only starts vboxguest
# create the device link
fi
else
xorgbin=""
retval=0
fi
# create links
echo "Creating links..."
if test "$currentzone" = "global"; then
fi
# Install Xorg components to the required places
if test ! -z "$xorgbin"; then
if test -z "$xorgversion_long"; then
fi
case "$xorgversion" in
1.3.* )
;;
1.4.* )
;;
1.5.99 | 1.6.* )
;;
1.5.* )
;;
1.7.*)
;;
1.8.*)
;;
1.9.*)
;;
1.10.*)
;;
7.1.* | *7.2.* )
;;
6.9.* | 7.0.* )
;;
esac
retval=0
if test -z "$vboxmouse_src"; then
echo "*** Unknown version of the X Window System installed."
echo "*** Failed to install the VirtualBox X Window System drivers."
# Exit as partially failed installation
retval=2
else
echo "Installing mouse and video drivers for X.Org $xorgversion..."
if test ! -d $vboxmouse32_dest_base; then
fi
if test ! -d $vboxvideo32_dest_base; then
fi
# snv_163 drops 32-bit support completely, and uses 32-bit locations for the 64-bit stuff. Ugly.
# We try to detect this by looking at bitness of "mouse_drv.so", and adjust our destination paths accordingly.
# We do not rely on using Xorg -version's ABI output because some builds (snv_162 iirc) have 64-bit ABI with
# 32-bit file locations.
if test -f "$vboxmouse32_dest_base/mouse_drv.so"; then
skip32="no"
else
echo "* Warning mouse_drv.so missing. Assuming Xorg ABI is 64-bit..."
fi
if test -z "$bitsize"; then
skip32="yes"
fi
# Make sure destination path exists
if test ! -d $vboxmouse32_dest_base || test ! -d $vboxvideo32_dest_base || test ! -d $vboxmouse64_dest_base || test ! -d $vboxvideo64_dest_base; then
echo "*** Missing destination paths for mouse or video modules. Aborting."
echo "*** Failed to install the VirtualBox X Window System drivers."
# Exit as partially failed installation
retval=2
else
# 32-bit x11 drivers
# Removing redundant names from pkg and files from disk
fi
# 64-bit x11 drivers
if test -f "$vboxadditions64_path/$vboxmouse_src"; then
# Removing redundant names from pkg and files from disk
fi
# Some distros like Indiana have no xorg.conf, deal with this
# Xorg 1.3.x+ should use the modeline less Xorg confs while older should
# use ones with all the video modelines in place. Argh.
case "$xorgversion" in
7.1.* | 7.2.* | 6.9.* | 7.0.* )
;;
esac
fi
# Adjust xorg.conf with mouse and video driver sections
fi
fi
# Setup our VBoxClient
echo "Configuring client..."
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/vboxclient.desktop=$vboxadditions_path/vboxclient.desktop s
fi
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
fi
# Try other autostart locations if none of the above ones work
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
else
echo "*** Failed to configure client, couldn't find any autostart directory!"
# Exit as partially failed installation
retval=2
fi
fi
else
fi
# Shared Folder kernel module (different for S10 & Nevada)
vboxfsmod="vboxfs"
vboxfsunused="vboxfs_s10"
if test "$osverstr" = "5.10"; then
vboxfsmod="vboxfs_s10"
vboxfsunused="vboxfs"
fi
# Move the appropriate module to kernel/fs & remove the unused module name from pkg and file from disk
# 64-bit shared folder module
if test -f "$vboxadditions64_path/$vboxfsmod"; then
echo "Installing 64-bit shared folders module..."
fi
# 32-bit shared folder module
if test -f "$vboxadditions32_path/$vboxfsmod"; then
echo "Installing 32-bit shared folders module..."
fi
# Add a group "vboxsf" for Shared Folders access
# All users which want to access the auto-mounted Shared Folders have to
# be added to this group.
# install openGL extensions for X.Org
if test ! -z "$xorgbin"; then
# 32-bit crogl opengl library replacement
if test -f "/usr/lib/VBoxOGL.so"; then
fi
# 64-bit crogl opengl library replacement
if test -f "/usr/lib/amd64/VBoxOGL.so"; then
fi
fi
# Finalize
if test "$currentzone" = "global"; then
# Setup our VBoxService SMF service
echo "Configuring service..."
# Update boot archive
if test -x "$BOOTADMBIN"; then
echo "Updating boot archive..."
else
echo "## Guest kernel module doesn't seem to be up. Skipped explicit boot-archive update."
fi
else
echo "## $BOOTADMBIN not found/executable. Skipped explicit boot-archive update."
fi
fi
echo "Done."
if test ! -z "$xorgbin"; then
echo "Please re-login to activate the X11 guest additions."
fi
echo "If you have just un-installed the previous guest additions a REBOOT is required."
fi
exit $retval