checkinstall.sh revision 395d92a7732aad3c0b9baecedfabba5113b84485
## @file
#
# VirtualBox checkinstall script for Solaris.
#
#
# Copyright (C) 2009-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.
#
{
echo 1>&2 "$1"
}
{
echo 1>&2 "## $1"
}
{
errorprint "Please close all VirtualBox processes and re-run this installer."
exit 1
}
{
if test -z "$1"; then
errorprint "Missing argument to checkdep_svr4"
return 1
fi
if test $? -eq 0; then
return 0
fi
return 1
}
{
if test -z "$1"; then
errorprint "Missing argument to checkdep_svr4"
return 1
fi
# using "list" without "-a" only lists installed pkgs which is what we need
if test $? -eq 0; then
return 0
fi
return 1
}
# nothing to check for remote install
if test "x${PKG_INSTALL_ROOT:=/}" != "x/"; then
fi
# nothing to check for non-global zones
if test "$currentzone" != "global"; then
exit 0
fi
infoprint "Checking package dependencies..."
BIN_PKGINFO=`which pkginfo 2> /dev/null`
if test -x "$BIN_PKG"; then
else
fi
if test -x "$BIN_PKGINFO"; then
checkdep_svr4 "SUNWPython"
checkdep_svr4 "SUNWPython-devel"
checkdep_svr4 "SUNWuiu8"
else
PKG_MISSING_SVR4="SUNWPython SUNWPython-devel SUNWuiu8"
fi
if test ! -x "$BIN_PKG" && test ! -x "$BIN_PKGINFO"; then
errorprint "Missing or non-executable binaries: pkg ($BIN_PKG) and pkginfo ($BIN_PKGINFO)."
errorprint "Cannot check for dependencies."
errorprint ""
errorprint "Please install one of the required packaging system."
exit 1
fi
errorprint "Missing packages: "
errorprint "IPS : $PKG_MISSING_IPS"
errorprint "SVr4: $PKG_MISSING_SVR4"
errorprint ""
errorprint "Please install either the IPS or SVr4 packages before installing VirtualBox."
exit 1
else
infoprint "Done."
fi
# nothing more to do for remote installs
exit 0
fi
# Check if the Zone Access service is holding open vboxdrv, if so stop & remove it
if test ! -z "$servicefound"; then
infoprint "VirtualBox's zone access service appears to still be running."
infoprint "Halting & removing zone access service..."
# Don't delete the service, handled by manifest class action
# /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
fi
# Check if the Web service is running, if so stop & remove it
if test ! -z "$servicefound"; then
infoprint "VirtualBox web service appears to still be running."
infoprint "Halting & removing webservice..."
# Don't delete the service, handled by manifest class action
# /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
fi
# Check if the autostart service is running, if so stop & remove it
if test ! -z "$servicefound"; then
infoprint "VirtualBox autostart service appears to still be running."
infoprint "Halting & removing autostart service..."
fi
# Check if VBoxSVC is currently running
errorprint "VirtualBox's VBoxSVC (pid $VBOXSVC_PID) still appears to be running."
fi
# Check if VBoxNetDHCP is currently running
errorprint "VirtualBox's VBoxNetDHCP (pid $VBOXNETDHCP_PID) still appears to be running."
fi
# Check if vboxnet is still plumbed, if so try unplumb it
BIN_IFCONFIG=`which ifconfig 2> /dev/null`
if test -x "$BIN_IFCONFIG"; then
vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1`
infoprint "VirtualBox NetAdapter is still plumbed"
infoprint "Trying to remove old NetAdapter..."
errorprint "VirtualBox NetAdapter 'vboxnet0' couldn't be unplumbed (probably in use)."
fi
fi
infoprint "VirtualBox NetAdapter (Ipv6) is still plumbed"
infoprint "Trying to remove old NetAdapter..."
errorprint "VirtualBox NetAdapter 'vboxnet0' IPv6 couldn't be unplumbed (probably in use)."
fi
fi
fi
exit 0