From 9c9a3b7937a20041d905e0f73dbdd889ef6f9e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Thu, 18 Jul 2024 22:26:50 +0200 Subject: [PATCH] mockbuild.sh: add workarounds for c10s and el10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add workarounds needed for mockbuild.sh to work on c10s / el10, due to non-existent EPEL-10 and issues on c10s. Signed-off-by: Tomáš Hozza --- schutzbot/mockbuild.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index def7e5e43..d0f638f8c 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -100,13 +100,27 @@ if curl --silent --fail --head --output /dev/null "${REPO_URL}/repodata/repomd.x fi # Mock and s3cmd is only available in EPEL for RHEL. -if [[ $ID == rhel || $ID == centos ]] && ! rpm -q epel-release; then +# TODO: Adjust this condition, once EPEL-10 is enabled +if [[ ($ID == rhel || $ID == centos) && ${VERSION_ID%.*} -lt 10 ]] && ! rpm -q epel-release; then greenprint "📦 Setting up EPEL repository" curl -Ls --retry 5 --output /tmp/epel.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-"${VERSION_ID%.*}".noarch.rpm sudo dnf install -y /tmp/epel.rpm fi +# TODO: Remove this workaround, once EPEL-10 is enabled +if [[ ($ID == rhel || $ID == centos) && ${VERSION_ID%.*} == 10 ]]; then + sudo dnf copr enable -y @osbuild/centpkg "centos-stream-10-$(uname -m)" +fi + +# TODO: Remove this workaround, once https://issues.redhat.com/browse/RHEL-49567 is fixed +# We can't workaround this in mock config due to https://github.com/rpm-software-management/mock/pull/1410 +if [[ $ID == centos && ${VERSION_ID%.*} == 10 ]]; then + sudo setenforce 0 + sudo systemctl restart systemd-machined.service + sudo setenforce 1 +fi + # Install requirements for building RPMs in mock. greenprint "📦 Installing mock requirements" sudo dnf -y install createrepo_c mock s3cmd podman