Commit 82c64b67 authored by Kanika Nema's avatar Kanika Nema Committed by Tomasz Zawadzki
Browse files

scripts/pkgdep: Add support for Mariner (Az Linux) distro

CBL-Mariner a.k.a. Azure Linux is an open-source Linux distribution
developed by Microsoft (https://github.com/microsoft/CBL-Mariner

).
This update introduces a new script for installing the necessary
package dependencies to compile SPDK on the Mariner distribution.
Release 2.0 has the ID set to 'mariner', starting with v3.0 release,
the ID will be set to 'azurelinux'.

Change-Id: I027dc3f944f4e87aaf50d57f29b85a8eba45eab2
Signed-off-by: default avatarKanika Nema <kanika.nema@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20742


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 7d30d705
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
mariner.sh
 No newline at end of file
+102 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

#  SPDX-License-Identifier: BSD-3-Clause
#  All rights reserved.

additional_dependencies() {
	# Additional dependencies for SPDK CLI
	tdnf install -y python3-pexpect
	# Additional dependencies for ISA-L used in compression
	tdnf install -y help2man
	# Additional dependencies for DPDK
	if [[ "$(uname -m)" != "aarch64" ]]; then
		tdnf install -y nasm
	fi
	tdnf install -y libnuma-devel
	# Additional dependencies for USDT
	tdnf install -y systemtap-sdt-devel
	if [[ $INSTALL_DEV_TOOLS == "true" ]]; then
		# Tools for developers
		devtool_pkgs=(git sg3_utils pciutils bash-completion ruby-devel)
		devtool_pkgs+=(gcovr python3-pycodestyle)
		tdnf install -y "${devtool_pkgs[@]}"
	fi
	if [[ $INSTALL_PMEM == "true" ]]; then
		# Additional dependencies for building pmem based backends
		tdnf install -y libpmemobj-devel || true
	fi
	if [[ $INSTALL_FUSE == "true" ]]; then
		# Additional dependencies for FUSE and NVMe-CUSE
		tdnf install -y fuse3-devel
	fi
	if [[ $INSTALL_RBD == "true" ]]; then
		# Additional dependencies for RBD bdev in NVMe over Fabrics
		tdnf install -y librados-devel librbd-devel
	fi
	if [[ $INSTALL_RDMA == "true" ]]; then
		# Additional dependencies for RDMA transport in NVMe over Fabrics
		tdnf install -y libibverbs librdmacm
	fi
	if [[ $INSTALL_DOCS == "true" ]]; then
		# Additional dependencies for building docs
		tdnf install -y mscgen || echo "Warning: couldn't install mscgen via tdnf. Please install mscgen manually."
		tdnf install -y doxygen graphviz
	fi
	if [[ $INSTALL_DAOS == "true" ]]; then
		echo "Unsupported. Skipping installation of DAOS bdev dependencies."
	fi
	# Additional dependencies for Avahi
	if [[ $INSTALL_AVAHI == "true" ]]; then
		# Additional dependencies for Avahi
		tdnf install -y avahi-devel
	fi
}

tdnf install -y ca-certificates build-essential
tdnf install -y CUnit-devel \
	clang \
	clang-devel \
	cmake \
	json-c-devel \
	libaio-devel \
	libcmocka-devel \
	libiscsi-devel \
	libuuid-devel \
	ncurses-devel \
	openssl-devel \
	procps-ng \
	python \
	python3-devel \
	python3-pip \
	tar \
	unzip

if [[ ! -e /usr/bin/python ]]; then
	ln -s /usr/bin/python3 /usr/bin/python
fi

pips=(
	meson
	ninja
	pyelftools
	ijson
	python-magic
	pyyaml
	grpcio
	grpcio-tools
)

if ((EUID == 0)); then
	cat <<- WARNING
		Warning: Running as root. You may want to install the pip packages
		as a non-root user if you wish to build SPDK as a non-root user.

		Required packages:
		$(printf '  %s\n' "${pips[@]}")

	WARNING
fi

pip3 install "${pips[@]}"

additional_dependencies
+7 −0
Original line number Diff line number Diff line
pre_install() {
	if [[ $INSTALL_TSOCKS == true ]]; then
		# tsocks package is not available in latest releases, so don't exit in case
		# installation failed.
		install tsocks || echo "Installation of the tsocks package failed, proxy may not be available"
	fi
}
+71 −0
Original line number Diff line number Diff line
package_manager=tdnf

upgrade() {
	sudo "$package_manager" upgrade -y
}

install() {
	(($#)) || return 0

	sudo "$package_manager" install -y "$@"
}

packages=(
	autoconf
	automake
	avahi
	avahi-tools
	alsa-lib-devel
	bc
	bison
	btrfs-progs
	bpftrace
	cairo
	cairo-devel
	ceph
	clang-analyzer
	elfutils
	elfutils-libelf-devel
	fio
	flex
	gdb
	gdisk
	gflags-devel
	iptables
	iscsi-initiator-utils
	isns-utils-devel
	iproute
	jq
	kernel-devel
	libaio-devel
	libgcrypt-devel
	librdmacm-utils
	libtool
	llvm
	nbd
	nvme-cli
	openssl
	pango
	pango-devel
	pciutils
	perl-open
	perl-Switch
	pixman-devel
	pmempool
	python3
	rpm-build
	rpmdevtools
	ruby-devel
	smartmontools
	socat
	sshfs
	sshpass
	systemd-devel
	tar
	targetcli
	valgrind
	wget
	xfsprogs
)

pre_install() { :; }