osbulid.py/nspawn: bindmount /dev rather than use a synthetic one

We need dynamic device node creation when we create loop devices
and their partitions. It would be possible to mknod them, but
just using the host /dev seems more straight-forward. Access to
the various nodes still needs to be granted explictly as we are
in the devices CGroup.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-06-16 23:14:17 +02:00
parent 566911cc27
commit 0646b48bb3

View file

@ -115,7 +115,8 @@ class BuildRoot:
robinds = [f"{libdir}/stages/{name}:/run/osbuild/{name}"]
robinds.extend(self._get_system_resources_from_etc(stage))
binds = [f"{tree}:/run/osbuild/tree"]
binds = [f"{tree}:/run/osbuild/tree", "/dev:/dev"]
if input_dir:
robinds.append(f"{input_dir}:/run/osbuild/input")
args["input_dir"] = "/run/osbuild/input"