diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-26 11:39:56 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-26 11:39:56 +0100 |
commit | 293f39a24abfa12cc51e1f0633efd58761e18274 (patch) | |
tree | 50320361f10e94047ff2dcce78c0ea279f4a9f8c /morphlib | |
parent | 74b94cba495611cde6fda2fdb21ebaaad30e1ba0 (diff) | |
download | morph-293f39a24abfa12cc51e1f0633efd58761e18274.tar.gz |
Fix how unmounting of /proc inside chroot is done
Note to self, everyone: /path/to/chroot/proc does not actually
exist inside the chroot.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/builder2.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py index b82de888..cb1cb0d8 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -139,11 +139,12 @@ class ChunkBuilder(BuilderBase): self.get_sources(builddir) destdir = self.staging_area.destdir(self.artifact.source) self.run_commands(builddir, destdir) - self.umount_proc(mounted) - self.assemble_chunk_artifacts(destdir) - except BaseException: + except: self.umount_proc(mounted) raise + self.umount_proc(mounted) + self.assemble_chunk_artifacts(destdir) + self.save_build_times() def mount_proc(self): # pragma: no cover @@ -159,9 +160,11 @@ class ChunkBuilder(BuilderBase): return None def umount_proc(self, mounted): # pragma: no cover - if mounted and self.setup_proc and os.path.exists(mounted): + path = os.path.join(mounted, 'self') + if mounted and self.setup_proc and os.path.exists(path): logging.error('Unmounting /proc in staging area: %s' % mounted) - self.staging_area.runcmd(['umount', mounted]) + ex = morphlib.execute.Execute('.', logging.debug) + ex.runv(['umount', mounted]) def get_sources(self, srcdir): # pragma: no cover '''Get sources from git to a source directory, for building.''' |