From 85cc3d2c97490743a8dbe8f5dec644836eb9708e Mon Sep 17 00:00:00 2001 From: "John P. Davis" Date: Fri, 13 Aug 2004 16:00:48 +0000 Subject: [PATCH] commit for 1.9.0 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@428 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 10 +++- files/catalyst.1 | 85 +++++++++++++++++++++++++++++ modules/generic_stage_target.py | 41 +++++--------- modules/livecd_stage2_target.py | 96 +++++++++++---------------------- modules/snapshot_target.py | 8 +-- 5 files changed, 145 insertions(+), 95 deletions(-) create mode 100644 files/catalyst.1 diff --git a/ChangeLog b/ChangeLog index a9816d96..34d51633 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.77 2004/08/10 04:25:08 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.78 2004/08/13 16:00:47 zhen Exp $ + + 13 Aug 2004; John Davis +files/catalyst.1, + modules/generic_stage_target.py, modules/livecd_stage2_target.py, + modules/snapshot_target.py: + bugfixes for #55014 (catalyst needs a manpage), #56581 (livecd-stage2 I/O + enhancements), and #56773 (catalyst overlay for build root). Snapshotting + time should also be improved due to a more efficient use of rsync. This commit will + mark the portage version of catalyst-1.9.0. 10 Aug 2004; John Davis arch/mips.py: add support for mips4n32 subarch. thanks to iluxa@gentoo.org. closes bug diff --git a/files/catalyst.1 b/files/catalyst.1 new file mode 100644 index 00000000..4c54e54b --- /dev/null +++ b/files/catalyst.1 @@ -0,0 +1,85 @@ +.TH "CATALYST" "1" "August 12, 2004" "Catalyst 1.0.9" "Catalyst" + +.SH NAME +catalyst \- The Gentoo Linux Release Engineering meta-tool + +.SH SYNOPSIS +.TP + +.BR catalyst +[\fIoptions\fR] [\fI\-f file\fR | \fI\-C keys\fR] ... +.TP + +.BR catalyst +\fI\-\-help \-h\fR +.TP + +.BR catalyst +\fI\-\-version \-v\fR + +.SH DESCRIPTION +\fBcatalyst\fR is the tool that the Gentoo Release Engineering team +utilizes to build all Gentoo Linux releases. It is capable of building +installation stages, bootable LiveCDs, and Gentoo Reference Platform (GRP) +sets. \fBcatalyst\fR is also capable of providing a simple tinderbox +environment for ebuild/package testing. + +For more information, please visit the \fBcatalyst\fR project page +on the web at . + +.SH OPTIONS +.TP + +.BR "\-\-help " (\fB\-h\fR) +Print the help message and exit +.TP + +.BR "\-\-version " (\fB\-v\fR) +Print the version information and exit +.TP + +.BR "\-\-debug " (\fB\-d\fR) +Enable debugging mode +.TP + +.BR "\-\-config " (\fB\-c\fR) +Tell \fBcatalyst\fR to use a user-defined configuration file. A sample +configuration file is installed at /etc/catalyst/catalyst.conf. +.TP + +.BR "\-\-cli " (\fB\-C\fR) +This option is to be used in place of a specfile. All options are passed +to \fBcatalyst\fR on the commandline. Please note that this option must +be the last option passed to \fBcatalyst\fR for everything to work correctly. +.TP + +.BR "\-\-file " (\fB\-f\fR) +Tell \fBcatalyst\fR to use the user supplied specfile. +.TP + +.BR "\-\-verbose " (\fB\-V\fR) +Enable verbose mode. + +.SH FILES +.TP +Example specfiles can be found in /usr/share/doc/catalyst-/examples. An example configuration file can be found at /etc/catalyst/catalyst.conf. + +.SH BUGS +.TP +An up-to-date list of Catalyst bugs can always be found listed on the Gentoo Linux bug-tracking system at . + +.SH SEE ALSO +.TP +A more in-depth examination of Catalyst options and procedures can be found linked from the \fBcatalyst\fR project page, which is located at . + +.SH NOTES +.TP +\fBCatalyst\fR is conceptually derived from the Gentoo livecd-ng and Gentoo stager projects, both of which were used to create pre-1.4 Gentoo releases. +.LP +\fBCatalyst\fR was originally conceived and coded by both Daniel Robbins and John Davis. + +.SH AUTHOR +John Davis + +.SH "CVS HEADER" +$Id: catalyst.1,v 1.1 2004/08/13 16:00:48 zhen Exp $ diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index e5ca3c78..73e3a86e 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.10 2004/08/05 04:25:25 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.11 2004/08/13 16:00:48 zhen Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -185,17 +185,13 @@ class generic_stage_target(generic_target): def dir_setup(self): print "Setting up directories..." self.mount_safety_check() - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_dir_setup"): - print "Resume point detected, skipping directory setup..." - else: + if not self.settings["target"] == "livecd-stage2": cmd("rm -rf "+self.settings["chroot_path"],\ "Could not remove existing directory: "+self.settings["chroot_path"]) - if not os.path.exists(self.settings["chroot_path"]+"/tmp"): - os.makedirs(self.settings["chroot_path"]+"/tmp") - touch(self.settings["chroot_path"]+"/tmp/.clst_dir_setup") + if not os.path.exists(self.settings["chroot_path"]+"/tmp"): + os.makedirs(self.settings["chroot_path"]+"/tmp") if not os.path.exists(self.settings["chroot_path"]): os.makedirs(self.settings["chroot_path"]) @@ -206,27 +202,19 @@ class generic_stage_target(generic_target): def unpack_and_bind(self): - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_unpack_and_bind"): - print "Resume point detected, skipping unpack and bind operation..." - - else: - print "Unpacking stage tarball..." - cmd("tar xjpf "+self.settings["source_path"]+" -C "+self.settings["chroot_path"],\ - "Error unpacking tarball") + print "Unpacking stage tarball..." + cmd("tar xjpf "+self.settings["source_path"]+" -C "+self.settings["chroot_path"],\ + "Error unpacking tarball") - if os.path.exists(self.settings["chroot_path"]+"/usr/portage"): - print "Cleaning up existing portage tree snapshot..." - cmd("rm -rf "+self.settings["chroot_path"]+"/usr/portage",\ - "Error removing existing snapshot directory.") + if os.path.exists(self.settings["chroot_path"]+"/usr/portage"): + print "Cleaning up existing portage tree snapshot..." + cmd("rm -rf "+self.settings["chroot_path"]+"/usr/portage",\ + "Error removing existing snapshot directory.") - print "Unpacking portage tree snapshot..." - cmd("tar xjpf "+self.settings["snapshot_path"]+" -C "+\ - self.settings["chroot_path"]+"/usr","Error unpacking snapshot") + print "Unpacking portage tree snapshot..." + cmd("tar xjpf "+self.settings["snapshot_path"]+" -C "+\ + self.settings["chroot_path"]+"/usr","Error unpacking snapshot") - touch(self.settings["chroot_path"]+"/tmp/.clst_unpack_and_bind") - - # for safety's sake, we really don't want to resume these either print "Configuring profile link..." cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.profile",\ "Error zapping profile link") @@ -239,7 +227,6 @@ class generic_stage_target(generic_target): cmd("cp -R "+self.settings["portage_confdir"]+" "+self.settings["chroot_path"]+\ "/etc/portage","Error copying /etc/portage") - # do all of our bind mounts here (does not get autoresumed!) for x in self.mounts: if not os.path.exists(self.settings["chroot_path"]+x): os.makedirs(self.settings["chroot_path"]+x) diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 3d03450c..23817ea6 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.17 2004/07/21 05:03:42 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.18 2004/08/13 16:00:48 zhen Exp $ """ Builder class for a LiveCD stage2 build. @@ -37,7 +37,8 @@ class livecd_stage2_target(generic_stage_target): self.valid_values.extend(["livecd/cdtar","livecd/empty","livecd/rm",\ "livecd/unmerge","livecd/iso","livecd/gk_mainargs","livecd/type",\ "livecd/motd","livecd/overlay","livecd/modblacklist","livecd/bootsplash",\ - "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc"]) + "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc",\ + "livecd/root_overlay"]) generic_stage_target.__init__(self,spec,addlargs) file_locate(self.settings, ["livecd/cdtar","livecd/archscript","livecd/runscript"]) @@ -45,22 +46,12 @@ class livecd_stage2_target(generic_stage_target): file_locate(self.settings,["portage_confdir"],expand=0) def unpack_and_bind(self): - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["cdroot_path"]+"/tmp/.clst_unpack_and_bind"): - print "Resume point detected, skipping unpack and bind operation..." - - else: - if os.path.exists(self.settings["chroot_path"]): - print "Removing previously-existing livecd-stage2 chroot directory..." - cmd("rm -rf "+self.settings["chroot_path"],"Error removing livecd-stage2 chroot") - os.makedirs(self.settings["chroot_path"]) + if not os.path.exists(self.settings["chroot_path"]): + os.makedirs(self.settings["chroot_path"]) - print "Copying livecd-stage1 result to new livecd-stage2 work directory..." - cmd("cp -a "+self.settings["source_path"]+"/* "+self.settings["chroot_path"], - "Error copying initial livecd-stage2") - touch(self.settings["chroot_path"]+"/tmp/.clst_unpack_and_bind") + print "Copying livecd-stage1 result to new livecd-stage2 work directory..." + cmd("rsync -a --delete "+self.settings["source_path"]+"/* "+self.settings["chroot_path"],"Error copying initial livecd-stage2") - # we do not want to resume code below this line print "Configuring profile link..." cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.profile","Error zapping profile link") cmd("ln -sf ../usr/portage/profiles/"+self.settings["target_profile"]+" " @@ -161,7 +152,7 @@ class livecd_stage2_target(generic_stage_target): cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdfs","CDFS runscript failed.") if self.settings.has_key("livecd/overlay"): - cmd("/bin/cp -a "+self.settings["livecd/overlay"]+"/* "+\ + cmd("rsync -a "+self.settings["livecd/overlay"]+"/* "+\ self.settings["cdroot_path"],"LiveCD overlay copy failed.") # clean up the resume points @@ -261,65 +252,42 @@ class livecd_stage2_target(generic_stage_target): def run_local(self): # first clean up any existing cdroot stuff - # unless of course we are resuming - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_run_local_cdroot_clean"): - print "Resume point detected, not cleaning cdroot_path..." - - else: - if os.path.exists(self.settings["cdroot_path"]): - print "cleaning previous livecd-stage2 build" - cmd("rm -rf "+self.settings["cdroot_path"], - "Could not remove existing directory: "+self.settings["cdroot_path"]) + if os.path.exists(self.settings["cdroot_path"]): + print "cleaning previous livecd-stage2 build" + cmd("rm -rf "+self.settings["cdroot_path"], + "Could not remove existing directory: "+self.settings["cdroot_path"]) - if not os.path.exists(self.settings["cdroot_path"]): - os.makedirs(self.settings["cdroot_path"]) - - touch(self.settings["chroot_path"]+"/tmp/.clst_run_local_cdroot_clean") + if not os.path.exists(self.settings["cdroot_path"]): + os.makedirs(self.settings["cdroot_path"]) # the runscripts do the real building, so execute them now # this is the part that we want to resume on since it is the most time consuming try: - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+\ - "/tmp/.clst_run_local_kernel_script"): - print "Resume point detected, skipping kernel build runscript..." - - else: - self.build_kernel() - touch(self.settings["chroot_path"]+"/tmp/.clst_run_local_kernel_script") - - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+\ - "/tmp/.clst_run_local_bootloader_script"): - print "Resume point detected, skipping bootloader runscript..." + self.build_kernel() - else: - cmd("/bin/bash "+self.settings["livecd/runscript"]+" bootloader",\ - "Bootloader runscript failed.") - touch(self.settings["chroot_path"]+"/tmp/.clst_run_local_bootloader_script") + cmd("/bin/bash "+self.settings["livecd/runscript"]+" bootloader",\ + "Bootloader runscript failed.") except CatalystError: self.unbind() raise CatalystError,"Runscript aborting due to error." # what modules do we want to blacklist? - if self.settings.has_key("AUTORESUME") \ - and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_run_local_blacklist"): - print "Resume point detected, skipping module blacklisting..." - - else: - if self.settings.has_key("livecd/modblacklist"): - try: - myf=open(self.settings["chroot_path"]+"/etc/hotplug/blacklist","a") - except: - self.unbind() - raise CatalystError,"Couldn't open "+self.settings["chroot_path"]+"/etc/hotplug/blacklist." - myf.write("\n#Added by Catalyst:") - for x in self.settings["livecd/modblacklist"]: - myf.write("\n"+x) - myf.close() - touch(self.settings["chroot_path"]+"/tmp/.clst_run_local_blacklist") + if self.settings.has_key("livecd/modblacklist"): + try: + myf=open(self.settings["chroot_path"]+"/etc/hotplug/blacklist","a") + except: + self.unbind() + raise CatalystError,"Couldn't open "+self.settings["chroot_path"]+"/etc/hotplug/blacklist." + myf.write("\n#Added by Catalyst:") + for x in self.settings["livecd/modblacklist"]: + myf.write("\n"+x) + myf.close() + + # copy over the livecd/root_overlay + if self.settings.has_key("livecd/root_overlay"): + cmd("rsync -a "+self.settings["livecd/root_overlay"]+"/* "+\ + self.settings["chroot_path"], "livecd/root_overlay copy failed.") def register(foo): foo.update({"livecd-stage2":livecd_stage2_target}) diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py index 16df2a57..b7e80651 100644 --- a/modules/snapshot_target.py +++ b/modules/snapshot_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.3 2004/07/03 00:33:37 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.4 2004/08/13 16:00:48 zhen Exp $ """ Builder class for snapshots. @@ -14,11 +14,13 @@ class snapshot_target(generic_target): def __init__(self,myspec,addlargs): self.required_values=["version_stamp","target"] self.valid_values=["version_stamp","target","portdir_overlay"] + generic_target.__init__(self,myspec,addlargs) self.settings=myspec - self.settings["target_subpath"]="portage-"+self.settings["version_stamp"] + self.settings["target_subpath"]="portage" st=self.settings["storedir"] - self.settings["snapshot_path"]=st+"/snapshots/"+self.settings["target_subpath"]+".tar.bz2" + self.settings["snapshot_path"]=st+"/snapshots/portage-"+self.settings["version_stamp"]\ + +".tar.bz2" self.settings["tmp_path"]=st+"/tmp/"+self.settings["target_subpath"] def setup(self): -- 2.26.2