buildroot: mount /sys as read-only

This will prevent any modification of anything in `/sys`. It will
also prevent `udevadm tigger` to run, which needs /sys writeable.
This is a desired effect, since uevents are not delivered to the
contained environment, so `udevadm trigger` might hang.
This commit is contained in:
Christian Kellner 2021-06-24 16:01:18 +00:00 committed by Tom Gundersen
parent 5dc72038ef
commit 704d5d305a

View file

@ -177,7 +177,7 @@ class BuildRoot(contextlib.AbstractContextManager):
# Setup API file-systems.
mounts += ["--proc", "/proc"]
mounts += ["--bind", "/sys", "/sys"]
mounts += ["--ro-bind", "/sys", "/sys"]
mounts += ["--ro-bind-try", "/sys/fs/selinux", "/sys/fs/selinux"]
# There was a bug in mke2fs (fixed in versionv 1.45.7) where mkfs.ext4