From 3f593969ed461060a826779045e5f1a22718a1cb Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 20 Apr 2023 12:02:30 +0200 Subject: [PATCH] scripts/pkgdep: Add support for rocky|centos 9 Also, shuffle DAOS pieces a bit to keep repo handling in one place. Also, also switch ceph repo to an actively supported release, common and available for both centos|rocky 8|9 (i.e. pacific). Change-Id: Idb19e4a5ff80770c7d6f9e6db85f983e163958e6 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17661 Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- scripts/pkgdep/rhel.sh | 48 +++++++++++++++++++++++------------ test/common/config/pkgdep/yum | 14 +++++++++- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/scripts/pkgdep/rhel.sh b/scripts/pkgdep/rhel.sh index 868821456..a703aa45f 100755 --- a/scripts/pkgdep/rhel.sh +++ b/scripts/pkgdep/rhel.sh @@ -37,7 +37,7 @@ disclaimer # First, add extra EPEL, ELRepo, Ceph repos to have a chance of covering most of the packages # on the enterprise systems, like RHEL. if [[ $ID == centos || $ID == rhel || $ID == rocky ]]; then - repos=() enable=("epel" "elrepo" "elrepo-testing") + repos=() enable=("epel" "elrepo" "elrepo-testing") add=() [[ $ID == centos || $ID == rocky ]] && enable+=("extras") if [[ $VERSION_ID == 7* ]]; then repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm") @@ -49,18 +49,40 @@ if [[ $ID == centos || $ID == rhel || $ID == rocky ]]; then echo "Liburing not supported on ${ID}$VERSION_ID, disabling" INSTALL_LIBURING=false fi + add+=("https://packages.daos.io/v2.0/CentOS7/packages/x86_64/daos_packages.repo") + enable+=("daos-packages") fi if [[ $VERSION_ID == 8* ]]; then repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm") repos+=("https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm") - [[ $ID == centos || $ID == rocky ]] \ - && repos+=("https://download.ceph.com/rpm-nautilus/el8/noarch/ceph-release-1-1.el8.noarch.rpm") - # Add PowerTools needed for install CUnit-devel in Centos8 - if [[ $ID == centos || $ID == rocky ]]; then - is_repo "PowerTools" && enable+=("PowerTools") - is_repo "powertools" && enable+=("powertools") - fi + add+=("https://packages.daos.io/v2.0/EL8/packages/x86_64/daos_packages.repo") + enable+=("daos-packages") fi + + if [[ $VERSION_ID == 9* ]]; then + repos+=("https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm") + repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm") + enable+=("crb") + fi + + # Add PowerTools needed for install CUnit-devel + if [[ ($ID == centos || $ID == rocky) && $VERSION_ID =~ ^[89].* ]]; then + is_repo "PowerTools" && enable+=("PowerTools") + is_repo "powertools" && enable+=("powertools") + repos+=("centos-release-ceph-pacific.noarch") + enable+=("centos-ceph-pacific") + fi + + if [[ $ID == rocky ]]; then + enable+=("devel") + fi + + if ((${#add[@]} > 0)); then + for _repo in "${add[@]}"; do + yum-config-manager --add-repo "$_repo" + done + fi + if ((${#repos[@]} > 0)); then yum install -y "${repos[@]}" yum-utils yum-config-manager --enable "${enable[@]}" @@ -170,16 +192,10 @@ if [[ $INSTALL_DOCS == "true" ]]; then yum install -y doxygen graphviz fi if [[ $INSTALL_DAOS == "true" ]]; then - if [[ $ID == centos || $ID == rocky ]]; then - if ! hash yum-config-manager &> /dev/null; then - yum install -y yum-utils - fi - [[ $VERSION_ID == 7* ]] && yum-config-manager --add-repo "https://packages.daos.io/v2.0/CentOS7/packages/x86_64/daos_packages.repo" - [[ $VERSION_ID == 8* ]] && yum-config-manager --add-repo "https://packages.daos.io/v2.0/EL8/packages/x86_64/daos_packages.repo" - yum-config-manager --enable "daos-packages" + if [[ ($ID == centos || $ID == rocky) && $VERSION_ID =~ ^[78].* ]]; then yum install -y daos-devel else - echo "Skipping installation of DAOS bdev dependencies. It is supported only for CentOS 7, CentOS 8 and Rocky 8" + echo "Skipping installation of DAOS bdev dependencies. Supported only under centos, rocky (variants 7-8)." fi fi # Additional dependencies for Avahi diff --git a/test/common/config/pkgdep/yum b/test/common/config/pkgdep/yum index c8f72157a..c93eda0e7 100644 --- a/test/common/config/pkgdep/yum +++ b/test/common/config/pkgdep/yum @@ -63,10 +63,22 @@ packages=( xfsprogs ) -if [[ $OSID != centos && $OSID != rocky ]] || [[ $OSVERSION != 8* ]]; then +if [[ $OSID != centos && $OSID != rocky ]]; then packages+=(btrfs-progs) packages+=(avahi) packages+=(avahi-tools) +elif [[ $OSID == rocky ]]; then + # 8 and 9 comes with a kernel which does not support btrfs + packages+=(avahi) + packages+=(avahi-tools) # from the devel repo +elif [[ $OSID == centos ]]; then + packages+=(avahi) + # 8 comes with a kernel which does not support btrfs. + # 8 does not come with any common repos that include avahi-tools. + if [[ $OSVERSION == 7* ]]; then + packages+=(avahi-tools) + packages+=(btrfs-progs) + fi fi if [[ $OSID == centos && $OSVERSION == 8* ]]; then