postinstall.sh revision 4c2aecdcad45a083de7849d50ab2acab95f7e719
# $Id$
## @file
# VirtualBox postinstall script for Solaris Guest Additions.
#
#
# Copyright (C) 2008-2013 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.
#
# LC_ALL should take precedence over LC_* and LANG but whatever...
LC_ALL=C
export LC_ALL
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)
}
# uncompress_files(directory_with_*.Z_files)
{
done
}
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
# Then the next sed, strips of all '.' characters, "1.11" -> "111".
vboxvideo_src="vboxvideo_drv_$fileversion.so"
# Handle exceptions now where the X.org version does not exactly match the file-version.
case "$xorgversion" in
1.5.99 )
;;
7.2.* )
;;
6.9.* )
;;
esac
retval=0
if test -z "$vboxvideo_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
elif test ! -f "$vboxadditions32_path/$vboxvideo_src" && test ! -f "$vboxadditions64_path/$vboxvideo_src"; then
echo "*** $vboxadditions32_path/$vboxvideo_src or $vboxadditions64_path/$vboxvideo_src not found!"
echo "*** Failed to install the VirtualBox X.org drivers."
# Exit as partially failed installation
retval=2
else
echo "Installing video driver for X.Org $xorgversion..."
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 "vesa_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 "$vboxvideo32_dest_base/vesa_drv.so"; then
skip32="no"
else
echo "* Warning vesa_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 $vboxvideo64_dest_base; then
echo "*** Missing destination paths for video module. Aborting."
echo "*** Failed to install the VirtualBox X Window System driver."
# 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/$vboxvideo_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
# Check for VirtualBox graphics card
is_vboxgraphics=`prtconf -d | grep -i pci80ee,beef`
drivername="vboxvideo"
else
# Check for VMware graphics card
is_vmwaregraphics=`prtconf -d | grep -i pci15ad,405`
echo "Configuring X.Org to use VMware SVGA graphics driver..."
drivername="vmware"
fi
fi
# Adjust xorg.conf with video driver sections if a supported graphics card is found
if test ! -z "$drivername"; then
else
# No supported graphics card found, do nothing.
echo "## No supported graphics card found. Skipped configuring of X.org drivers."
fi
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
# Move the pointer integration module to kernel/drv & remove the unused module name from pkg and file from disk
# Finalize
if test "$currentzone" = "global"; then
# Setup VBoxService and vboxmslnk and start the services automatically
echo "Configuring services (this might take a while)..."
cmax=32
cslept=0
success=0
# Since S11 the way to import a manifest is via restarting manifest-import which is asynchronous and can
# take a while to complete, using disable/enable -s doesn't work either. So we restart it, and poll in
# 1 second intervals to see if our service has been successfully imported and timeout after 'cmax' seconds.
do
sleep 1
success=1
break
fi
done
echo "Enabling services..."
else
echo "## Service import failed."
echo "## See /var/svc/log/system-manifest-import:default.log for details."
# Exit as partially failed installation
retval=2
fi
# 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