postinstall.sh revision e27467c77543dda00047807bdd69b62f1cd50fee
# available from http://www.virtualbox.org. This file is free software;
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
LC_ALL=C
export LC_ALL
LANG=C
export LANG
if test -f "$vboxadditions32_path/VBoxClient.Z" || test -f "$vboxadditions64_path/VBoxClient.Z"; then
if test -f "$vboxadditions32_path/VBoxClient.Z"; then
if test -f "$vboxadditions64_path/VBoxClient.Z"; then
# vboxguest.sh would've been installed, we just need to call it.
if test ! -z "$xorgbin"; then
if test -z "$xorgversion_long"; then
if test -z "$vboxmouse_src"; then
echo "Installing mouse and video drivers for X.Org $xorgversion..."
if test ! -d $vboxmouse32_dest_base; then
if test ! -d $vboxvideo32_dest_base; then
# 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
if test -f "$vboxmouse32_dest_base/mouse_drv.so"; then
echo "* Warning mouse_drv.so missing. Assuming Xorg ABI is 64-bit..."
if test -z "$bitsize"; then
if test ! -d $vboxmouse32_dest_base || test ! -d $vboxvideo32_dest_base || test ! -d $vboxmouse64_dest_base || test ! -d $vboxvideo64_dest_base; then
if test -f "$vboxadditions64_path/$vboxmouse_src"; then
# 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
# Adjust xorg.conf with mouse and video driver sections
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/vboxclient.desktop=$vboxadditions_path/vboxclient.desktop s
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
if test -d "$vboxclient_dest"; then
/usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
# Move the appropriate module to kernel/fs & remove the unused module name from pkg and file from disk
if test -f "$vboxadditions64_path/$vboxfsmod"; then
if test -f "$vboxadditions32_path/$vboxfsmod"; then
# install openGL extensions for X.Org
if test ! -z "$xorgbin"; then
if test -f "/usr/lib/VBoxOGL.so"; then
if test -f "/usr/lib/amd64/VBoxOGL.so"; then
# Move the pointer integration module to kernel/drv & remove the unused module name from pkg and file from disk
# 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.
echo "## See /var/svc/log/system-manifest-import:default.log for details."
if test -x "$BOOTADMBIN"; then
echo "## $BOOTADMBIN not found/executable. Skipped explicit boot-archive update."
if test ! -z "$xorgbin"; then
exit $retval