diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index 2988f6f1d..81c80ea5f 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -120,7 +120,7 @@ Vagrant.configure(2) do |config| end # rsync the spdk directory if provision hasn't happened yet - if spdk_dir != "none" + if ENV['COPY_SPDK_DIR'] == "1" && spdk_dir != "none" config.vm.synced_folder "#{spdk_dir}", "/home/vagrant/spdk_repo/spdk", type: "rsync", rsync__auto: false end diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index 869a46e90..048094a96 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -15,7 +15,7 @@ SPDK_DIR="$( cd "${DIR}/../../" && pwd )" # The command line help display_help() { echo - echo " Usage: ${0##*/} [-n ] [-s ] [-x ] [-hvr] " + echo " Usage: ${0##*/} [-n ] [-s ] [-x ] [-hvrl] " echo echo " distro = " echo @@ -27,6 +27,7 @@ display_help() { echo " (test VM qcow image, fio binary, ssh keys)" echo " --vhost-vm-dir= directory where to put vhost dependencies in VM" echo " -r dry-run" + echo " -l use a local copy of spdk, don't try to rsync from the host." echo " -h help" echo " -v verbose" echo @@ -45,13 +46,14 @@ SPDK_VAGRANT_HTTP_PROXY="" VERBOSE=0 HELP=0 +COPY_SPDK_DIR=1 DRY_RUN=0 SPDK_VAGRANT_DISTRO="distro" SPDK_VAGRANT_VMCPU=4 SPDK_VAGRANT_VMRAM=4096 OPTIND=1 -while getopts ":n:s:x:p:vrh-:" opt; do +while getopts ":n:s:x:p:vrlh-:" opt; do case "${opt}" in -) case "${OPTARG}" in @@ -84,6 +86,9 @@ while getopts ":n:s:x:p:vrh-:" opt; do display_help >&2 exit 0 ;; + l) + COPY_SPDK_DIR=0 + ;; *) echo " Invalid argument: -$OPTARG" >&2 echo " Try: \"$0 -h\"" >&2 @@ -142,6 +147,7 @@ export SPDK_VAGRANT_HTTP_PROXY export SPDK_VAGRANT_VMCPU export SPDK_VAGRANT_VMRAM export SPDK_DIR +export COPY_SPDK_DIR if [ -n "$PROVIDER" ]; then provider="--provider=${PROVIDER}"