aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2012-10-24 23:20:36 -0400
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2012-10-24 23:20:36 -0400
commit4fc99aed1c6ba4d262f7d0c70f07cdd3413c18df (patch)
tree1604fe1454890d0010f24eefa48f74675aeeacf9
parentfix order of stage1 portage updates (diff)
downloadcatalyst-4fc99aed1c6ba4d262f7d0c70f07cdd3413c18df.tar.gz
catalyst-4fc99aed1c6ba4d262f7d0c70f07cdd3413c18df.tar.bz2
catalyst-4fc99aed1c6ba4d262f7d0c70f07cdd3413c18df.zip
initial support for /var/tmp/portage in tmpfs
recently a bug in ZFS completely preventing building on my host system, due to this fact I hacked in this support to get around the issue. Since building in tmpfs can speed things significantly I've added the support properly and optionally. Hopefully others like this as much as I do. My motivation: https://bugs.gentoo.org/show_bug.cgi?id=411555 Thanks to jmbsvicetto and dol-sen for helping me read catalyst.
-rwxr-xr-xcatalyst3
-rw-r--r--files/catalyst.conf6
-rw-r--r--modules/generic_stage_target.py18
3 files changed, 21 insertions, 6 deletions
diff --git a/catalyst b/catalyst
index 33e121fd..483a6e53 100755
--- a/catalyst
+++ b/catalyst
@@ -165,6 +165,9 @@ def parse_config(myconfig):
print "Envscript support enabled."
conf_values["ENVSCRIPT"]=myconf["envscript"]
+ if myconf.has_key("var_tmpfs_portage"):
+ conf_values["var_tmpfs_portage"]=myconf["var_tmpfs_portage"];
+
def import_modules():
# import catalyst's own modules (i.e. catalyst_support and the arch modules)
targetmap={}
diff --git a/files/catalyst.conf b/files/catalyst.conf
index a5ef120c..49d2a15f 100644
--- a/files/catalyst.conf
+++ b/files/catalyst.conf
@@ -80,3 +80,9 @@ snapshot_cache="/var/tmp/catalyst/snapshot_cache"
# storedir specifies where catalyst will store everything that it builds, and
# also where it will put its temporary files and caches.
storedir="/var/tmp/catalyst"
+
+# var_tmpfs_portage will mount a tmpfs for /var/tmp/portage so building takes place in RAM
+# this feature requires a pretty large tmpfs ({open,libre}office needs ~8GB to build)
+# WARNING: If you use too much RAM everything will fail horribly and it is not our fault.
+# set size of /var/tmp/portage tmpfs in gigabytes
+# var_tmpfs_portage=16
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index eb5f4905..ae7d97cd 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -174,14 +174,14 @@ class generic_stage_target(generic_target):
""" Setup our mount points """
if self.settings.has_key("SNAPCACHE"):
- self.mounts=["/proc","/dev","/usr/portage","/usr/portage/distfiles"]
+ self.mounts=["/proc","/dev","/usr/portage","/usr/portage/distfiles","/var/tmp/portage"]
self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
- "/usr/portage/distfiles":self.settings["distdir"]}
+ "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
else:
- self.mounts=["/proc","/dev","/usr/portage/distfiles"]
+ self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
- "/usr/portage/distfiles":self.settings["distdir"]}
+ "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
if os.uname()[0] == "Linux":
self.mounts.append("/dev/pts")
@@ -887,8 +887,14 @@ class generic_stage_target(generic_target):
retval=os.system("mount_nullfs "+src+" "+\
self.settings["chroot_path"]+x)
else:
- retval=os.system("mount --bind "+src+" "+\
- self.settings["chroot_path"]+x)
+ if src == "tmpfs":
+ if self.settings.has_key("var_tmpfs_portage"):
+ retval=os.system("mount -t tmpfs -o size="+\
+ self.settings["var_tmpfs_portage"]+"G "+src+" "+\
+ self.settings["chroot_path"]+x)
+ else:
+ retval=os.system("mount --bind "+src+" "+\
+ self.settings["chroot_path"]+x)
if retval!=0:
self.unbind()
raise CatalystError,"Couldn't bind mount "+src