From 1568eef4a14c8f806268c1b16d646c2e32f5a72e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 25 Apr 2012 12:32:23 +0100 Subject: Setup /proc in staging only if using chroot; install staging-fillers --- morph | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'morph') diff --git a/morph b/morph index aa78b4c7..d9f1866d 100755 --- a/morph +++ b/morph @@ -224,21 +224,29 @@ class Morph(cliapp.Application): staging_root = '/' staging_temp = tempfile.mkdtemp() install_chunks = True + setup_proc = False elif self.settings['staging-chroot']: staging_root = tempfile.mkdtemp() staging_temp = staging_root install_chunks = True + setup_proc = True else: staging_root = '/' staging_temp = tempfile.mkdtemp() install_chunks = False + setup_proc = False staging_area = morphlib.stagingarea.StagingArea(staging_root, staging_temp) + if self.settings['staging-chroot']: + self._install_initial_staging(staging_area) builder = morphlib.builder2.Builder(staging_area, lac, lrc, build_env, self.settings['max-jobs']) + if setup_proc: + builder.setup_proc = True + for group in order.groups: for artifact in group: if artifact in needed: @@ -265,6 +273,13 @@ class Morph(cliapp.Application): if staging_temp != '/' and os.path.exists(staging_temp): shutil.rmtree(staging_temp) + def _install_initial_staging(self, staging_area): + logging.debug('Pre-populating staging area %s' % staging_area.dirname) + logging.debug('Fillers: %s' % repr(self.settings['staging-filler'])) + for filename in self.settings['staging-filler']: + with open(filename, 'rb') as f: + staging_area.install_artifact(f) + def cmd_show_dependencies(self, args): '''Dumps the dependency tree of all input morphologies.''' -- cgit v1.2.1