diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-01 21:52:43 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-02 20:43:10 +0900 |
commit | 859125628d6976ae70afed82323f2600a8b6572a (patch) | |
tree | 6ab222a02227a8667d6e9b358bdeed54ed3d9691 /buildstream | |
parent | 5993c16cf2ec9f491438131c5d7a674d5e6213e3 (diff) | |
download | buildstream-859125628d6976ae70afed82323f2600a8b6572a.tar.gz |
_sandboxbwrap.py: Allow device nodes to be bind mounted
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/sandbox/_sandboxbwrap.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py index bb5bd1f6e..c40565814 100644 --- a/buildstream/sandbox/_sandboxbwrap.py +++ b/buildstream/sandbox/_sandboxbwrap.py @@ -130,7 +130,16 @@ class SandboxBwrap(Sandbox): mount_source = mount_source_overrides[mount_point] else: mount_source = mount_map.get_mount_source(mount_point) - bwrap_command += ['--bind', mount_source, mount_point] + + # Use --dev-bind for all mounts, this is simply a bind mount which does + # not restrictive about devices. + # + # While it's important for users to be able to mount devices + # into the sandbox for `bst shell` testing purposes, it is + # harmless to do in a build environment where the directories + # we mount just never contain device files. + # + bwrap_command += ['--dev-bind', mount_source, mount_point] if flags & SandboxFlags.ROOT_READ_ONLY: bwrap_command += ["--remount-ro", "/"] |