config/pkgdep: Allow for sourcing OS-based routines

vm_setup.sh currently depends on package managers to determine which
SPDK dependencies must be installed, however, this may cause issues on
systems which provide more than one package manager, e.g., dnf and
yum. Due to that fact, some packages were missing since they were
bound to a specific package manager instead of the distribution, case
and point, nbd. Also, some OS-dependent steps had to be duplicated,
like repo refresh on Centos8, since either of the managers could be
in use.

To address the above, allow for souring of OS-based routines to
overwrite defaults set based on given package manager.

Change-Id: I0d8d88dea4521e9c76b187c69743e4e09aa724e6
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4017
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
Michal Berger 2020-09-01 14:41:45 +02:00 committed by Tomasz Zawadzki
parent f2d958973a
commit 3fdfea7bac
6 changed files with 25 additions and 22 deletions

View File

@ -60,17 +60,7 @@ packages=(
xfsprogs
)
pre_install() {
if [[ $INTSALL_TSOCKS == true ]]; then
# currently, tsocks package is retired in fedora 31, so don't exit in case
# installation failed
# FIXME: Review when fedora starts to successfully build this package again.
install tsocks || echo "Installation of the tsocks package failed, proxy may not be available"
fi
if [[ $ID == centos ]] && (( VERSION_ID == 8 )); then
sudo "$package_manager" update -y --refresh
fi
}
pre_install() { :; }
if [[ $OSID != fedora ]]; then
echo "Located dnf package manager, but it was tested for Fedora only"

View File

@ -0,0 +1 @@
rhel

View File

@ -0,0 +1 @@
rhel

View File

@ -0,0 +1,17 @@
pre_install() {
if [[ $INTSALL_TSOCKS == true ]]; then
# currently, tsocks package is retired in fedora 31, so don't exit in case
# installation failed
# FIXME: Review when fedora starts to successfully build this package again.
install tsocks || echo "Installation of the tsocks package failed, proxy may not be available"
fi
if [[ $ID == centos ]] && (( VERSION_ID == 8 )); then
sudo "$package_manager" update -y --refresh
fi
install nbd || {
install wget
wget -O nbd.rpm https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/n/nbd-3.14-2.el7.x86_64.rpm
install nbd.rpm
}
}

View File

@ -58,14 +58,4 @@ packages=(
xfsprogs
)
pre_install() {
if [[ $ID == centos ]] && (( VERSION_ID == 8 )); then
sudo "$package_manager" update -y --refresh
fi
install nbd || {
install wget
wget -O nbd.rpm https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/n/nbd-3.14-2.el7.x86_64.rpm
install nbd.rpm
}
}
pre_install() { :; }

View File

@ -78,6 +78,10 @@ else
package_manager="undefined"
fi
if [[ -e $vmsetupdir/pkgdep/os/$OSID ]]; then
source "$vmsetupdir/pkgdep/os/$OSID"
fi
# Parse input arguments #
while getopts 'd:siuht:c:-:' optchar; do
case "$optchar" in