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