From 7f8ca9bb3166b74b838e1c70f27535a0b4dc7f4f Mon Sep 17 00:00:00 2001 From: illuminatus Date: Fri, 17 Nov 2023 17:04:20 -0800 Subject: [PATCH] CRB repo installation for RHEL 9 (#1703) ## Description Changes the Line 219 and 221 tests from `||` to `&&`, making the test for rhel 9 reachable. ## Where should the reviewer start? Line 219 & 221 changed. Full review requires a Red Hat subscription (developer subscriptions are fine too) and registering the system via `subscription-manager` before running `guild-deploy.sh`. ## Motivation and context Fixing the codeready builder repository for RHEL 9. ## Which issue it fixes? Closes #1701 ## How has this been tested? Fresh RHEL 9 VM created, registered w/ developer subscription enabling only the initial **rhel-9-for-x86_64-baseos-rpms** and **rhel-9-for-x86_64-appstream-rpms** default repositories. Then `./guild-deploy.sh -b rhel-9-crb-repo -s pld` used to test the branch. ``` [guild@rhel92 tmp]$ ./guild-deploy.sh -b rhel-9-crb-repo -s pld Preparing OS dependency packages for "Red Hat Enterprise Linux" system Updating system packages... Enabling epel repository... Symlink updates not required for ncurse libs, skipping.. Installing missing prerequisite packages, if any.. Importing GPG key 0x3228467C: Userid : "Fedora (epel9) " Fingerprint: FF8A D134 4597 106E CE81 3B91 8A38 72BF 3228 467C From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 Installing Haskell build/compiler dependencies (if missing)... Installing ghcup (The Haskell Toolchain installer) .. [Re]-Install libsecp256k1 ... libsecp256k1 installed to /usr/local/lib/ Building libsodium ... IOG fork of libsodium installed to /usr/local/lib/ Creating Folder Structure .. Setting up Environment Variable Downloading files... Downloading binaries.. Downloading Cardano Node archive created from IO CI builds.. Downloading Github release package for Cardano Wallet Downloading Cardano DB Sync archive created from IO CI Builds.. ``` --------- Co-authored-by: RdLrT <3169068+rdlrt@users.noreply.github.com> --- scripts/cnode-helper-scripts/guild-deploy.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 8ef4c9aa0..63f770109 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -216,10 +216,8 @@ os_dependencies() { if [[ "${DISTRO}" =~ Rocky ]]; then #RockyLinux 8/9 pkg_list="${pkg_list} --enablerepo=devel,crb libusbx ncurses-compat-libs pkgconf-pkg-config" - elif [[ "${DISTRO}" =~ "Red Hat" ]] || [[ "${VERSION_ID}" =~ "8" ]]; then - pkg_list="${pkg_list} --enablerepo=codeready-builder-for-rhel-8-x86_64-rpms libusbx ncurses-compat-libs pkgconf-pkg-config" - elif [[ "${DISTRO}" =~ "Red Hat" ]] || [[ "${VERSION_ID}" =~ "9" ]]; then - pkg_list="${pkg_list} --enablerepo=codeready-builder-for-rhel-9-x86_64-rpms libusbx ncurses-compat-libs pkgconf-pkg-config" + elif [[ "${DISTRO}" =~ "Red Hat" ]]; then + pkg_list="${pkg_list} --enablerepo=codeready-builder-for-rhel-${VERSION_ID/.*/}-x86_64-rpms libusbx ncurses-compat-libs pkgconf-pkg-config" fi elif [[ "${DISTRO}" =~ Fedora ]]; then #Fedora @@ -431,7 +429,7 @@ download_ogmios() { if command -v ogmios >/dev/null; then ogmios_version="$(ogmios --version)"; else ogmios_version="v0.0.0"; fi rm -rf /tmp/ogmios && mkdir /tmp/ogmios pushd /tmp/ogmios >/dev/null || err_exit - ogmios_asset_url="$(curl -s https://api.github.com/repos/CardanoSolutions/ogmios/releases | jq -r '.[0].assets[].browser_download_url')" + ogmios_asset_url="$(curl -s https://api.github.com/repos/CardanoSolutions/ogmios/releases | jq -r '.[].assets[].browser_download_url' | grep linux.zip | head -1)" if curl -sL -f -m ${CURL_TIMEOUT} -o ogmios.zip ${ogmios_asset_url}; then unzip ogmios.zip &>/dev/null rm -f ogmios.zip