From 3c83ebc459c181320c00edf4b31ea66b0c098f98 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Sun, 25 Nov 2007 03:31:42 +0000 Subject: [PATCH] add option for metadata_overlay use with portage git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1262 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 4 ++++ catalyst | 4 ++++ files/catalyst.conf | 4 +++- modules/generic_stage_target.py | 10 +++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d7e1291..de55ee24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 25 Nov 2007; Andrew Gaffney catalyst, + files/catalyst.conf, modules/generic_stage_target.py: + add option for metadata_overlay use with portage + 25 Nov 2007; Andrew Gaffney modules/stage1_target.py, modules/stage2_target.py, modules/stage3_target.py: diff --git a/catalyst b/catalyst index 819e7558..e5356955 100755 --- a/catalyst +++ b/catalyst @@ -133,6 +133,10 @@ def parse_config(myconfig): print "Snapshot cache support enabled." conf_values["SNAPCACHE"]="1" + if "metadata_overlay" in conf_values["options"].split(): + print "Use of metadata_overlay module for portage enabled." + conf_values["METADATA_OVERLAY"]="1" + # if "tarball" in string.split(conf_values["options"]): # print "Tarball creation enabled." # conf_values["TARBALL"]="1" diff --git a/files/catalyst.conf b/files/catalyst.conf index 4dfd3cf8..909e0d7b 100644 --- a/files/catalyst.conf +++ b/files/catalyst.conf @@ -38,6 +38,8 @@ hash_function="crc32" # build stops in livecd-stage2) # pkgcache = keeps a tbz2 of every built package (useful if your build stops # prematurely) +# metadata_overlay = enabled the metadata_overlay cache module in portage, which +# uses the in-tree metadata # seedcache = use the build output of a previous target if it exists to speed up # the copy # snapcache = cache the snapshot so that it can be bind-mounted into the chroot. @@ -45,7 +47,7 @@ hash_function="crc32" # your cache. The cache is unlinked before any empty or rm processing, though. # # (These options can be used together) -options="autoresume kerncache pkgcache seedcache snapcache" +options="autoresume kerncache pkgcache seedcache snapcache metadata_overlay" # portdir specifies the source portage tree used by the snapshot target. portdir="/usr/portage" diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 32315840..f57443a9 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -865,6 +865,14 @@ class generic_stage_target(generic_target): cmd("cp "+self.settings["ENVSCRIPT"]+" "+self.settings["chroot_path"]+"/tmp/envscript",\ "Could not copy envscript into place.",env=self.env) + # Setup metadata_overlay + if self.settings.has_key("METADATA_OVERLAY") and not self.settings.has_key("portage_confdir"): + if not os.path.exists(self.settings["chroot_path"] + "/etc/portage"): + cmd("mkdir " + self.settings["chroot_path"] + "/etc/portage") + myf = open(self.settings["chroot_path"] + "/etc/portage/modules", "a") + myf.write("portdbapi.auxdbmodule = cache.metadata_overlay.database\n") + myf.close() + # Copy over /etc/hosts from the host in case there are any # specialties in there if os.path.exists(self.settings["chroot_path"]+"/etc/hosts"): @@ -909,7 +917,7 @@ class generic_stage_target(generic_target): if self.settings.has_key("portage_overlay"): # myf.write('PORTDIR_OVERLAY="'+string.join(self.settings["portage_overlay"])+'"\n') myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n') - + myf.close() touch(self.settings["autoresume_path"]+"chroot_setup") -- 2.26.2