Fix some exception handling in catalyst_support.py
authorEric Edgar <rocket@gentoo.org>
Wed, 27 Apr 2005 17:44:58 +0000 (17:44 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 27 Apr 2005 17:44:58 +0000 (17:44 +0000)
remove intermediate destination folder of iso and tarball
Add additional tests for folders not found on host but defined
        in spec file.  Keep catalyst from erroring in this case.
Change exit code on shell scripts so that errors are reported to catalyst
        and causes catalyst to die on errors
Fix bug in livecd-stage1-chroot.sh so that it uses USE flags properly
Added additional check for mkisofs.  Informs user of where to get the program.
Removed autoresume code from ccache and distcc installation until I can figure
        out a way to have the autoresume flag go someplace outside the chroot.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@628 d1e1f19c-881f-0410-ab34-b69fee027534

22 files changed:
ChangeLog
modules/catalyst_support.py
modules/generic_stage_target.py
modules/livecd_stage1_target.py
modules/livecd_stage2_target.py
modules/snapshot_target.py
targets/embedded/embedded-controller.sh
targets/grp/grp-controller.sh
targets/livecd-stage1/livecd-stage1-chroot.sh
targets/livecd-stage1/livecd-stage1-controller.sh
targets/livecd-stage2/livecd-stage2-controller.sh
targets/netboot/netboot-controller.sh
targets/stage1/stage1-controller.sh
targets/stage2/stage2-controller.sh
targets/stage3/stage3-controller.sh
targets/stage4/stage4-controller.sh
targets/support/bootloader-setup.sh
targets/support/chroot-functions.sh
targets/support/create-iso.sh
targets/support/kmerge.sh
targets/support/target_image_setup.sh
targets/tinderbox/tinderbox-controller.sh

index 7d0fbe755e56ac8748536285f155f31a5296e4f0..7e9745065abcebf75994ec519d586200ab5a0898 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.240 2005/04/26 18:30:50 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.241 2005/04/27 17:44:58 rocket Exp $
+
+  27 Apr 2005; Eric Edgar <rocket@gentoo.org> modules/catalyst_support.py,
+  modules/generic_stage_target.py, modules/livecd_stage1_target.py,
+  modules/livecd_stage2_target.py, modules/snapshot_target.py,
+  targets/embedded/embedded-controller.sh, targets/grp/grp-controller.sh,
+  targets/livecd-stage1/livecd-stage1-chroot.sh,
+  targets/livecd-stage1/livecd-stage1-controller.sh,
+  targets/livecd-stage2/livecd-stage2-controller.sh,
+  targets/netboot/netboot-controller.sh,
+  targets/stage1/stage1-controller.sh, targets/stage2/stage2-controller.sh,
+  targets/stage3/stage3-controller.sh, targets/stage4/stage4-controller.sh,
+  targets/support/bootloader-setup.sh, targets/support/chroot-functions.sh,
+  targets/support/create-iso.sh, targets/support/kmerge.sh,
+  targets/support/target_image_setup.sh,
+  targets/tinderbox/tinderbox-controller.sh:
+  Fix some exception handling in catalyst_support.py
+  remove intermediate destination folder of iso and tarball
+  Add additional tests for folders not found on host but defined
+          in spec file.  Keep catalyst from erroring in this case.
+  Change exit code on shell scripts so that errors are reported to catalyst
+          and causes catalyst to die on errors
+  Fix bug in livecd-stage1-chroot.sh so that it uses USE flags properly
+  Added additional check for mkisofs.  Informs user of where to get the program.
+  Removed autoresume code from ccache and distcc installation until I can figure
+          out a way to have the autoresume flag go someplace outside the chroot.
 
   26 Apr 2005; Eric Edgar <rocket@gentoo.org> catalyst:
   Remove bind mounts before rm operations happen at startup
index 89a69ca4b58d7caefd6e00c3908398711f7586f2..47af6accbf98e43c790fdccc368e2a1f10d7be94 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.43 2005/04/26 14:58:04 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.44 2005/04/27 17:44:58 rocket Exp $
 
 import sys,string,os,types,re,signal,traceback,md5,time
 # a function to turn a string of non-printable characters into a string of
@@ -137,17 +137,17 @@ def spawn(mystring,debug=0,fd_pipes=None):
                return # should never get reached
        try:
                retval=os.waitpid(mypid,0)[1]
+               if (retval & 0xff)==0:
+                       return (retval >> 8) # return exit code
+               else:
+                       return ((retval & 0xff) << 8) # interrupted by signal
+       
        except:
                os.kill(mypid,signal.SIGTERM)
                if os.waitpid(mypid,os.WNOHANG)[1] == 0:
                # feisty bugger, still alive.
                        os.kill(mypid,signal.SIGKILL)
 
-       if (retval & 0xff)==0:
-               return (retval >> 8) # return exit code
-       else:
-               return ((retval & 0xff) << 8) # interrupted by signal
-       
 
 def cmd(mycmd,myexc=""):
        try:
index 445e2667c5e680eba40b32e3abc5d4a7b0b4ccb5..e9ac5b38e969862eead107a0d9ef1e113da10113 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 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.40 2005/04/26 18:28:26 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.41 2005/04/27 17:44:58 rocket Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -104,10 +104,10 @@ class generic_stage_target(generic_target):
                self.set_target_subpath()
        
                # set paths
-               self.set_autoresume_path()
                self.set_snapshot_path()
                self.set_source_path()
                self.set_chroot_path()
+               self.set_autoresume_path()
                self.set_root_path()
                self.set_dest_path()
                self.set_stage_path()
@@ -128,8 +128,6 @@ class generic_stage_target(generic_target):
                self.set_fsops()
                self.set_iso()
                self.set_packages()
-               self.set_target_file()
-               self.set_target_iso_path()
                
 
                # this next line checks to make sure that the specified variables exist on disk.
@@ -208,32 +206,20 @@ class generic_stage_target(generic_target):
                        "-"+self.settings["subarch"]+"-"+self.settings["version_stamp"]
 
        def set_target_path(self):
-               self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
+               self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+".tar.bz2"
                if self.settings.has_key("AUTORESUME") \
                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
                        print "Resume point detected, skipping target path setup operation..."
                else:
                        # first clean up any existing target stuff
-                       if os.path.exists(self.settings["target_path"]):
-                               cmd("rm -rf "+self.settings["target_path"],
-                                       "Could not remove existing directory: "+self.settings["target_path"])
-                       touch(self.settings["autoresume_path"]+"setup_target_path")
+                       if os.path.isfile(self.settings["target_path"]):
+                               cmd("rm -f "+self.settings["target_path"],
+                                       "Could not remove existing file: "+self.settings["target_path"])
+                               touch(self.settings["autoresume_path"]+"setup_target_path")
                
-               if not os.path.exists(self.settings["target_path"]):
-                       os.makedirs(self.settings["target_path"])
-       
-       def set_target_file(self):
-               if not os.path.exists(self.settings["target_path"]+"/tarball/"):
-                       os.makedirs(self.settings["target_path"]+"/tarball/")
-               self.settings["target_file"]=self.settings["target_path"]+"/tarball/"+self.settings["target"]+"-"+self.settings["subarch"]+"-"+self.settings["version_stamp"]+".tar.bz2"
+                       if not os.path.exists(self.settings["storedir"]+"/builds/"):
+                               os.makedirs(self.settings["storedir"]+"/builds/")
        
-       def set_target_iso_path(self):
-               if self.settings.has_key("iso"):
-                       print "setting up iso path"
-                       if not os.path.exists(self.settings["target_path"]+"/iso/"):
-                               os.makedirs(self.settings["target_path"]+"/iso/")
-                       self.settings["target_iso_path"]=self.settings["target_path"]+"/iso/"
-
        def set_fsscript(self): 
                if self.settings.has_key(self.settings["spec_prefix"]+"/fsscript"):
                        self.settings["fsscript"]=self.settings[self.settings["spec_prefix"]+"/fsscript"]
@@ -305,7 +291,7 @@ class generic_stage_target(generic_target):
                    self.settings["snapshot_path_md5sum"]=calc_md5(self.settings["snapshot_path"])
        
        def set_chroot_path(self):
-               self.settings["chroot_path"]=self.settings["storedir"]+"/tmp/"+self.settings["target_subpath"]
+               self.settings["chroot_path"]=self.settings["storedir"]+"/tmp/"+self.settings["target_subpath"]+"/"
        
        def set_autoresume_path(self):
                self.settings["autoresume_path"]=self.settings["storedir"]+"/tmp/"+self.settings["rel_type"]+"/"+\
@@ -753,7 +739,7 @@ class generic_stage_target(generic_target):
 
                print "Creating stage tarball..."
                
-               cmd("tar cjf "+self.settings["target_file"]+" -C "+self.settings["stage_path"]+\
+               cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["stage_path"]+\
                        " .","Couldn't create stage tarball")
                touch(self.settings["autoresume_path"]+"capture")
 
@@ -807,10 +793,8 @@ class generic_stage_target(generic_target):
                    print "Resume point detected, skipping unmerge operation..."
            else:
                if self.settings.has_key(self.settings["spec_prefix"]+"/unmerge"):
-                   print "has key unmerge"
                    if type(self.settings[self.settings["spec_prefix"]+"/unmerge"])==types.StringType:
                        self.settings[self.settings["spec_prefix"]+"/unmerge"]=[self.settings[self.settings["spec_prefix"]+"/unmerge"]]
-                       print "key is a string"
                    myunmerge=self.settings[self.settings["spec_prefix"]+"/unmerge"][:]
                    
                    for x in range(0,len(myunmerge)):
@@ -835,7 +819,7 @@ class generic_stage_target(generic_target):
                    print "Resume point detected, skipping target_setup operation..."
            else:
                print "Setting up filesystems per filesystem type"
-               cmd("/bin/bash "+self.settings["controller_file"]+" target_image_setup "+ self.settings["target_iso_path"],"target_image_setup script failed.")
+               cmd("/bin/bash "+self.settings["controller_file"]+" target_image_setup "+ self.settings["target_path"],"target_image_setup script failed.")
                touch(self.settings["autoresume_path"]+"target_setup")
        
        def setup_overlay(self):        
@@ -843,10 +827,11 @@ class generic_stage_target(generic_target):
                and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"):
                    print "Resume point detected, skipping setup_overlay operation..."
            else:
-               if self.settings.has_key(self.settings["spec_prefix"]+"/overlay"):
-                       cmd("rsync -a "+self.settings[self.settings["spec_prefix"]+"/overlay"]+"/* "+\
-                       self.settings["target_iso_path"], self.settings["spec_prefix"]+"overlay copy failed.")
-               touch(self.settings["autoresume_path"]+"setup_overlay")
+               if self.settings.has_key(self.settings["spec_prefix"]+"/overlay") \
+                       and os.path.exists(self.settings["spec_prefix"]+"/overlay"):
+                               cmd("rsync -a "+self.settings[self.settings["spec_prefix"]+"/overlay"]+"/* "+\
+                               self.settings["target_path"], self.settings["spec_prefix"]+"overlay copy failed.")
+                               touch(self.settings["autoresume_path"]+"setup_overlay")
        
        def create_iso(self):
            if self.settings.has_key("AUTORESUME") \
@@ -940,6 +925,7 @@ class generic_stage_target(generic_target):
                                        "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/")
 
@@ -955,7 +941,7 @@ class generic_stage_target(generic_target):
                    print "Resume point detected, skipping bootloader operation..."
            else:
                try:
-                       cmd("/bin/bash "+self.settings["controller_file"]+" bootloader " + self.settings["target_iso_path"],\
+                       cmd("/bin/bash "+self.settings["controller_file"]+" bootloader " + self.settings["target_path"],\
                                "Bootloader runscript failed.")
                        touch(self.settings["autoresume_path"]+"bootloader")
                except CatalystError:
@@ -985,8 +971,11 @@ class generic_stage_target(generic_target):
                    # stat the dir, delete the dir, recreate the dir and set
                    # the proper perms and ownership
                    mystat=os.stat(myemp)
+                   #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp)
                    shutil.rmtree(myemp)
                    os.makedirs(myemp,0755)
+                   os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+                   os.chmod(myemp,mystat[ST_MODE])
        
        def clear_packages(self):
            if self.settings.has_key("PKGCACHE"):
@@ -1000,9 +989,13 @@ class generic_stage_target(generic_target):
                    # stat the dir, delete the dir, recreate the dir and set
                    # the proper perms and ownership
                    mystat=os.stat(myemp)
+                   #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp)
                    shutil.rmtree(myemp)
                    os.makedirs(myemp,0755)
-        def clear_autoresume(self):
+                   os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+                   os.chmod(myemp,mystat[ST_MODE])
+        
+       def clear_autoresume(self):
                # clean resume points since they are no longer needed
                if self.settings.has_key("AUTORESUME"):
                        print "Removing AutoResume Points: ..."
@@ -1014,8 +1007,11 @@ class generic_stage_target(generic_target):
                                # stat the dir, delete the dir, recreate the dir and set
                                # the proper perms and ownership
                                mystat=os.stat(myemp)
+                               #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp)
                                shutil.rmtree(myemp)
                                os.makedirs(myemp,0755)
+                               os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+                               os.chmod(myemp,mystat[ST_MODE])
 
        def purge(self):
            countdown(10,"Purging Caches ...")
index eb83f6f833ccdf9a75cac13b7ff72698fc9fef77..3fae838671181c40366dfa10acb9b6c85b2b5e90 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 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.11 2005/04/21 14:45:09 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.12 2005/04/27 17:44:58 rocket Exp $
 
 """
 Builder class for LiveCD stage1.
@@ -20,8 +20,25 @@ class livecd_stage1_target(generic_stage_target):
                                        "config_profile_link","setup_confdir","portage_overlay",\
                                        "bind","chroot_setup","setup_environment","build_packages",\
                                        "unbind", "clean","clear_autoresume"]
-
-        def set_spec_prefix(self):
+        def set_target_path(self):
+               self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
+               if self.settings.has_key("AUTORESUME") \
+                       and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
+                               print "Resume point detected, skipping target path setup operation..."
+               else:
+                       # first clean up any existing target stuff
+                       if os.path.exists(self.settings["target_path"]):
+                               cmd("rm -rf "+self.settings["target_path"],\
+                                       "Could not remove existing directory: "+self.settings["target_path"])
+                               touch(self.settings["autoresume_path"]+"setup_target_path")
+                       
+                       if not os.path.exists(self.settings["target_path"]):
+                               os.makedirs(self.settings["target_path"])
+        
+       
+       def set_target_path(self):
+               pass
+       def set_spec_prefix(self):
                        self.settings["spec_prefix"]="livecd"
        
        def set_packages(self):
index f6cb191f4cf1e7ead1bfb92407219e011faa6ec7..890803692ac28a4f7cd4f1b5ad9ea06ad7474f38 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.37 2005/04/22 18:33:06 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.38 2005/04/27 17:44:58 rocket Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -42,7 +42,20 @@ class livecd_stage2_target(generic_stage_target):
        def set_spec_prefix(self):
            self.settings["spec_prefix"]="livecd"
 
-               
+       def set_target_path(self):
+               self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
+               if self.settings.has_key("AUTORESUME") \
+                       and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
+                               print "Resume point detected, skipping target path setup operation..."
+               else:
+                       # first clean up any existing target stuff
+                       if os.path.isdir(self.settings["target_path"]):
+                               cmd("rm -rf "+self.settings["target_path"],
+                               "Could not remove existing directory: "+self.settings["target_path"])
+                               touch(self.settings["autoresume_path"]+"setup_target_path")
+                       if not os.path.exists(self.settings["target_path"]):
+                               os.makedirs(self.settings["target_path"])
+
        def unpack(self):
                if not os.path.isdir(self.settings["source_path"]):
                        generic_stage_target.unpack(self)
index 37a11393b539fc8ee43a67610bf0a532b851046d..e19bf3e302a3cb68db8ebfe2668c6b9592eb10d9 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.8 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.9 2005/04/27 17:44:58 rocket Exp $
 
 """
 Builder class for snapshots.
@@ -27,7 +27,10 @@ class snapshot_target(generic_target):
                x=self.settings["storedir"]+"/snapshots"
                if not os.path.exists(x):
                        os.makedirs(x)
-
+       
+       def mount_safety_check(self):
+               pass
+               
        def run(self):
                self.setup()
                print "Creating Portage tree snapshot "+self.settings["version_stamp"]+\
index 0008390b7748014d46196e63c9b2727758c57d6a..384347848b5e0c40528bba4bcd25905b965673fb 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/embedded/embedded-controller.sh,v 1.2 2005/04/21 14:23:11 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-controller.sh,v 1.3 2005/04/27 17:44:58 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
@@ -69,4 +69,4 @@ case $1 in
        ;;
 
 esac
-exit 0
+exit $?
index 1465621bdac6cf4ac56477801218418828af0161..4700390a52e503692aeca630e860da24a1585f30 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-controller.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-controller.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 case $1 in
@@ -21,7 +21,6 @@ case $1 in
 
        preclean)
                exec_in_chroot ${clst_sharedir}/targets/grp/grp-preclean-chroot.sh
-               exit 0
        ;;
 
        clean)
@@ -33,4 +32,4 @@ case $1 in
        ;;
 
 esac
-exit 0
+exit $?
index fffe66c623ebc9c0246276b17070d58b929d4e51..392e8a5d65df700dafb7946c59a59889c74e295f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.16 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.17 2005/04/27 17:44:58 rocket Exp $
 
 . /tmp/chroot-functions.sh
 
@@ -21,5 +21,6 @@ setup_portage
 
 #turn off auto-use:
 export USE_ORDER="env:pkg:conf:defaults"       
+export USE="${clst_livecd_use}"
 
 run_emerge "${clst_packages}"
index 4060da14f9551e0821c3f4c60970c6106ffe06bd..b176a3cc23c0a9cfdd5f0bd252b2fb8f261ccf87 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.6 2005/04/21 14:23:11 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.7 2005/04/27 17:44:58 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 
@@ -17,4 +17,4 @@ case $1 in
                find ${clst_chroot_path}/usr/lib -iname "*.pyc" -exec rm -f {} \;
                ;;
 esac
-exit 
+exit $?
index f4a27857070df3ca8c404bcfdbce0bde3adab5da..c50aafb310ac4e2768f0d894b4dcc3e17c3949f9 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.8 2005/04/21 14:23:11 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.9 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -98,4 +98,4 @@ case $1 in
                ${clst_sharedir}/targets/support/create-iso.sh $1
                ;;
 esac
-exit 
+exit $?
index ea6ef36bdb6430c7657ffb6e7342adf1e02fe5f8..19b1987ee14719ec20c6cd47f8f2238a79e42e3e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-controller.sh,v 1.1 2005/04/04 17:50:30 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-controller.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -72,4 +72,4 @@ case ${1} in
                exit 1;;
 esac
 
-exit 0
+exit $?
index 5a2de7fbaa5b45ba6285d805ef913be7bf8a6407..a0192775b3a34a425341e78522f09cc78ee96090 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-controller.sh,v 1.2 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-controller.sh,v 1.3 2005/04/27 17:44:58 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 
@@ -42,5 +42,5 @@ case $1 in
        ;;
 
 esac
-exit 0
+exit $?
 
index 248e3ba25e3f7dd4ff8c546f3b040cff42ca6306..a714dafdb5b250932c7f57d222ceb10a1754c117 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-controller.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-controller.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 
@@ -32,4 +32,4 @@ case $1 in
 
 esac
 
-exit 0
+exit $?
index 1eb2554890c52df71e02b95f11721bd3331ab3f0..e4689f7b228cc3a66864eaff6d1a4b7bd550154f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-controller.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-controller.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 
@@ -32,4 +32,4 @@ case $1 in
 
 esac
 
-exit 0
+exit $?
index cbee6e6c4c57b5eb85aab4915ed3e8658e3d1ae4..324178c5d0a7a4b0955e53c9db35c58ed3602f87 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.3 2005/04/21 14:23:11 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.4 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 
@@ -73,4 +73,4 @@ case $1 in
 
 esac
 
-exit 0
+exit $?
index fdc5268582a08d5290160ef307329b33b67f5319..606e4a2bc929f01faffcd260bcbc7615c5c400e6 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.1 2005/04/21 14:23:12 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -185,4 +185,4 @@ case ${clst_mainarch} in
                fi
                ;;
 esac
-exit 
+exit $?
index aaa3d9160ee946c90898c5331917d7567d453245..6c9ff15d46cadb878b358e95ee973f199255aaef 100755 (executable)
@@ -52,25 +52,26 @@ setup_myfeatures(){
        if [ -n "${clst_CCACHE}" ]
        then
                export clst_myfeatures="${clst_myfeatures} ccache"
-               if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_ccache ]
-               then
-                   echo "CCACHE Autoresume point found not emerging ccache"
-               else
-                   emerge --oneshot --nodeps -b -k ccache && touch /tmp/.clst_ccache || exit 1
-                   touch /tmp/.clst_ccache
-               fi
+               #if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_ccache ]
+               #then
+               #    echo "CCACHE Autoresume point found not emerging ccache"
+               #else
+                   emerge --oneshot --nodeps -b -k ccache || exit 1
+               #    touch /tmp/.clst_ccache
+               #fi
        fi
 
        if [ -n "${clst_DISTCC}" ]
        then
                export clst_myfeatures="${clst_myfeatures} distcc"
                export DISTCC_HOSTS="${clst_distcc_hosts}"
-               if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_distcc ]
-               then
-                   echo "DISTCC Autoresume point found not emerging distcc"
-               else
-                   USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc && touch /tmp/.clst_distcc || exit 1 
-               fi
+               #if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_distcc ]
+               #then
+               #    echo "DISTCC Autoresume point found not emerging distcc"
+               #else
+                   USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
+                   #touch /tmp/.clst_distcc
+               #fi
        fi
 }
 
index d5c224f99816187c86e7f9af9d3630e23334a0b3..4f19c18a96b4aef7e40d16f733b4c6c82c207c82 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.1 2005/04/21 14:23:12 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 #. ${clst_sharedir}/targets/${clst_target}/${clst_mainarch}-archscript.sh
@@ -8,16 +8,25 @@
 #source ${clst_livecd_archscript}
 ## START RUNSCRIPT
 
+if [ ! -f /usr/bin/mkisofs ]
+then
+       echo
+       echo
+       die "        /usr/bin/mkisofs is not found.  Have you merged cdrtools?"
+       echo
+       echo
+fi
+
 case ${clst_mainarch} in
        alpha)
                # this is for the livecd-final target, and calls the proper
                # command to build the iso file
                case ${clst_fstype} in
                        zisofs)
-                               mkisofs -J -R -l -z -V "${clst_iso_volume_id}" -o ${1} ${clst_target_iso_path}  || die "Cannot make ISO image"
+                               mkisofs -J -R -l -z -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}  || die "Cannot make ISO image"
                        ;;
                        *)
-                               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} ${clst_target_iso_path} || die "Cannot make ISO image"
+                               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path} || die "Cannot make ISO image"
                        ;;
                esac
                isomarkboot ${1} /boot/bootlx
@@ -27,19 +36,19 @@ case ${clst_mainarch} in
                ;;
        hppa)
                 #this is for the livecd-stage2 target, and calls the proper command to build the iso file
-               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o  ${1} ${clst_target_iso_path}  || die "Cannot make ISO image"
+               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o  ${1} ${clst_target_path}  || die "Cannot make ISO image"
                palo -f boot/palo.conf -C ${1}
 
        ;;
        ppc)
                # The name of the iso should be retrieved from the specs. For now, asssume GentooPPC_2004.0
-               mkisofs -J -r -l -netatalk -hfs -probe -map ${clst_target_iso_path}/boot/map.hfs -part -no-desktop -hfs-iso_volume_id \
-                       "${clst_iso_volume_id}" -hfs-bless ${clst_target_iso_path}/boot -V "${clst_iso_volume_id}" -o ${1} ${clst_target_iso_path}
+               mkisofs -J -r -l -netatalk -hfs -probe -map ${clst_target_path}/boot/map.hfs -part -no-desktop -hfs-iso_volume_id \
+                       "${clst_iso_volume_id}" -hfs-bless ${clst_target_path}/boot -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}
        ;;
        sparc)
                # this is for the livecd-final target, and calls the proper
                # command to build the iso file
-               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -G ${clst_target_iso_path}/boot/isofs.b -B ... ${clst_target_iso_path} \
+               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -G ${clst_target_path}/boot/isofs.b -B ... ${clst_target_path} \
                        || die "Cannot make ISO image"
 
        ;;
@@ -48,11 +57,11 @@ case ${clst_mainarch} in
                # Only silo 1.2.x seems to work for most hardware
                # Seems silo 1.3.x+ breaks on newer machines
                # when booting from CD (current as of silo 1.4.8)
-               mv ${clst_target_iso_path}/boot/mkisofs.sparc.fu /tmp 
+               mv ${clst_target_path}/boot/mkisofs.sparc.fu /tmp 
                /tmp/mkisofs.sparc.fu -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' \
                -s '/boot/silo.conf' -abstract 'Gentoo Linux Sparc' -copyright 'Gentoo Foundation' \
                -P 'Gentoo Linux Sparc' -p 'Gentoo Linux Sparc' -V "${clst_iso_volume_id}" \
-               -A 'G entoo Linux Sparc' ${clst_target_iso_path}  || die "Cannot make ISO image"
+               -A 'G entoo Linux Sparc' ${clst_target_path}  || die "Cannot make ISO image"
                rm /tmp/mkisofs.sparc.fu
                                                                                                                        
        ;;
@@ -61,42 +70,42 @@ case ${clst_mainarch} in
                #this is for the livecd-stage2 target, and calls the proper command
                # to build the iso file
                #
-               if [ -e ${clst_target_iso_path}/boot/isolinux.bin ]
+               if [ -e ${clst_target_path}/boot/isolinux.bin ]
                then
                        case ${clst_fstype} in
                                zisofs)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b boot/isolinux.bin -c boot/boot.cat -no-emul-boot \
-                                       -boot-load-size 4 -boot-info-table -z ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table -z ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                                *)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b boot/isolinux.bin -c boot/boot.cat -no-emul-boot \
-                                       -boot-load-size 4 -boot-info-table ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                        esac
-               elif [ -e ${clst_target_iso_path}/boot/grub/stage2_eltorito ]
+               elif [ -e ${clst_target_path}/boot/grub/stage2_eltorito ]
                then
                        case ${clst_fstype} in
                                zisofs)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b boot/grub/stage2_eltorito -c boot/boot.cat -no-emul-boot \
-                                       -boot-load-size 4 -boot-info-table -z ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table -z ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                                *)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b boot/grub/stage2_eltorito -c boot/boot.cat -no-emul-boot \
-                                       -boot-load-size 4 -boot-info-table ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                        esac
                else    
                        case ${clst_fstype} in
                                zisofs)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} \
-                                       -z ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       -z ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                                *)
                                        mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} \
-                                       ${clst_target_iso_path} || die "Cannot make ISO image"
+                                       ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                        esac
                fi
        ;;
 esac
-exit 
+exit  $?
index 1fb19d30edb84b58ac87cbc59125be123ee7293c..862d5488c54c2d820f58fed2dbb008c44d158dcd 100755 (executable)
@@ -31,7 +31,7 @@ setup_gk_args() {
                GK_ARGS="${GK_ARGS} --gensplash=${clst_splash_theme}"
        fi
 
-       if [ -n "${clst_initramfs_overlay}" ]
+       if [ -d "${clst_initramfs_overlay}" ]
        then
                GK_ARGS="${GK_ARGS} --initramfs-overlay=/tmp/initramfs_overlay/${clst_initramfs_overlay}"
        fi
index 74a79e9a79f909630ce5f0e136ea57182f5e00a8..b10e5198b362708cbbb85099c074ee3180cb2504 100755 (executable)
@@ -41,4 +41,8 @@ case ${clst_fstype} in
                loopret=$?
        ;;
 esac
+if [ ${loopret} = "1" ]
+then
+       die "Filesystem not setup"
+fi
 exit $loopret
index e75cac51b6033646cd089a6db0eec450bd6cb69f..b2118317becde3e7bbb094f2e89ba06cbf36096b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/tinderbox-controller.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/tinderbox-controller.sh,v 1.2 2005/04/27 17:44:58 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 
@@ -14,7 +14,6 @@ case $1 in
        preclean)
                #exec_in_chroot ${clst_sharedir}/targets/grp/tinderbox-preclean-chroot.sh
                delete_from_chroot /tmp/chroot-functions.sh
-               exit 0
        ;;
 
        clean)
@@ -27,4 +26,4 @@ case $1 in
        
 esac
 
-exit 0
+exit $?