summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-19 12:13:46 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-19 12:13:46 +0000
commitd565903ed91a183f2768290dd63dc1a306b8e1a3 (patch)
tree39988980e822b59c43fc05104b8520925cfeeace
parent8e319db777ccb11ae565293e5c86919192fb459b (diff)
parentd5c95a623884b7a837d99911cf1967675ae5dee6 (diff)
downloadmorph-d565903ed91a183f2768290dd63dc1a306b8e1a3.tar.gz
Merge branch 'baserock/richardmaw/bugfix/stagingarea-mounts-inside-destdir-v2'
Reviewed-By: Sam Thursfield <sam.thursfield@codethink.co.uk>
-rw-r--r--morphlib/stagingarea.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py
index e7783890..fd3f6881 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']
@@ -266,7 +267,13 @@ class StagingArea(object):
do_not_mount_dirs += [temp_dir]
logging.debug("Not mounting dirs %r" % do_not_mount_dirs)
+ if self.use_chroot:
+ mounts = self.to_mount_in_staging
+ else:
+ mounts = [(os.path.join(self.dirname, target), type, source)
+ for target, type, source in self.to_mount_in_bootstrap]
mount_proc = self.use_chroot
+
if ccache_dir and not self._app.settings['no-ccache']:
ccache_target = os.path.join(
self.dirname, kwargs['env']['CCACHE_DIR'].lstrip('/'))
@@ -277,9 +284,9 @@ class StagingArea(object):
container_config=dict(
cwd=kwargs.pop('cwd', '/'),
root=chroot_dir,
- mounts=self.to_mount,
- binds=binds,
+ mounts=mounts,
mount_proc=mount_proc,
+ binds=binds,
writable_paths=do_not_mount_dirs)
cmdline = morphlib.util.containerised_cmdline(