From 64addbe2d2646b70b9fcbd067979934ec984f698 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 13 Dec 2019 22:28:48 +0100 Subject: [PATCH] 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 --- osbuild/buildroot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osbuild/buildroot.py b/osbuild/buildroot.py index d3f0679d..2acb33e6 100644 --- a/osbuild/buildroot.py +++ b/osbuild/buildroot.py @@ -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 [])],