runners: add new centos9 runner

Actually, rename the rhel90 runner to the centos9 runner, and
make the former a link to the latter, since in RHEL 9, CentOS
is the upstream and RHEL the downstream.
This commit is contained in:
Christian Kellner 2021-10-27 17:04:00 +02:00 committed by Tom Gundersen
parent a39d5af339
commit de7fd7b402
2 changed files with 49 additions and 48 deletions

48
runners/org.osbuild.centos9 Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/python3
import os
import subprocess
import sys
import osbuild.api
def ldconfig():
# ld.so.conf must exist, or `ldconfig` throws a warning
subprocess.run(["touch", "/etc/ld.so.conf"], check=True)
subprocess.run(["ldconfig"], check=True)
def sysusers():
try:
subprocess.run(["systemd-sysusers"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True)
except subprocess.CalledProcessError as error:
sys.stderr.write(error.stdout)
sys.exit(1)
def tmpfiles():
# Allow systemd-tmpfiles to return non-0. Some packages want to create
# directories owned by users that are not set up with systemd-sysusers.
subprocess.run(["systemd-tmpfiles", "--create"], check=False)
def nsswitch():
# the default behavior is fine, but using nss-resolve does not
# necessarily work in a non-booted container, so make sure that
# is not configured.
try:
os.remove("/etc/nsswitch.conf")
except FileNotFoundError:
pass
if __name__ == "__main__":
with osbuild.api.exception_handler():
ldconfig()
sysusers()
tmpfiles()
nsswitch()
r = subprocess.run(sys.argv[1:], check=False)
sys.exit(r.returncode)

View file

@ -1,48 +0,0 @@
#!/usr/bin/python3
import os
import subprocess
import sys
import osbuild.api
def ldconfig():
# ld.so.conf must exist, or `ldconfig` throws a warning
subprocess.run(["touch", "/etc/ld.so.conf"], check=True)
subprocess.run(["ldconfig"], check=True)
def sysusers():
try:
subprocess.run(["systemd-sysusers"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True)
except subprocess.CalledProcessError as error:
sys.stderr.write(error.stdout)
sys.exit(1)
def tmpfiles():
# Allow systemd-tmpfiles to return non-0. Some packages want to create
# directories owned by users that are not set up with systemd-sysusers.
subprocess.run(["systemd-tmpfiles", "--create"], check=False)
def nsswitch():
# the default behavior is fine, but using nss-resolve does not
# necessarily work in a non-booted container, so make sure that
# is not configured.
try:
os.remove("/etc/nsswitch.conf")
except FileNotFoundError:
pass
if __name__ == "__main__":
with osbuild.api.exception_handler():
ldconfig()
sysusers()
tmpfiles()
nsswitch()
r = subprocess.run(sys.argv[1:], check=False)
sys.exit(r.returncode)

1
runners/org.osbuild.rhel90 Symbolic link
View file

@ -0,0 +1 @@
org.osbuild.centos9