From: John P. Davis Date: Fri, 18 Jun 2004 18:06:21 +0000 (+0000) Subject: check changelog X-Git-Tag: CATALYST_2_0_6_916~973 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6aa5090a8fc73726f618c85deb4b73082384d6e1;p=catalyst.git check changelog git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@400 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index a3ed84b4..7ddb5170 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,19 @@ # 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.65 2004/06/16 18:34:23 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.66 2004/06/18 18:06:21 zhen Exp $ + + 18 Jun 2004; John Davis catalyst, + modules/catalyst_support.py, modules/generic_stage_target.py, + targets/stage1/build.sh, targets/stage1/stage1-chroot.sh, + targets/stage2/stage2-chroot.sh, targets/stage3/stage3-chroot.sh: + stage resuming functionality should be working. I still have to work on GRP + and livecds, but they should not be hard. I could not incorporate emerge + --resume into stage resuming functionality because in some instances, portage + is remerged (bootstrap, stage2), which wipes out the resume data and puts + catalyst into an infinite portage merging loop (very unproductive, trust me ;) + ). I also made some small tweaks to the stage target scripts which clean up + the envscript stuff. Not noticable performance wise, but it makes me feel all + warm and fuzzy to know that it is programmed absolutely correctly ;) 16 Jun 2004; John Davis TODO, modules/catalyst_support.py, modules/generic_stage_target.py: diff --git a/catalyst b/catalyst index b3b17b93..ce59a3fb 100755 --- a/catalyst +++ b/catalyst @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.37 2004/06/13 15:18:49 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.38 2004/06/18 18:06:21 zhen Exp $ import os,sys,imp,string @@ -95,6 +95,10 @@ if "distcc" in string.split(myspec["options"]): print "Distcc support enabled." myspec["DISTCC"]="1" +if "autoresume" in string.split(myspec["options"]): + print "Autoresuming support enabled." + myspec["AUTORESUME"]="1" + if myconf.has_key("envscript"): print "Envscript support enabled." myspec["ENVSCRIPT"]=myconf["envscript"] diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index f78079e3..ae0fa88a 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.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/catalyst_support.py,v 1.23 2004/06/16 18:34:23 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.24 2004/06/18 18:06:21 zhen Exp $ import sys,string,os,types @@ -18,6 +18,7 @@ valid_config_file_values.append("PKGCACHE") valid_config_file_values.append("CCACHE") valid_config_file_values.append("DISTCC") valid_config_file_values.append("ENVSCRIPT") +valid_config_file_values.append("AUTORESUME") valid_config_file_values.append("options") verbosity=1 @@ -90,7 +91,7 @@ def cmd(mycmd,myexc=""): if retval != 0: raise CatalystError,myexc except KeyboardInterrupt: - raise CatalystError,"Build aborting due to user intervention" + raise CatalystError,"Caught SIGINT, aborting." def file_locate(settings,filelist,expand=1): #if expand=1, non-absolute paths will be accepted and diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 7f4cc449..ebf74822 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.3 2004/06/16 18:34:23 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.4 2004/06/18 18:06:21 zhen Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -147,11 +147,11 @@ class generic_stage_target(generic_target): def dir_setup(self): print "Setting up directories..." self.mount_safety_check() - if not os.path.exists(self.settings["chroot_path"]+"/tmp/unpacked"): - cmd("rm -rf "+self.settings["chroot_path"],"Could not remove existing directory: "+self.settings["chroot_path"]) - else: + if self.settings.has_key("AUTORESUME") and os.path.exists(self.settings["chroot_path"]+"/tmp/unpacked"): print "Directories previously setup, resuming..." - + else: + 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"]): os.makedirs(self.settings["chroot_path"]) if self.settings.has_key("PKGCACHE"): @@ -159,7 +159,9 @@ class generic_stage_target(generic_target): os.makedirs(self.settings["pkgcache_path"]) def unpack_and_bind(self): - if not os.path.exists(self.settings["chroot_path"]+"/tmp/unpacked"): + if self.settings.has_key("AUTORESUME") and os.path.exists(self.settings["chroot_path"]+"/tmp/unpacked"): + print "CHROOT previously unpacked and bind mounted, resuming..." + else: 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"): @@ -171,9 +173,7 @@ class generic_stage_target(generic_target): cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.profile","Error zapping profile link") cmd("ln -sf ../usr/portage/profiles/"+self.settings["target_profile"]+" "+self.settings["chroot_path"]+"/etc/make.profile","Error creating profile link") touch(self.settings["chroot_path"]+"/tmp/unpacked") - else: - print "CHROOT previously unpacked and bind mounted, resuming..." - + for x in self.mounts: if not os.path.exists(self.settings["chroot_path"]+x): os.makedirs(self.settings["chroot_path"]+x) @@ -208,49 +208,47 @@ class generic_stage_target(generic_target): raise CatalystError,"Couldn't umount one or more bind-mounts; aborting for safety." def chroot_setup(self): - if not os.path.exists(self.settings["chroot_path"]+"/tmp/chroot_setup"): - cmd("cp /etc/resolv.conf "+self.settings["chroot_path"]+"/etc","Could not copy resolv.conf into place.") - if self.settings.has_key("ENVSCRIPT"): - if not os.path.exists(self.settings["ENVSCRIPT"]): - raise CatalystError, "Can't find envscript "+self.settings["ENVSCRIPT"] - cmd("cp "+self.settings["ENVSCRIPT"]+" "+self.settings["chroot_path"]+"/tmp/envscript","Could not copy envscript into place.") - cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.conf") - - myf=open(self.settings["chroot_path"]+"/etc/make.conf","w") - myf.write("# These settings were set by the catalyst build script that automatically built this stage\n") - myf.write("# Please consult /etc/make.conf.example for a more detailed example\n") - myf.write('CFLAGS="'+self.settings["CFLAGS"]+'"\n') - myf.write('CHOST="'+self.settings["CHOST"]+'"\n') - myusevars=[] - if self.settings.has_key("HOSTUSE"): - myusevars.extend(self.settings["HOSTUSE"]) - if self.settings["target"]=="grp": - myusevars.append("bindist") - myusevars.extend(self.settings["grp/use"]) - myf.write('USE="'+string.join(myusevars)+'"\n') - elif self.settings["target"]=="tinderbox": - myusevars.extend(self.settings["tinderbox/use"]) - myf.write('USE="'+string.join(myusevars)+'"\n') - elif self.settings["target"]=="livecd-stage1": - myusevars.extend(self.settings["livecd/use"]) - myf.write('USE="'+string.join(myusevars)+'"\n') - elif self.settings["target"]=="embedded": - myusevars.extend(self.settings["embedded/use"]) - myf.write('USE="'+string.join(myusevars)+'"\n') - if self.settings.has_key("CXXFLAGS"): - myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n') - else: - myf.write('CXXFLAGS="${CFLAGS}"\n') - myf.close() + print "Setting up chroot..." + cmd("cp /etc/resolv.conf "+self.settings["chroot_path"]+"/etc","Could not copy resolv.conf into place.") + if self.settings.has_key("ENVSCRIPT"): + if not os.path.exists(self.settings["ENVSCRIPT"]): + raise CatalystError, "Can't find envscript "+self.settings["ENVSCRIPT"] + cmd("cp "+self.settings["ENVSCRIPT"]+" "+self.settings["chroot_path"]+"/tmp/envscript","Could not copy envscript into place.") + cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.conf") - #create entry in /etc/passwd for distcc user - if self.settings.has_key("DISTCC"): - myf=open(self.settings["chroot_path"]+"/etc/passwd","a") - myf.write("distcc:x:7980:2:distccd:/dev/null:/bin/false\n") - myf.close() - touch(self.settings["chroot_path"]+"/tmp/chroot_setup") + myf=open(self.settings["chroot_path"]+"/etc/make.conf","w") + myf.write("# These settings were set by the catalyst build script that automatically built this stage\n") + myf.write("# Please consult /etc/make.conf.example for a more detailed example\n") + myf.write('CFLAGS="'+self.settings["CFLAGS"]+'"\n') + myf.write('CHOST="'+self.settings["CHOST"]+'"\n') + myusevars=[] + if self.settings.has_key("HOSTUSE"): + myusevars.extend(self.settings["HOSTUSE"]) + if self.settings["target"]=="grp": + myusevars.append("bindist") + myusevars.extend(self.settings["grp/use"]) + myf.write('USE="'+string.join(myusevars)+'"\n') + elif self.settings["target"]=="tinderbox": + myusevars.extend(self.settings["tinderbox/use"]) + myf.write('USE="'+string.join(myusevars)+'"\n') + elif self.settings["target"]=="livecd-stage1": + myusevars.extend(self.settings["livecd/use"]) + myf.write('USE="'+string.join(myusevars)+'"\n') + elif self.settings["target"]=="embedded": + myusevars.extend(self.settings["embedded/use"]) + myf.write('USE="'+string.join(myusevars)+'"\n') + if self.settings.has_key("CXXFLAGS"): + myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n') else: - print "CHROOT previously setup, resuming..." + myf.write('CXXFLAGS="${CFLAGS}"\n') + myf.close() + + #create entry in /etc/passwd for distcc user + if self.settings.has_key("DISTCC"): + myf=open(self.settings["chroot_path"]+"/etc/passwd","a") + myf.write("distcc:x:7980:2:distccd:/dev/null:/bin/false\n") + myf.close() + touch(self.settings["chroot_path"]+"/tmp/chroot_setup") def clean(self): destpath=self.settings["chroot_path"] diff --git a/targets/stage1/build.sh b/targets/stage1/build.sh index 2513dbb3..c589d010 100755 --- a/targets/stage1/build.sh +++ b/targets/stage1/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/build.sh,v 1.6 2004/03/30 19:45:14 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/build.sh,v 1.7 2004/06/18 18:06:21 zhen Exp $ for x in `cat /etc/make.profile/packages.build | grep -v '^#'` do diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 931b7db4..9fbcd99b 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,21 +1,17 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.16 2004/06/04 14:03:46 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.17 2004/06/18 18:06:21 zhen Exp $ /usr/sbin/env-update source /etc/profile -if [ -f /tmp/envscript ] -then - source /tmp/envscript - rm -f /tmp/envscript -fi +[ -f /tmp/envscript ] && source /tmp/envscript if [ -n "${clst_CCACHE}" ] then export clst_myfeatures="${clst_myfeatures} ccache" - emerge --oneshot --nodeps ccache || exit 1 + emerge -b -k --oneshot --nodeps ccache || exit 1 fi if [ -n "${clst_DISTCC}" ] @@ -23,15 +19,21 @@ then export clst_myfeatures="${clst_myfeatures} distcc" export DISTCC_HOSTS="${clst_distcc_hosts}" - USE="-gtk -gnome" emerge --oneshot --nodeps distcc || exit 1 + USE="-gtk -gnome" emerge -b -k --oneshot --nodeps distcc || exit 1 /usr/bin/distcc-config --install 2>&1 > /dev/null /usr/bin/distccd 2>&1 > /dev/null fi if [ -n "${clst_PKGCACHE}" ] then - export clst_myemergeopts="--usepkg --buildpkg" + export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg" fi + +# broken, need to figure out how to avoid a portage infinite loop +#if [ -n "${clst_AUTORESUME}" ] && [ -e /tmp/build.log ] +#then +# export clst_myemergeopts="${clst_myemergeopts} --resume" +#fi # setup our environment export FEATURES="${clst_myfeatures}" @@ -46,54 +48,3 @@ do done USE="-* build" emerge ${clst_myemergeopts} --noreplace ${clst_buildpkgs} || exit 1 - -# if baselayout did not fix up /dev, we do it -# THIS SHOULD BE TEMPORARY CODE - NOT A SOLUTION -if [ ! -d ${ROOT}/dev ] -then - case ${clst_mainarch} in - x86) - clst_devtype=i386 - ;; - ppc) - clst_devtype=powerpc - ;; - ppc64) - clst_devtype=powerpc - ;; - sparc) - clst_devtype=sparc - ;; - sparc64) - clst_devtype=sparc - ;; - alpha) - clst_devtype=alpha - ;; - s390) - clst_devtype=s390 - ;; - amd64) - clst_devtype=i386 - ;; - hppa) - clst_devtype=hppa - ;; - ia64) - clst_devtype=ia64 - ;; - mips) - clst_devtype=mips - ;; - arm) - clst_devtype=arm - ;; - *) - echo "!!! Catalyst mainarch ${clst_mainarch} not supported" && exit 1 - ;; - esac - - mkdir -p ${ROOT}/dev - cd ${ROOT}/dev - MAKEDEV generic-${clst_devtype} -fi diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index 931404bf..ddcfd0f9 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -1,21 +1,17 @@ #!/bin/sh # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.3 2004/06/04 14:03:46 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.4 2004/06/18 18:06:21 zhen Exp $ /usr/sbin/env-update source /etc/profile -if [ -f /tmp/envscript ] -then - source /tmp/envscript - rm -f /tmp/envscript -fi +[ -f /tmp/envscript ] && source /tmp/envscript if [ -n "${clst_CCACHE}" ] then export clst_myfeatures="${clst_myfeatures} ccache" - emerge --oneshot --nodeps ccache || exit 1 + emerge -b -k --oneshot --nodeps ccache || exit 1 fi if [ -n "${clst_DISTCC}" ] @@ -23,7 +19,7 @@ then export clst_myfeatures="${clst_myfeatures} distcc" export DISTCC_HOSTS="${clst_distcc_hosts}" - USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1 + USE="-gnome -gtk" emerge -b -k --oneshot --nodeps distcc || exit 1 /usr/bin/distcc-config --install 2>&1 > /dev/null /usr/bin/distccd 2>&1 > /dev/null fi diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index 68f9b7ba..f3306e68 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -1,21 +1,17 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.4 2004/06/04 14:03:46 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.5 2004/06/18 18:06:21 zhen Exp $ /usr/sbin/env-update source /etc/profile -if [ -f /tmp/envscript ] -then - source /tmp/envscript - rm -f /tmp/envscript -fi +[ -f /tmp/envscript ] && source /tmp/envscript if [ -n "${clst_CCACHE}" ] then export clst_myfeatures="${clst_myfeatures} ccache" - emerge --oneshot --nodeps ccache || exit 1 + emerge -b -k --oneshot --nodeps ccache || exit 1 fi if [ -n "${clst_DISTCC}" ] @@ -23,7 +19,7 @@ then export clst_myfeatures="${clst_myfeatures} distcc" export DISTCC_HOSTS="${clst_distcc_hosts}" - USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1 + USE="-gnome -gtk" emerge -b -k --oneshot --nodeps distcc || exit 1 /usr/bin/distcc-config --install 2>&1 > /dev/null /usr/bin/distccd 2>&1 > /dev/null fi