Commit 9d7b1f75 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

vm_setup: Clone spdk from a separate function



Change-Id: I59030c4570a03f8c6dfcf4a5f86426e3b5875744
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2527


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
parent 3920b816
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
function install_spdk() {
	mkdir -p spdk_repo/output || echo "Can not create spdk_repo/output directory."

	if [ -d spdk_repo/spdk ]; then
		echo "spdk source already present, not cloning"
	else
		git -C spdk_repo clone "${GIT_REPO_SPDK}"
	fi
	git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}"
	git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}"
	git -C spdk_repo/spdk submodule update --init --recursive
}

function install_refspdk() {
	local last_release
	local output_dir
@@ -318,6 +331,14 @@ sources+=(install_fio)

sudo mkdir -p /usr/{,local}/src

if [[ $INSTALL_REFSPDK == true ]]; then
	# Serialize builds as refspdk depends on spdk
	install_spdk
	install_refspdk
else
	sources+=(install_spdk)
fi

for source in "${sources[@]}"; do
	source_conf=${source^^}
	if [[ ${!source_conf} == true ]]; then
+1 −12
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*})

UPGRADE=false
INSTALL=false
CONF="rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,refspdk"
CONF="rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,spdk,refspdk"
gcc_version=$(gcc -dumpversion) gcc_version=${gcc_version%%.*}

if [[ -e /etc/os-release ]]; then
@@ -122,17 +122,6 @@ if $INSTALL; then
	install "${packages[@]}"
fi

mkdir -p spdk_repo/output || echo "Can not create spdk_repo/output directory."

if [ -d spdk_repo/spdk ]; then
	echo "spdk source already present, not cloning"
else
	git -C spdk_repo clone "${GIT_REPO_SPDK}"
fi
git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}"
git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}"
git -C spdk_repo/spdk submodule update --init --recursive

source "$vmsetupdir/pkgdep/git"

# create autorun-spdk.conf in home folder. This is sourced by the autotest_common.sh file.