vm_setup: Add arg for disabling use of tsocks

This mainly concerns QEMU compilation. For system which have installed
tsocks, vm_setup.sh always tries to pass --with-git to QEMU's configure
even when tsocks is not really used (it determines that based on $CONF
which by default has tsocks enabled and presence of the tsocks binary).
Since in that scenario qemu compilation would simply fail, allow user
to force vm_setup.sh into simply ignoring tsocks alltogether.

This is an alternative for a change which potentially could break the
compatibility by removing tsocks from default $CONF list (I guess there
may be some systems out there that relay on tsocks and its default setup
in the $CONF).

Change-Id: Id3583357878002c79e1a554df664c297a0e39cb3
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2787
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
Michal Berger 2020-06-05 17:22:50 +02:00 committed by Tomasz Zawadzki
parent a66c52fd5c
commit 4892b9353d
2 changed files with 5 additions and 2 deletions

View File

@ -176,7 +176,7 @@ function install_qemu() {
# Most tsocks proxies rely on a configuration file in /etc/tsocks.conf.
# If using tsocks, please make sure to complete this config before trying to build qemu.
if [[ $INSTALL_TSOCKS == true ]]; then
if [[ $INSTALL_TSOCKS == true && $NO_TSOCKS != true ]]; then
if hash tsocks 2> /dev/null; then
opt_params+=("--with-git='tsocks git'")
fi

View File

@ -55,6 +55,7 @@ function usage() {
echo " -t --test-conf List of test configurations to enable (${CONF})"
echo " -c --conf-path Path to configuration file"
echo " -d --dir-git Path to where git sources should be saved"
echo " -s --disable-tsocks Disable use of tsocks"
exit 0
}
@ -79,7 +80,7 @@ else
fi
# Parse input arguments #
while getopts 'd:iuht:c:-:' optchar; do
while getopts 'd:siuht:c:-:' optchar; do
case "$optchar" in
-)
case "$OPTARG" in
@ -89,6 +90,7 @@ while getopts 'd:iuht:c:-:' optchar; do
test-conf=*) CONF="${OPTARG#*=}" ;;
conf-path=*) CONF_PATH="${OPTARG#*=}" ;;
dir-git=*) GIT_REPOS="${OPTARG#*=}" ;;
disable-tsocks) NO_TSOCKS=true ;;
*)
echo "Invalid argument '$OPTARG'"
usage
@ -101,6 +103,7 @@ while getopts 'd:iuht:c:-:' optchar; do
t) CONF="$OPTARG" ;;
c) CONF_PATH="$OPTARG" ;;
d) GIT_REPOS="$OPTARG" ;;
s) NO_TSOCKS=true ;;
*)
echo "Invalid argument '$OPTARG'"
usage