buildroot: allow creating device nodes on s390x

The z Initial Program Loader (zipl) when creating the bootmap in
bootmap_creat (src/zipl/bootmap.c) wants to create a device node
via misc_temp_dev (bootmap_create:1141) for the device that it
is installing the bootloader to[1]. Currently access to loopback
devices is allowed from within the container (it is used to mount
the image), but only read/write access. On s390x also allow the
creation of device nodes, so zipl can do its work and install
the bootloader stages on the "disk".

[1] zipl source at commit dcce14923c3e9615df53773d1d8a3a22cbb23b96
This commit is contained in:
Christian Kellner 2019-12-13 22:28:48 +01:00 committed by Tom Gundersen
parent bf41326ac6
commit 64addbe2d2

View file

@ -79,13 +79,20 @@ class BuildRoot:
# pylint suggests to epxlicitly pass `check` to subprocess.run()
check = kwargs.pop("check", False)
# we need read-write access to loopback devices
loopback_allow = "rw"
if platform.machine() == "s390x":
# on s390x, the bootloader installation program (zipl)
# wants to be able create devices nodes, so allow that
loopback_allow += "m"
return subprocess.run([
"systemd-nspawn",
"--quiet",
"--register=no",
"--as-pid2",
"--link-journal=no",
"--property=DeviceAllow=block-loop rw",
f"--property=DeviceAllow=block-loop {loopback_allow}",
f"--directory={self.root}",
f"--bind-ro={self.libdir}:/run/osbuild/lib",
*[f"--bind={b}" for b in (binds or [])],