From 11555718e14ab147bd5da8b093d49279ad9d3ee8 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 12 Dec 2014 11:05:31 +0000 Subject: stagingarea: Mount things inside dirname --- morphlib/stagingarea.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py index b676d4db..5810bf3c 100644 --- a/morphlib/stagingarea.py +++ b/morphlib/stagingarea.py @@ -274,9 +274,14 @@ class StagingArea(object): else: binds = () + if self.use_chroot: + mounts = self.to_mount + else: + mounts = [(os.path.join(self.dirname, target), type, source) + for target, type, source in self.to_mount] cmdline = morphlib.util.containerised_cmdline( argv, cwd=kwargs.pop('cwd', '/'), - root=chroot_dir, mounts=self.to_mount, + root=chroot_dir, mounts=mounts, binds=binds, mount_proc=mount_proc, writable_paths=do_not_mount_dirs) try: -- cgit v1.2.1 From d5c95a623884b7a837d99911cf1967675ae5dee6 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 19 Dec 2014 12:04:30 +0000 Subject: Don't mount /dev/shm in bootstrap mode. There's no chroot used in bootstrap mode, so the host's /dev/shm can be used, and nothing in the world will be looking to /src/tmp/staging/tmpXXX/dev/shm for anything. --- morphlib/stagingarea.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py index 5810bf3c..42fdd076 100644 --- a/morphlib/stagingarea.py +++ b/morphlib/stagingarea.py @@ -190,9 +190,10 @@ class StagingArea(object): shutil.rmtree(self.dirname) - to_mount = ( + to_mount_in_staging = ( ('dev/shm', 'tmpfs', 'none'), ) + to_mount_in_bootstrap = () def ccache_dir(self, source): #pragma: no cover ccache_dir = self._app.settings['compiler-cache-dir'] @@ -275,10 +276,10 @@ class StagingArea(object): binds = () if self.use_chroot: - mounts = self.to_mount + mounts = self.to_mount_in_staging else: mounts = [(os.path.join(self.dirname, target), type, source) - for target, type, source in self.to_mount] + for target, type, source in self.to_mount_in_bootstrap] cmdline = morphlib.util.containerised_cmdline( argv, cwd=kwargs.pop('cwd', '/'), root=chroot_dir, mounts=mounts, -- cgit v1.2.1