summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/_sandboxbwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/sandbox/_sandboxbwrap.py')
-rw-r--r--buildstream/sandbox/_sandboxbwrap.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py
index 450f1913f..548d27228 100644
--- a/buildstream/sandbox/_sandboxbwrap.py
+++ b/buildstream/sandbox/_sandboxbwrap.py
@@ -132,6 +132,12 @@ 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`
+ #
+ if flags & SandboxFlags.CREATE_DEV_SHM:
+ 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()
@@ -173,7 +179,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
@@ -213,7 +219,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