Mockbuild: workaround a SELinux policy issue on c10s.

SELinux policy forbids systemd-machined from creating a varlink socket,
which it does since v256. This makes it fail to start. Subsequently,
mock fails to build the RPM, because it uses systemd-nspawn as an
isolation and it fails to register the machine with systemd-machined.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-07-18 21:35:31 +02:00 committed by Tomáš Hozza
parent dcc08d8bd4
commit df83c62920

View file

@ -135,6 +135,14 @@ 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"
dnf_install_with_retry createrepo_c make mock python3-pip rpm-build s3cmd