summaryrefslogtreecommitdiff
path: root/morphlib/stagingarea.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-10-15 18:13:24 +0000
committerRichard Maw <richard.maw@gmail.com>2014-10-22 15:29:28 +0000
commit1f2ff75726da126719894f2e23d9d0f61fefb321 (patch)
treebaa1520bce96e92f828b7ca33f95f970a26a6d0a /morphlib/stagingarea.py
parentc5d1527c34ca7374a51366e54056145a5bd4bcb7 (diff)
downloadmorph-1f2ff75726da126719894f2e23d9d0f61fefb321.tar.gz
Don't mount /dev/shm in builds.baserock/richardmaw/parallelism-improvements
This was the final mount command that was causing problems. Now that it's gone, we don't need all the infrastructure that had grown up to do the mounts before running commands independently of what linux-user-chroot already does.
Diffstat (limited to 'morphlib/stagingarea.py')
-rw-r--r--morphlib/stagingarea.py28
1 files changed, 3 insertions, 25 deletions
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py
index 25e33b3f..1af3a7c0 100644
--- a/morphlib/stagingarea.py
+++ b/morphlib/stagingarea.py
@@ -45,7 +45,6 @@ class StagingArea(object):
self.dirname = dirname
self.builddirname = None
self.destdirname = None
- self.mounted = []
self._bind_readonly_mount = None
self.use_chroot = use_chroot
@@ -224,24 +223,7 @@ class StagingArea(object):
os.makedirs(ccache_destdir)
return ccache_repodir
- def do_mounts(self, setup_mounts): # pragma: no cover
- if not setup_mounts:
- return
- for mount_point, mount_type, source in self.to_mount:
- logging.debug('Mounting %s in staging area' % mount_point)
- path = os.path.join(self.dirname, mount_point)
- if not os.path.exists(path):
- os.makedirs(path)
- morphlib.fsutils.mount(self._app.runcmd, source, path, mount_type)
- self.mounted.append(path)
- return
-
- def do_unmounts(self): # pragma: no cover
- for path in reversed(self.mounted):
- logging.debug('Unmounting %s in staging area' % path)
- morphlib.fsutils.unmount(self._app.runcmd, path)
-
- def chroot_open(self, source, setup_mounts): # pragma: no cover
+ def chroot_open(self, source): # pragma: no cover
'''Setup staging area for use as a chroot.'''
assert self.builddirname == None and self.destdirname == None
@@ -251,19 +233,15 @@ class StagingArea(object):
self.builddirname = builddir
self.destdirname = destdir
- self.do_mounts(setup_mounts)
-
return builddir, destdir
def chroot_close(self): # pragma: no cover
- '''Undo changes by chroot_open.
+ '''Clean up resources after opening a chroot
- This should be called after the staging area is no longer needed.
+ No resources are currently allocated at open time, so this is a NOOP
'''
- self.do_unmounts()
-
def runcmd(self, argv, **kwargs): # pragma: no cover
'''Run a command in a chroot in the staging area.'''
assert 'env' not in kwargs