From: Eric Edgar Date: Wed, 30 Nov 2005 21:37:58 +0000 (+0000) Subject: Fix livecd-stage1 livecd use flag bug; stage4 doc cleanups;autoresume points after... X-Git-Tag: CATALYST_2_0_6_916~574 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=661171b3809f7cab782708a51c7afe29a5ea251f;p=catalyst.git Fix livecd-stage1 livecd use flag bug; stage4 doc cleanups;autoresume points after each successful kernel build;add autoresume documentation to catalyst.conf git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@920 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 5b54a0fa..6a541f80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.407 2005/11/30 21:34:03 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.408 2005/11/30 21:37:58 rocket Exp $ + + 30 Nov 2005; Eric Edgar examples/stage4_template.spec, + files/catalyst.conf, modules/generic_stage_target.py, + modules/livecd_stage1_target.py: + Fix livecd-stage1 livecd use flag bug; stage4 doc cleanups;autoresume points + after each successful kernel build;add autoresume documentation to + catalyst.conf 30 Nov 2005; Chris Gianelloni arch/ppc.py, targets/embedded/embedded-controller.sh, diff --git a/examples/stage4_template.spec b/examples/stage4_template.spec index 13e4c704..e523d50f 100644 --- a/examples/stage4_template.spec +++ b/examples/stage4_template.spec @@ -64,16 +64,15 @@ portage_confdir: # pkgcache_path: /tmp/packages pkgcache_path: -# The stage4-stage1 target is where you will build packages for your CD. These -# packages can be built with customized USE settings. The settings here are -# additive to the default USE configured by the profile. For building release -# media, the first thing we do is disable all default USE flags with -* and then -# begin to set our own. +# The stage4 target is where you will build packages for basically updated stage3. +# These packages can be built with customized USE settings. The settings here are +# additive to the default USE configured by the profile. +# Leaving this blank will default to the system use flags # example: -# stage4/use: -* ipv6 socks5 livecd fbcon ncurses readline ssl +# stage4/use: ipv6 socks5 fbcon ncurses readline ssl stage4/use: -# This is the set of packages that we will merge into the CD's filesystem. They +# This is the set of packages that we will merge into the stage4 tarball. They # will be built with the USE flags configured above. These packages must not # depend on a configured kernel. If the package requires a configured kernel, # then it will be defined elsewhere. @@ -81,7 +80,7 @@ stage4/use: # stage4/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant stage4/packages: -# A fsscript is simply a shell script that is copied into the chroot of the CD +# A fsscript is simply a shell script that is copied into the chroot of the stage4 # after the kernel(s) and any external modules have been compiled and is # executed within the chroot. It can contain any commands that are available # via the packages installed by our stages or by the packages installed during @@ -120,26 +119,7 @@ stage4/gk_mainargs: # stage4/linuxrc: stage4/linuxrc: -# This option controls quite a bit of catalyst internals and sets up several -# defaults. Each type behaves slightly differently and is explained below. -# gentoo-release-minimal - This creates an official minimal InstallCD. -# gentoo-release-universal - This creates an official universal InstallCD. -# gentoo-release-stage4 - This creates an official LiveCD environment. -# gentoo-gamecd - This creates an official Gentoo GameCD. -# generic-stage4 - This should be used for all non-official media. -# example: -# stage4/type: gentoo-release-minimal -stage4/type: - -# This is for the README.txt on the root of the CD. For Gentoo releases, we -# use a default README.txt, and this will be used on your CD if you do not -# provide one yourself. Since we do not use this for the official releases, it -# is left blank below. -# example: -# stage4/readme: -stage4/readme: - -# This is for the CD's message of the day. It is not required for official +# This is for the message of the day. It is not required # release media, as catalyst builds a default motd when the stage4/type is set # to one of the gentoo-* options. This setting overrides the default motd even # on official media. Since we do not use this for the official releases, it is @@ -175,7 +155,7 @@ stage4/rcdel: # This overlay is dropped onto the filesystem within the loop. This can be used # for such things as updating configuration files or adding anything else you -# would want within your CD filesystem. Files added here are available when +# would want within your stage4 filesystem. Files added here are available when # docache is used. We do not use this on the official media, so we will leave # it blank below. # example: diff --git a/files/catalyst.conf b/files/catalyst.conf index 65afdc15..70d2c487 100644 --- a/files/catalyst.conf +++ b/files/catalyst.conf @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/files/catalyst.conf,v 1.14 2005/11/22 19:30:10 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/files/catalyst.conf,v 1.15 2005/11/30 21:37:58 rocket Exp $ # Simple desriptions of catalyst settings. Please refer to the online # documentation for more information. @@ -12,14 +12,18 @@ distdir="/usr/portage/distfiles" # options set different build-time options for catalyst. Some examples are: # ccache = enables build time ccache support (highly recommended) # distcc = enable distcc support for building. You have to set distcc_hosts in -# your spec file. +# your spec file. # pkgcache = keeps a tbz2 of every built package (useful if your build stops -# prematurely) +# prematurely) # kerncache = keeps a tbz2 of your built kernel and modules (useful if your -# build stops in livecd-stage2) +# build stops in livecd-stage2) # seedcache = use the build output of a previous target if it exists to speed up -# the copy +# the copy # snapcache = cache the snapshot so that it can be bind-mounted into the chroot. +# autoresume = Attempt to resume a failed build, clear the autoresume flags with +# the -a option to the catalyst cmdline. -p will clear the +# autoresume flags as well as your pkgcache and kerncache. +# ( This option is not fully tested, bug reports welcome ) options="pkgcache kerncache seedcache snapcache" # sharedir specifies where all of the catalyst runtime executables are. Most diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 996b5769..cd437063 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.79 2005/11/18 22:30:22 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.80 2005/11/30 21:37:58 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -1046,59 +1046,66 @@ class generic_stage_target(generic_target): "Runscript pre-kmerge failed") for kname in mynames: - try: - if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]): - self.unbind() - raise CatalystError, "Can't find kernel config: " \ - +self.settings["boot/kernel/"+kname+"/config"] + if self.settings.has_key("AUTORESUME") \ + and os.path.exists(self.settings["autoresume_path"]+"build_kernel_"+kname): + print "Resume point detected, skipping build_kernel for "+kname+" operation..." + else: + + try: + if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]): + self.unbind() + raise CatalystError, "Can't find kernel config: " \ + +self.settings["boot/kernel/"+kname+"/config"] - except TypeError: - raise CatalystError, "Required value boot/kernel/config not specified" + except TypeError: + raise CatalystError, "Required value boot/kernel/config not specified" - try: - cmd("cp "+self.settings["boot/kernel/"+kname+"/config"]+" "+ \ - self.settings["chroot_path"]+"/var/tmp/"+kname+".config", \ - "Couldn't copy kernel config: "+self.settings["boot/kernel/"+kname+"/config"]) + try: + cmd("cp "+self.settings["boot/kernel/"+kname+"/config"]+" "+ \ + self.settings["chroot_path"]+"/var/tmp/"+kname+".config", \ + "Couldn't copy kernel config: "+self.settings["boot/kernel/"+kname+"/config"]) - except CatalystError: - self.unbind() + except CatalystError: + self.unbind() - # If we need to pass special options to the bootloader - # for this kernel put them into the environment. - if self.settings.has_key("boot/kernel/"+kname+"/kernelopts"): - myopts=self.settings["boot/kernel/"+kname+"/kernelopts"] + # If we need to pass special options to the bootloader + # for this kernel put them into the environment. + if self.settings.has_key("boot/kernel/"+kname+"/kernelopts"): + myopts=self.settings["boot/kernel/"+kname+"/kernelopts"] - if type(myopts) != types.StringType: - myopts = string.join(myopts) - os.putenv(kname+"_kernelopts", myopts) + if type(myopts) != types.StringType: + myopts = string.join(myopts) + os.putenv(kname+"_kernelopts", myopts) - else: - os.putenv(kname+"_kernelopts", "") + else: + os.putenv(kname+"_kernelopts", "") - if not self.settings.has_key("boot/kernel/"+kname+"/extraversion"): - self.settings["boot/kernel/"+kname+"/extraversion"]="" + if not self.settings.has_key("boot/kernel/"+kname+"/extraversion"): + self.settings["boot/kernel/"+kname+"/extraversion"]="" - os.putenv("clst_kextraversion", self.settings["boot/kernel/"+kname+"/extraversion"]) - if self.settings.has_key("boot/kernel/"+kname+"/initramfs_overlay"): - if os.path.exists(self.settings["boot/kernel/"+kname+"/initramfs_overlay"]): - print "Copying initramfs_overlay dir " +self.settings["boot/kernel/"+kname+"/initramfs_overlay"] + os.putenv("clst_kextraversion", self.settings["boot/kernel/"+kname+"/extraversion"]) + if self.settings.has_key("boot/kernel/"+kname+"/initramfs_overlay"): + if os.path.exists(self.settings["boot/kernel/"+kname+"/initramfs_overlay"]): + print "Copying initramfs_overlay dir " +self.settings["boot/kernel/"+kname+"/initramfs_overlay"] - cmd("mkdir -p "+self.settings["chroot_path"]+"/tmp/initramfs_overlay/" + \ - self.settings["boot/kernel/"+kname+"/initramfs_overlay"]) + cmd("mkdir -p "+self.settings["chroot_path"]+"/tmp/initramfs_overlay/" + \ + self.settings["boot/kernel/"+kname+"/initramfs_overlay"]) - cmd("cp -R "+self.settings["boot/kernel/"+kname+"/initramfs_overlay"]+"/* " + \ - self.settings["chroot_path"] + "/tmp/initramfs_overlay/" + \ - self.settings["boot/kernel/"+kname+"/initramfs_overlay"]) + cmd("cp -R "+self.settings["boot/kernel/"+kname+"/initramfs_overlay"]+"/* " + \ + self.settings["chroot_path"] + "/tmp/initramfs_overlay/" + \ + self.settings["boot/kernel/"+kname+"/initramfs_overlay"]) - # execute the script that builds the kernel - cmd("/bin/bash "+self.settings["controller_file"]+" kernel "+kname,\ - "Runscript kernel build failed") + # execute the script that builds the kernel + cmd("/bin/bash "+self.settings["controller_file"]+" kernel "+kname,\ + "Runscript kernel build failed") - if self.settings.has_key("boot/kernel/"+kname+"/initramfs_overlay"): - if os.path.exists(self.settings["chroot_path"]+"/tmp/initramfs_overlay/"): - print "Cleaning up temporary overlay dir" - cmd("rm -R "+self.settings["chroot_path"]+"/tmp/initramfs_overlay/") + if self.settings.has_key("boot/kernel/"+kname+"/initramfs_overlay"): + if os.path.exists(self.settings["chroot_path"]+"/tmp/initramfs_overlay/"): + print "Cleaning up temporary overlay dir" + cmd("rm -R "+self.settings["chroot_path"]+"/tmp/initramfs_overlay/") + + touch(self.settings["autoresume_path"]+"build_kernel_"+kname) # execute the script that cleans up the kernel build environment cmd("/bin/bash "+self.settings["controller_file"]+" post-kmerge ",\ diff --git a/modules/livecd_stage1_target.py b/modules/livecd_stage1_target.py index 647a91d6..0147534d 100644 --- a/modules/livecd_stage1_target.py +++ b/modules/livecd_stage1_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.19 2005/11/29 18:44:39 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.20 2005/11/30 21:37:58 rocket Exp $ """ Builder class for LiveCD stage1. @@ -46,7 +46,7 @@ class livecd_stage1_target(generic_stage_target): def set_use(self): generic_stage_target.set_use(self) - self.settings["/use"].append("livecd") + self.settings["use"].append("livecd") def set_packages(self): generic_stage_target.set_packages(self)