summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 18:34:45 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 18:34:45 +0100
commit74b94cba495611cde6fda2fdb21ebaaad30e1ba0 (patch)
tree7f9d17d50920e63ef9a9f0fb54a641e211229c1a /morphlib
parentefc40ad01c0fc71a789ef338f0f7dea0879d8ffc (diff)
downloadmorph-74b94cba495611cde6fda2fdb21ebaaad30e1ba0.tar.gz
Unmounted /proc in staging before assembling chunks, and only if it is there
We have no use for /proc while building chunk artifacts, and hopefully this will prevent accidentally including /proc in them.
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/builder2.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 9954f9d1..b82de888 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -139,12 +139,11 @@ 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:
self.umount_proc(mounted)
raise
- else:
- self.umount_proc(mounted)
self.save_build_times()
def mount_proc(self): # pragma: no cover
@@ -160,7 +159,7 @@ class ChunkBuilder(BuilderBase):
return None
def umount_proc(self, mounted): # pragma: no cover
- if mounted:
+ if mounted and self.setup_proc and os.path.exists(mounted):
logging.error('Unmounting /proc in staging area: %s' % mounted)
self.staging_area.runcmd(['umount', mounted])