check changelog
authorJohn P. Davis <zhen@gentoo.org>
Fri, 18 Jun 2004 18:06:21 +0000 (18:06 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Fri, 18 Jun 2004 18:06:21 +0000 (18:06 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@400 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
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

index a3ed84b4416b05ef343d7739f10dc007dd5d0576..7ddb51703c2232337c8185f8c0b005305866b9e9 100644 (file)
--- 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 <zhen@gentoo.org> 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 <zhen@gentoo.org> TODO, modules/catalyst_support.py,
   modules/generic_stage_target.py:
index b3b17b935bc0e652496fa4468328c0280f828c77..ce59a3fb6575182e1d32f39f90e6a65f256f7437 100755 (executable)
--- 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"]
index f78079e340db8afd01381bc9719875ac249adbf3..ae0fa88a44bb9a1cbe962db867a58d73980631be 100644 (file)
@@ -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
index 7f4cc4498f9efa47d2cb8d52229c8ce08226977d..ebf74822c2657fad028fa94c07c957b8e3a6db2e 100644 (file)
@@ -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"]
index 2513dbb328afde1d1d6c5c7c7a50966a71bd57e4..c589d010b5007c52414ba5d3519c73f384995fe2 100755 (executable)
@@ -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
index 931b7db4a6e6a729f5f1c17b444e6d738bed61ea..9fbcd99b352177620d53617080b77a2b419085c9 100755 (executable)
@@ -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
index 931404bfcb8ff720bf7e3fcde7a7d8283ff1046a..ddcfd0f969ab7cc913f4b5ff21a1bcf2f7002590 100755 (executable)
@@ -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
index 68f9b7bade6fd51fba1021b34af4e645220d45a6..f3306e684d0585d504efaa2aad778d88d01c6aaa 100755 (executable)
@@ -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