From 03c3fd763e301077ecfa0a2d3428a091bedd691d Mon Sep 17 00:00:00 2001 From: Yamato Tanaka Date: Fri, 10 Feb 2023 19:44:20 +0900 Subject: [PATCH] Support RHEL 9 This patch includes changes required to run devstack on RHEL 9. - en_US.utf8 is provided by glibc-langpack-en - iptables command is provided by iptables-nft - Use /etc/os-release to identify the distro in RHEL 9 as it doesn't provide lsb_release command. - CRB repository name is different from CentOS 9 Change-Id: I8f6d9263b24f9c2cf82e09258e2d14d7766ad337 --- files/rpms/general | 2 ++ functions-common | 5 +++-- stack.sh | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/files/rpms/general b/files/rpms/general index b6866de62d..8a5755cc37 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -6,9 +6,11 @@ gcc gcc-c++ gettext # used for compiling message catalogs git-core +glibc-langpack-en # dist:rhel9 graphviz # needed only for docs httpd httpd-devel +iptables-nft # dist:rhel9 iptables-services java-1.8.0-openjdk-headless libffi-devel diff --git a/functions-common b/functions-common index 4eed5d8407..3e07a49e22 100644 --- a/functions-common +++ b/functions-common @@ -412,9 +412,9 @@ function _ensure_lsb_release { # - os_VENDOR # - os_PACKAGE function GetOSVersion { - # CentOS Stream 9 does not provide lsb_release + # CentOS Stream 9 and RHEL 9 do not provide lsb_release source /etc/os-release - if [[ "${ID}${VERSION}" == "centos9" ]]; then + if [[ "${ID}${VERSION}" == "centos9" ]] || [[ "${ID}${VERSION}" =~ "rhel9" ]]; then os_RELEASE=${VERSION_ID} os_CODENAME="n/a" os_VENDOR=$(echo $NAME | tr -d '[:space:]') @@ -530,6 +530,7 @@ function is_fedora { [ "$os_VENDOR" = "openEuler" ] || \ [ "$os_VENDOR" = "RedHatEnterpriseServer" ] || \ [ "$os_VENDOR" = "RedHatEnterprise" ] || \ + [ "$os_VENDOR" = "RedHatEnterpriseLinux" ] || \ [ "$os_VENDOR" = "Rocky" ] || \ [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "CentOSStream" ] || \ [ "$os_VENDOR" = "AlmaLinux" ] || \ diff --git a/stack.sh b/stack.sh index ccd2d16baa..6e7b11a0bc 100755 --- a/stack.sh +++ b/stack.sh @@ -391,7 +391,10 @@ if [[ $DISTRO == "rhel8" ]]; then # Patch: https://github.com/rpm-software-management/dnf/pull/1448 echo "[]" | sudo tee /var/cache/dnf/expired_repos.json elif [[ $DISTRO == "rhel9" ]]; then + # for CentOS Stream 9 repository sudo dnf config-manager --set-enabled crb + # for RHEL 9 repository + sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-x86_64-rpms # rabbitmq and other packages are provided by RDO repositories. _install_rdo