diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-11-11 15:15:22 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-11-11 15:15:22 +0000 |
commit | 054375f31bdb183fc7a7100c0e90a8b48348c260 (patch) | |
tree | abbb4963b46bdd6c946125bcc54d5e51750470c7 /src/buildstream/sandbox/_sandboxbwrap.py | |
parent | b3270030b5a9e520fd6a2d9f7acd923e27e10139 (diff) | |
parent | 068a51b073a48d2b4d0e3dd0a00add77509207e1 (diff) | |
download | buildstream-054375f31bdb183fc7a7100c0e90a8b48348c260.tar.gz |
Merge branch 'coldtom/allow-dev-shm' into 'master'
_sandboxbwrap.py: Create /dev/shm in the sandbox
Closes #1197
See merge request BuildStream/buildstream!1694
Diffstat (limited to 'src/buildstream/sandbox/_sandboxbwrap.py')
-rw-r--r-- | src/buildstream/sandbox/_sandboxbwrap.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/buildstream/sandbox/_sandboxbwrap.py b/src/buildstream/sandbox/_sandboxbwrap.py index bd60eafc1..5c4b9a295 100644 --- a/src/buildstream/sandbox/_sandboxbwrap.py +++ b/src/buildstream/sandbox/_sandboxbwrap.py @@ -207,6 +207,11 @@ class SandboxBwrap(Sandbox): for device in self.DEVICES: bwrap_command += ['--dev-bind', device, device] + # Create a tmpfs for /dev/shm, if we're in interactive this + # is handled by `--dev /dev` + # + bwrap_command += ['--tmpfs', '/dev/shm'] + # Add bind mounts to any marked directories marked_directories = self._get_marked_directories() mount_source_overrides = self._get_mount_sources() @@ -260,7 +265,7 @@ class SandboxBwrap(Sandbox): # existing_basedirs = { directory: os.path.exists(os.path.join(root_directory, directory)) - for directory in ['tmp', 'dev', 'proc'] + for directory in ['dev/shm', 'tmp', 'dev', 'proc'] } # Use the MountMap context manager to ensure that any redirected @@ -294,7 +299,7 @@ class SandboxBwrap(Sandbox): # Remove /tmp, this is a bwrap owned thing we want to be sure # never ends up in an artifact - for basedir in ['tmp', 'dev', 'proc']: + for basedir in ['dev/shm', 'tmp', 'dev', 'proc']: # Skip removal of directories which already existed before # launching bwrap |