summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-24 16:49:45 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-24 16:49:45 +0100
commit1424a3488eb9b6ecd57bb51159b5d63c33153c2a (patch)
tree45df2b683734745d867a7263674c47fb821bdea4 /morphlib
parent6c93b6e015234bb132c4f44cc2201f03adee63e5 (diff)
downloadmorph-1424a3488eb9b6ecd57bb51159b5d63c33153c2a.tar.gz
Mount /proc while building a chunk
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/builder2.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index b634236b..7c80849a 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -132,13 +132,27 @@ class ChunkBuilder(BuilderBase):
def build_and_cache(self): # pragma: no cover
with self.build_watch('overall-build'):
+ mounted = self.mount_proc()
builddir = self.staging_area.builddir(self.artifact.source)
self.get_sources(builddir)
destdir = self.staging_area.destdir(self.artifact.source)
self.run_commands(builddir, destdir)
self.assemble_chunk_artifacts(destdir)
+ if mounted:
+ self.umount_proc()
self.save_build_times()
+ def mount_proc(self): # pragma: no cover
+ try:
+ self.staging_area.runcmd(['mount', '-t', 'proc', 'proc', '/proc'])
+ except morphlib.execute.CommandFailure:
+ return False
+ else:
+ return True
+
+ def umount_proc(self): # pragma: no cover
+ self.staging_area.runcmd(['umount', '/proc'])
+
def get_sources(self, srcdir): # pragma: no cover
'''Get sources from git to a source directory, for building.'''