Update dependency checks
VirtualBox scripts rely on various utilities to function. To validate the environment, virtualbox/prepare-environment.sh checks if all these utilities are available to the shell. However, some of the checks (namely xxd and ssh) were missing. This change should fix this by aborting the prepare step in case if these utilities are not found. Change-Id: Ic49c11054345964c9785e9c4c791ea33dba4791c Partial-Bug: 1525967
This commit is contained in:
parent
a1bf0cf649
commit
3d03ec3ee1
|
@ -19,11 +19,11 @@
|
|||
# This script performs initial check and configuration of the host system. It:
|
||||
# - verifies that all available command-line tools are present on the host system
|
||||
#
|
||||
# We are avoiding using 'which' because of http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
|
||||
# We are avoiding using 'which' because of http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
|
||||
#
|
||||
|
||||
# Include the script with handy functions to operate VMs and VirtualBox networking
|
||||
source ./config.sh
|
||||
source ./config.sh
|
||||
source ./functions/vm.sh
|
||||
source ./functions/network.sh
|
||||
source ./functions/shell.sh
|
||||
|
@ -50,6 +50,16 @@ else
|
|||
echo "OK"
|
||||
fi
|
||||
|
||||
# Check for xxd
|
||||
echo -n "Checking for 'xxd'... "
|
||||
execute type xxd >/dev/null 2>&1
|
||||
if [ $? -eq 1 ]; then
|
||||
echo "\"xxd\" is not available in the path, but it's required. Please install the \"xxd\" package. Aborting."
|
||||
exit 1
|
||||
else
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
# Check for VirtualBox
|
||||
echo "If you run this script under Cygwin, you may have to add path to VirtualBox directory to your PATH. "
|
||||
echo "Usually it is enough to run \"export PATH=\$PATH:\"/cygdrive/c/Program Files/Oracle/VirtualBox\" "
|
||||
|
@ -108,7 +118,7 @@ echo -n "Checking if ipconfig or ifconfig installed... "
|
|||
case "$(execute uname)" in
|
||||
Linux | Darwin)
|
||||
if ! execute test -x /sbin/ifconfig ; then
|
||||
echo "No ifconfig available at /sbin/ifconfig path! This path is hard-coded into VBoxNetAdpCtl utility."
|
||||
echo "No ifconfig available at /sbin/ifconfig path! This path is hard-coded into VBoxNetAdpCtl utility."
|
||||
echo "Please install ifconfig or create symlink to proper interface configuration utility. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue