xref: /spdk/test/common/config/pkgdep/git (revision d182ee1d5acd5f3a3af9daab34edebdacb0e03be)
1function install_qat() {
2	if ! hash yasm; then
3		install yasm
4	fi
5
6	install libnl3 libnl3-devel || install libnl-3-200 libnl-3-dev libnl-genl-3-dev
7
8	in_syms() {
9		local syms
10		if [[ -e /proc/kallsyms ]]; then
11			syms=/proc/kallsyms
12		elif [[ -e /boot/System.map-$kernel_ver ]]; then
13			syms=/boot/System.map-$kernel_ver
14		else
15			return 0
16		fi
17
18		grep -q "$1" "$syms"
19	}
20
21	if [[ -e /sys/module/qat_c62x ]]; then
22		sudo modprobe -r qat_c62x || :
23	fi
24	if [[ -d $GIT_REPOS/QAT ]]; then
25		sudo rm -rf "$GIT_REPOS/QAT"
26	fi
27
28	mkdir "$GIT_REPOS/QAT"
29
30	tar -C "$GIT_REPOS/QAT" -xzof - < <(wget -O- "$DRIVER_LOCATION_QAT")
31
32	patch --dir="$GIT_REPOS/QAT" -p1 \
33		< "$rootdir/test/common/config/pkgdep/patches/qat/0001-old-style-declaration.patch"
34	patch --dir="$GIT_REPOS/QAT" -p1 \
35		< "$rootdir/test/common/config/pkgdep/patches/qat/0001-empty-body.patch"
36
37	(cd "$GIT_REPOS/QAT" && sudo ./configure --enable-icp-sriov=host && sudo make install)
38
39	if ! sudo service qat_service start; then
40		echo "failed to start the qat service. Something may be wrong with your device or package."
41	fi
42}
43
44function install_rocksdb() {
45	# Rocksdb is installed for use with the blobfs tests.
46	if [ ! -d /usr/src/rocksdb ]; then
47		git clone "${GIT_REPO_ROCKSDB}" "$GIT_REPOS/rocksdb"
48		git -C "$GIT_REPOS/rocksdb" checkout 6.15.fb
49		sudo mv "$GIT_REPOS/rocksdb" /usr/src/
50	else
51		sudo git -C /usr/src/rocksdb checkout spdk-v8.1.1
52		echo "rocksdb already in /usr/src. Not checking out again"
53	fi
54}
55
56function install_ittapi() {
57	# Install Intel Instrumentation and Trace API
58	local ittapi_version=v3.24.5 ittapi_dir=/usr/src/ittapi
59
60	rm -rf "$ittapi_dir"
61	git clone "${GIT_REPO_ITTAPI}" --branch "$ittapi_version" "$GIT_REPOS/ittapi"
62	make -C "$GIT_REPOS/ittapi/src/ittnotify_refcol"
63
64	mv "$GIT_REPOS/ittapi" "$ittapi_dir"
65	ln -s . "$ittapi_dir/sdk"
66}
67
68function install_fio() {
69	# This version of fio is installed in /usr/src/fio to enable
70	# building the spdk fio plugin.
71	local fio_version="fio-3.35"
72
73	if [ ! -d /usr/src/fio ]; then
74		if [ ! -d fio ]; then
75			git clone "${GIT_REPO_FIO}" "$GIT_REPOS/fio"
76			sudo mv "$GIT_REPOS/fio" /usr/src/
77		else
78			sudo mv "$GIT_REPOS/fio" /usr/src/
79		fi
80		(
81			git -C /usr/src/fio checkout master \
82				&& git -C /usr/src/fio pull \
83				&& git -C /usr/src/fio checkout $fio_version \
84				&& if [ $OSID == 'freebsd' ]; then
85					gmake -C /usr/src/fio -j${jobs} \
86						&& sudo gmake -C /usr/src/fio install
87				else
88					make -C /usr/src/fio -j${jobs} \
89						&& sudo make -C /usr/src/fio install
90				fi
91		)
92	else
93		echo "fio already in /usr/src/fio. Not installing"
94	fi
95}
96
97function install_flamegraph() {
98	# Flamegraph is used when printing out timing graphs for the tests.
99	if [ ! -d /usr/local/FlameGraph ]; then
100		git clone "${GIT_REPO_FLAMEGRAPH}" "$GIT_REPOS/FlameGraph"
101		mkdir -p /usr/local
102		sudo mv "$GIT_REPOS/FlameGraph" /usr/local/FlameGraph
103	else
104		echo "flamegraph already installed. Skipping"
105	fi
106}
107
108function _install_qemu() {
109	local repo=$1
110	local branch=$2
111	local prefix=${3:-}
112	local name=${4:-}
113
114	mkdir -p "$GIT_REPOS/qemu"
115
116	local repo_dir=$GIT_REPOS/qemu/$branch
117	if [[ -n $prefix ]]; then
118		repo_dir=$GIT_REPOS/qemu/$prefix-$branch
119	fi
120
121	if [[ ! -d $repo_dir ]]; then
122		git clone "$repo" -b "$branch" "$repo_dir"
123	else
124		echo "qemu already checked out. Skipping"
125	fi
126
127	declare -a opt_params=("--prefix=/usr/local/qemu/${repo_dir##*/}")
128	declare -a extra_cflags=()
129
130	opt_params+=("--disable-docs")
131	if ((gcc_version >= 9)); then
132		opt_params+=("--disable-glusterfs")
133	fi
134
135	extra_cflags+=("-Wno-error")
136
137	# Most tsocks proxies rely on a configuration file in /etc/tsocks.conf.
138	# If using tsocks, please make sure to complete this config before trying to build qemu.
139	if [[ $INSTALL_TSOCKS == true && $NO_TSOCKS != true ]]; then
140		if hash tsocks 2> /dev/null; then
141			opt_params+=("--with-git='tsocks git'")
142		fi
143	fi
144	opt_params+=("--extra-cflags=${extra_cflags[*]}")
145
146	if [[ $prefix == vanilla ]]; then
147		# Latest qemu seems to take sysconfdir from the prefix and instead of checking /etc
148		# it looks under /usr/local/qemu/vanilla*/bin/../etc which is a bit peculiar. Fix it.
149		opt_params+=("--sysconfdir=/etc/")
150	fi
151
152	# The qemu configure script places several output files in the CWD.
153	(cd "$repo_dir" && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa)
154
155	make -C "$repo_dir" -j${jobs}
156	sudo make -C "$repo_dir" install
157
158	# Add a symlink to point at a latest build - this is useful to easily track QEMU flavors for which
159	# branches change quite often (e.g. vfio-user's).
160	[[ -n $name ]] || return 0
161	[[ -L /usr/local/qemu/$name-latest ]] && sudo rm "/usr/local/qemu/$name-latest"
162	sudo ln -s "/usr/local/qemu/${repo_dir##*/}" "/usr/local/qemu/$name-latest"
163}
164
165function install_qemu() {
166	# Four versions of QEMU are used in the tests, three are installed
167	# directly from the source. Each QEMU is dedicated for different
168	# use-cases:
169	#  - Packed QEMU: version provided by given distro. Used to boot VMs
170	#    from within vhost tests.
171	#  - vfio-user QEMU: A special fork to test libvfio-user components.
172	#  - Vanilla QEMU: Used by the CI to boot the testing VMs.
173
174	_install_qemu $GIT_REPO_QEMU_VFIO $VFIO_QEMU_BRANCH "" vfio-user
175	_install_qemu "$GIT_REPO_QEMU" "$VANILLA_QEMU_BRANCH" vanilla vanilla
176}
177
178function install_nvmecli() {
179	# nvme-cli >1.11.1 should be used.
180	rm -rf "$GIT_REPOS/nvme-cli-cuse"
181	git clone "https://github.com/linux-nvme/nvme-cli.git" "$GIT_REPOS/nvme-cli-cuse"
182	git -C "$GIT_REPOS/nvme-cli-cuse" checkout v2.5
183
184	meson setup --force-fallback-for=libnvme \
185		"$GIT_REPOS/nvme-cli-cuse/.build" \
186		"$GIT_REPOS/nvme-cli-cuse"
187	meson compile -C "$GIT_REPOS/nvme-cli-cuse/.build"
188
189	rm -rf /usr/local/src/nvme-cli
190	mv "$GIT_REPOS/nvme-cli-cuse" /usr/local/src/nvme-cli
191
192	# Make sure binary is available for the cuse tests
193	if [[ -e /usr/local/src/nvme-cli/.build/nvme ]]; then
194		sudo ln -s .build/nvme /usr/local/src/nvme-cli/
195	fi
196}
197
198# This function install version of nvme-cli, that support listing spdk nvme
199# devices, should be remove after changes present in nvme-cli upstream.
200function install_nvmecli_plugin() {
201	rm -rf "$GIT_REPOS/nvme-cli-plugin"
202
203	git clone $GIT_REPO_NVME_CLI "$GIT_REPOS/nvme-cli-plugin"
204	git -C "$GIT_REPOS/nvme-cli-plugin" fetch $GIT_REPO_NVME_CLI refs/changes/95/16795/12
205	git -C "$GIT_REPOS/nvme-cli-plugin" checkout FETCH_HEAD
206
207	meson setup --force-fallback-for=libnvme,json-c \
208		"$GIT_REPOS/nvme-cli-plugin/.build" \
209		"$GIT_REPOS/nvme-cli-plugin"
210	meson compile -C "$GIT_REPOS/nvme-cli-plugin/.build"
211
212	rm -rf /usr/local/src/nvme-cli-plugin
213	mv "$GIT_REPOS/nvme-cli-plugin" /usr/local/src/nvme-cli-plugin
214
215	# Make sure binary is available for the plugin tests
216	if [[ -e /usr/local/src/nvme-cli-plugin/.build/nvme ]]; then
217		sudo ln -s .build/nvme /usr/local/src/nvme-cli-plugin/
218	fi
219}
220
221function install_libiscsi() {
222	# We currently don't make any changes to the libiscsi repository for our tests, but it is possible that we will need
223	# to later. Cloning from git is just future proofing the machines.
224	if [[ ! -d $GIT_REPOS/libiscsi ]]; then
225		git clone "${GIT_REPO_LIBISCSI}" "$GIT_REPOS/libiscsi"
226	else
227		echo "libiscsi already checked out. Skipping"
228	fi
229	(cd "$GIT_REPOS/libiscsi" && ./autogen.sh && ./configure --prefix=/usr/local/libiscsi)
230	make -C "$GIT_REPOS/libiscsi" -j${jobs} WARN_CFLAGS=
231	sudo make -C "$GIT_REPOS/libiscsi" install
232}
233
234function install_git() {
235	if type -P git; then
236		if ge "$(git --version | awk '{print $3}')" "$GIT_VERSION"; then
237			return 0
238		fi
239	fi >/dev/null
240
241	install zlib-devel curl-devel
242	tar -C "$GIT_REPOS" -xzof <(wget -qO- "$GIT_REPO_GIT")
243	(cd "$GIT_REPOS/git-$GIT_VERSION" \
244		&& make configure \
245		&& ./configure \
246		&& sudo make -j${jobs} install)
247}
248
249function install_extra_pkgs() {
250	if [[ $INSTALL_QAT == true ]]; then
251		install libudev-devel || install libudev-dev || :
252	fi
253
254	if [[ $INSTALL_QEMU == true ]]; then
255		install qemu-system-x86 qemu-img \
256			|| install qemu-system-x86 qemu-utils \
257			|| install qemu
258
259		# Install extra dependency which was removed from Qemu 7.2 source tree
260		install libslirp-devel \
261			|| install libslirp-dev
262	fi || :
263}
264
265function install_vagrant() {
266	local vagrant_version="2.2.7"
267	local vagrant_installer="vagrant_${vagrant_version}_x86_64.deb"
268	local vagrant_plugins=(vagrant-libvirt vagrant-sshfs vagrant-cachier vagrant-proxyconf)
269
270	if [[ $OSID != ubuntu ]]; then
271		echo "Currently, Vagrant installation is supported only on ubuntu"
272		return 0
273	fi
274
275	# Install vagrant and it's plugins dependencies
276	# function should be defined in pkgdep/$package_manager file
277	install_vagrant_dependencies
278
279	# Download and install vagrant
280	if hash vagrant &> /dev/null; then
281		echo "Vagrant is already installed"
282	else
283		wget "https://releases.hashicorp.com/vagrant/${vagrant_version}/${vagrant_installer}"
284		sudo dpkg -i "${vagrant_installer}"
285	fi
286	vagrant --version
287
288	# Install vagrant plugins
289	local vagrant_plugin_list
290	vagrant_plugin_list=$(vagrant plugin list)
291
292	local plugin
293	for plugin in "${vagrant_plugins[@]}"; do
294		if grep -Fq "$plugin" <<< "$vagrant_plugin_list"; then
295			echo "$plugin already installed"
296		else
297			vagrant plugin install "$plugin"
298		fi
299	done
300}
301
302function install_igb_uio() {
303	git clone "${GIT_REPO_DPDK_KMODS}" "$GIT_REPOS/dpdk-kmods"
304
305	(cd "$GIT_REPOS/dpdk-kmods/linux/igb_uio" && make -j ${jobs})
306	sudo mkdir -p "/lib/modules/$(uname -r)/extra/dpdk"
307	sudo cp "$GIT_REPOS/dpdk-kmods/linux/igb_uio/igb_uio.ko" "/lib/modules/$(uname -r)/extra/dpdk"
308	sudo depmod
309}
310
311function install_irdma() {
312	local RDMA_CORE_VERSION=51.0
313	local RDMA_CORE=https://github.com/linux-rdma/rdma-core/releases/download/v$RDMA_CORE_VERSION/rdma-core-$RDMA_CORE_VERSION.tar.gz
314	local packages=() hint=""
315
316	case "$ID" in
317		fedora)
318			install \
319				ninja-build \
320				pandoc \
321				perl-generators \
322				valgrind-devel \
323				python-docutils \
324				libnl3 \
325				libnl3-devel \
326				python3-Cython
327				;;
328		debian | ubuntu)
329			install \
330				debhelper \
331				dh-python \
332				python3-docutils
333			;;
334		*)
335			echo "irdma installation not supported under $ID" >&2
336			return 0
337			;;
338	esac
339
340	rm -rf "$GIT_REPOS/irdma-$IRDMA_VERSION"
341	rm -rf "$GIT_REPOS/rdma-core-$RDMA_CORE_VERSION"
342
343	curl -L -o- "$IRDMA_DRIVER" | tar -C "$GIT_REPOS" -xzf -
344
345	if ge "$kernel_ver" 6.10; then
346		patch --dir="$GIT_REPOS/irdma-$IRDMA_VERSION" -p1  \
347			< "$rootdir/test/common/config/pkgdep/patches/irdma/0001-ip_route_output.patch"
348	fi
349
350	if ge "$kernel_ver" 6.11; then
351		patch --dir="$GIT_REPOS/irdma-$IRDMA_VERSION" -p1  \
352			< "$rootdir/test/common/config/pkgdep/patches/irdma/0001-uverbs_attr.patch"
353	fi
354
355	[[ -e $GIT_REPOS/irdma-$IRDMA_VERSION/build.sh ]]
356
357	(
358		cd "$GIT_REPOS/irdma-$IRDMA_VERSION"
359		sed -i "s/IRDMA_FLUSH_DELAY_MS 1500/IRDMA_FLUSH_DELAY_MS 50/" \
360			"$GIT_REPOS/irdma-$IRDMA_VERSION/src/irdma/verbs.h"
361		"$GIT_REPOS/irdma-$IRDMA_VERSION/build.sh"
362	)
363
364	# Fetch and build the rdma-core irdma depends on
365	curl -L -o- "$RDMA_CORE" | tar -C "$GIT_REPOS" -xzf -
366	[[ -e $GIT_REPOS/irdma-$IRDMA_VERSION/libirdma-$RDMA_CORE_VERSION.patch ]]
367
368	patch --dir="$GIT_REPOS/rdma-core-$RDMA_CORE_VERSION" -p2 \
369		< "$GIT_REPOS/irdma-$IRDMA_VERSION/libirdma-$RDMA_CORE_VERSION.patch"
370
371	case "$ID" in
372		fedora)
373			[[ -e $GIT_REPOS/rdma-core-$RDMA_CORE_VERSION/redhat/rdma-core.spec ]]
374			# Note that paths and the name of the package are hardcoded into .spec, hence they need
375			# to stay like this.
376			mkdir -p "$HOME/rpmbuild/"{SOURCES,SPECS}
377			cp "$GIT_REPOS/rdma-core-$RDMA_CORE_VERSION/redhat/rdma-core.spec" "$HOME/rpmbuild/SPECS"
378
379			# Re-package the source
380			tar -czf "$HOME/rpmbuild/SOURCES/rdma-core-$RDMA_CORE_VERSION.tar.gz" \
381				-C "$GIT_REPOS" "rdma-core-$RDMA_CORE_VERSION"
382
383			# Build the rpms
384			(
385				cd "$HOME/rpmbuild/SPECS"
386				# Make sure stock ninja-build is used
387				PATH="/usr/bin:$PATH" rpmbuild -ba rdma-core.spec
388			)
389
390			packages=("$HOME/rpmbuild/RPMS/x86_64/"*.rpm)
391			hint="$package_manager install [--allowerasing] $HOME/rpmbuild/RPMS/x86_64/*.rpm"
392			;;
393		debian | ubuntu)
394			[[ -e $GIT_REPOS/rdma-core-$RDMA_CORE_VERSION/debian/control ]]
395
396			# Build the debs
397			(
398				cd "$GIT_REPOS/rdma-core-$RDMA_CORE_VERSION"
399				dh clean --with python3,systemd --builddirectory=build-deb
400				dh build --with systemd --builddirectory=build-deb
401				dh binary --with systemd --builddirectory=build-deb
402			)
403
404			packages=("$GIT_REPOS/"*.deb)
405			hint="dpkg --install $GIT_REPOS/*.deb"
406			;;
407	esac
408
409	((${#packages[@]} > 0)) || return 1
410
411	cat <<-EOF
412
413		INFO: rdma-core-$RDMA_CORE_VERSION was successfully built, following packages are
414		available for installation:
415
416		$(printf '  - %s\n' "${packages[@]##*/}")
417
418		Note that installing the above packages may raise conflicts with their
419		potentially newer versions already installed on the system. Dependent
420		packages may be uninstalled during the process as well. Please, run the
421		following command to finish the installation:
422
423		  $hint
424	EOF
425}
426
427function install_ice() {
428	rm -rf "$GIT_REPOS/ice-$ICE_VERSION"
429
430	curl -L -o- "$ICE_DRIVER" | tar -C "$GIT_REPOS" -xzf -
431
432	if ge "$kernel_ver" 6.10; then
433		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
434			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-__assign_str.patch"
435		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
436			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-napi_alloc_skb.patch"
437		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
438			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-devlink_param.patch"
439		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
440			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-xsk_buff_dma.patch"
441	fi
442
443	if ge "$kernel_ver" 6.11; then
444		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
445			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-kernel_ethtool_ts_info.patch"
446		patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1  \
447			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-ptp.patch"
448	fi
449
450	(
451		cd "$GIT_REPOS/ice-$ICE_VERSION/src"
452		sudo make -j"$(nproc)" install
453	)
454}
455
456function install_libbpf() {
457	local libbpf_version=v1.4.5
458
459	rm -rf "$GIT_REPOS/libbpf"
460	git clone "$GIT_REPO_LIBBPF" --branch "$libbpf_version" "$GIT_REPOS/libbpf"
461
462	make -C "$GIT_REPOS/libbpf/src" -j install
463	# install target doesn't include the kernel header files
464	make -C "$GIT_REPOS/libbpf/src" install_uapi_headers
465}
466
467function install_bpftrace() {
468	local deps_fedora=() deps_ubuntu=() bcc_rev
469
470	deps_fedora+=(cereal-devel)
471	deps_fedora+=(clang-devel)
472	deps_fedora+=(dwarves)
473	deps_fedora+=(gmock-devel)
474	deps_fedora+=(gtest-devel)
475	deps_fedora+=(llvm-devel)
476	deps_fedora+=(bcc-devel)
477	deps_fedora+=(libbpf-devel)
478
479	deps_ubuntu+=(libcereal-dev)
480	deps_ubuntu+=(libclang-dev)
481	deps_ubuntu+=(llvm-dev)
482	# Under jammy (2204) the libbpf version is not compatible with the version of
483	# bpftrace that we are using. Instead, we are going to provide our own build
484	# of libbpf, including both up-to-date bpf.h and linux/bpf.h.
485	[[ $VERSION_CODENAME == jammy ]] || deps_ubuntu+=(libbpf-dev)
486	deps_ubuntu+=(libbpfcc-dev)
487	deps_ubuntu+=(libelf-dev)
488	deps_ubuntu+=(binutils-dev)
489
490	local -n deps="deps_$ID"
491
492	((${#deps[@]} > 0)) || return 1
493
494	deps+=(clang cmake)
495
496	install "${deps[@]}"
497
498	if [[ $VERSION_CODENAME == jammy ]]; then
499		install_libbpf
500	fi
501
502	rm -rf $GIT_REPOS/bpftrace
503
504	git clone "$GIT_REPO_BPFTRACE" "$GIT_REPOS/bpftrace"
505	git -C $GIT_REPOS/bpftrace checkout $BPFTRACE_VERSION
506
507	mkdir -p "$GIT_REPOS/bpftrace/build"
508	cmake \
509		-DCMAKE_BUILD_TYPE=Release \
510		-DBUILD_TESTING=OFF \
511		-B "$GIT_REPOS/bpftrace/build" \
512		-S "$GIT_REPOS/bpftrace"
513
514	make -C $GIT_REPOS/bpftrace/build -j$(nproc)
515	sudo make -C $GIT_REPOS/bpftrace/build install
516}
517
518function install_doxygen() {
519	# Stable, 1.10 commit that works for our docs
520	local release=78422d3905e57acebf0374feefafa6578dbe86aa
521
522	rm -rf "$GIT_REPOS/doxygen"
523
524	git clone "$GIT_REPO_DOXYGEN" "$GIT_REPOS/doxygen"
525	git -C "$GIT_REPOS/doxygen" checkout "$release"
526
527	mkdir -p "$GIT_REPOS/doxygen/build"
528
529	cmake -G "Unix Makefiles" \
530		-B "$GIT_REPOS/doxygen/build" \
531		-S "$GIT_REPOS/doxygen"
532
533	# This build is quite heavy, so let's not go crazy with -j here
534	make -C "$GIT_REPOS/doxygen/build" -j$(($(nproc) / 2))
535	make -C "$GIT_REPOS/doxygen/build" install
536}
537
538function install_sources() {
539	if [[ $ID == centos ]] && (( VERSION_ID == 7 )); then
540		# install proper version of the git first
541		install_git
542	fi
543
544	IFS="," read -ra conf_env <<< "$CONF"
545	for conf in "${conf_env[@]}"; do
546		export "INSTALL_${conf^^}=true"
547	done
548
549	if [[ $OSID == freebsd ]]; then
550		jobs=$(($(sysctl -n hw.ncpu) * 2))
551	else
552		jobs=$(($(nproc) * 2))
553		sources+=(
554			install_irdma
555			install_libiscsi
556			install_nvmecli
557			install_nvmecli_plugin
558			install_qat
559			install_rocksdb
560			install_qemu
561			install_igb_uio
562			install_ice
563			install_bpftrace
564			install_doxygen
565		)
566		install_extra_pkgs
567	fi
568	sources+=(install_fio)
569	sources+=(install_flamegraph)
570	sources+=(install_vagrant)
571	sources+=(install_ittapi)
572
573	sudo mkdir -p /usr/{,local}/src
574	sudo mkdir -p "$GIT_REPOS"
575
576	for source in "${sources[@]}"; do
577		source_conf=${source^^}
578		if [[ ${!source_conf} == true ]]; then
579			"$source"
580		fi
581	done
582}
583
584GIT_VERSION=2.25.1
585IRDMA_VERSION=1.14.31
586ICE_VERSION=1.14.9
587
588BPFTRACE_VERSION=${BPFTRACE_VERSION:-f7bdfb44}
589VFIO_QEMU_BRANCH=${VFIO_QEMU_BRANCH:-vfio-user-p3.0}
590VANILLA_QEMU_BRANCH=${VANILLA_QEMU_BRANCH:-v8.0.0}
591
592: ${GIT_REPO_ROCKSDB=https://review.spdk.io/spdk/rocksdb}
593export GIT_REPO_ROCKSDB
594: ${GIT_REPO_FIO=https://github.com/axboe/fio.git}
595export GIT_REPO_FIO
596: ${GIT_REPO_FLAMEGRAPH=https://github.com/brendangregg/FlameGraph.git}
597export GIT_REPO_FLAMEGRAPH
598: ${GIT_REPO_QEMU=https://github.com/qemu/qemu}
599export GIT_REPO_QEMU
600: ${GIT_REPO_QEMU_VFIO=https://github.com/oracle/qemu}
601export GIT_REPO_QEMU_VFIO
602: ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi}
603export GIT_REPO_LIBISCSI
604: ${DRIVER_LOCATION_QAT=https://downloadmirror.intel.com/828487/QAT.L.4.26.0-00008.tar.gz}
605export DRIVER_LOCATION_QAT
606: ${GIT_REPO_GIT=https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz}
607export GIT_REPO_GIT
608: ${GIT_REPO_DPDK_KMODS=http://dpdk.org/git/dpdk-kmods}
609export GIT_REPO_DPDK_KMODS
610: ${IRDMA_DRIVER=https://downloadmirror.intel.com/823677/irdma-$IRDMA_VERSION.tgz}
611export IRDMA_DRIVER
612: ${ICE_DRIVER="https://sourceforge.net/projects/e1000/files/ice%20stable/$ICE_VERSION/ice-$ICE_VERSION.tar.gz"}
613export ICE_DRIVER
614: ${GIT_REPO_BCC=https://github.com/iovisor/bcc.git}
615export GIT_REPO_BCC
616: ${GIT_REPO_BPFTRACE=https://github.com/iovisor/bpftrace.git}
617export GIT_REPO_BPFTRACE
618: ${GIT_REPO_NVME_CLI=https://review.spdk.io/gerrit/spdk/nvme-cli}
619export GIT_REPO_NVME_CLI
620: ${GIT_REPO_ITTAPI=https://github.com/intel/ittapi.git}
621export GIT_REPO_ITTAPI
622: ${GIT_REPO_DOXYGEN="https://github.com/doxygen/doxygen"}
623export GIT_REPO_DOXYGEN
624: ${GIT_REPO_LIBBPF="https://github.com/libbpf/libbpf"}
625export GIT_REPO_LIBBPF
626
627GIT_REPOS=${GIT_REPOS:-$HOME}
628
629gcc_version=$(gcc -dumpversion) gcc_version=${gcc_version%%.*}
630if [[ -e /proc/sys/kernel/osrelease ]]; then
631	kernel_ver=$(< /proc/sys/kernel/osrelease)
632fi
633