embedded target cleanups ... iso,bootloader,target_setup generalizations, minor code...
authorEric Edgar <rocket@gentoo.org>
Thu, 21 Apr 2005 14:23:12 +0000 (14:23 +0000)
committerEric Edgar <rocket@gentoo.org>
Thu, 21 Apr 2005 14:23:12 +0000 (14:23 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@618 d1e1f19c-881f-0410-ab34-b69fee027534

24 files changed:
ChangeLog
modules/catalyst_support.py
modules/embedded_target.py
modules/generic_stage_target.py
modules/grp_target.py
modules/livecd_stage1_target.py
modules/livecd_stage2_target.py
modules/netboot_target.py
modules/stage4_target.py
modules/tinderbox_target.py
targets/embedded/embedded-chroot.sh
targets/embedded/embedded-controller.sh
targets/livecd-stage1/livecd-stage1-controller.sh
targets/livecd-stage2/livecd-stage2-cdfs.sh [deleted file]
targets/livecd-stage2/livecd-stage2-controller.sh
targets/stage4/stage4-chroot.sh
targets/stage4/stage4-controller.sh
targets/support/bootloader-setup.sh [moved from targets/livecd-stage2/livecd-stage2-bootloader.sh with 83% similarity]
targets/support/chroot-functions.sh
targets/support/create-iso.sh [moved from targets/livecd-stage2/livecd-stage2-iso.sh with 59% similarity]
targets/support/filesystem-functions.sh
targets/support/functions.sh
targets/support/livecdfs-update.sh
targets/support/target_image_setup.sh [new file with mode: 0755]

index e9a9a7f5fa75e33403aac1960b19757dcbc15849..8c5aef7faf37286c6bc8701176e8ec19bcc4eaee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,26 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.230 2005/04/20 21:31:15 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.231 2005/04/21 14:23:11 rocket Exp $
+
+  21 Apr 2005; Eric Edgar <rocket@gentoo.org> modules/catalyst_support.py,
+  modules/embedded_target.py, modules/generic_stage_target.py,
+  modules/grp_target.py, modules/livecd_stage1_target.py,
+  modules/livecd_stage2_target.py, modules/netboot_target.py,
+  modules/stage4_target.py, modules/tinderbox_target.py,
+  targets/embedded/embedded-chroot.sh,
+  targets/embedded/embedded-controller.sh,
+  targets/livecd-stage1/livecd-stage1-controller.sh,
+  -targets/livecd-stage2/livecd-stage2-bootloader.sh,
+  -targets/livecd-stage2/livecd-stage2-cdfs.sh,
+  targets/livecd-stage2/livecd-stage2-controller.sh,
+  -targets/livecd-stage2/livecd-stage2-iso.sh,
+  targets/stage4/stage4-chroot.sh, targets/stage4/stage4-controller.sh,
+  +targets/support/bootloader-setup.sh, targets/support/chroot-functions.sh,
+  +targets/support/create-iso.sh, targets/support/filesystem-functions.sh,
+  targets/support/functions.sh, targets/support/livecdfs-update.sh,
+  +targets/support/target_image_setup.sh:
+  embedded target cleanups ... iso,bootloader,target_setup generalizations,
+  minor code fixes
 
   20 Apr 2005; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/livecd-stage2/livecd-stage2-controller.sh,
index f9ca29c65911691c93ef6680693817f6a840fe61..2c27afa299f657d27233bba719f9622fa2cffe8e 100644 (file)
@@ -1,8 +1,8 @@
 # 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.38 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.39 2005/04/21 14:23:11 rocket Exp $
 
-import sys,string,os,types,re,traceback,md5
+import sys,string,os,types,re,signal,traceback,md5
 # a function to turn a string of non-printable characters into a string of
 # hex characters
 def hexify(str):
index e967078cef6c8e70dc0d27f33c6641b7d6774c37..43143218457607bd5d5f7f78f4cf3005525ed78f 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/embedded_target.py,v 1.10 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/embedded_target.py,v 1.11 2005/04/21 14:23:11 rocket Exp $
 
 """
 This class works like a 'stage3'.  A stage2 tarball is unpacked, but instead
@@ -27,40 +27,14 @@ class embedded_target(generic_stage_target):
         if addlargs.has_key("embedded/fs-type"):
             self.valid_values.append("embedded/fs-ops")
 
-       self.set_build_kernel_vars(addlargs)
-
        generic_stage_target.__init__(self,spec,addlargs)
-       self.settings["image_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/image"       
-    def build_fs(self):
-        try:
-            if self.settings.has_key("embedded/fs-type"):
-                cmd("/bin/bash "+self.settings["controller_file"]+" package","filesystem packaging failed")
-        except CatalystError:
-                self.unbind()
-                raise CatalystError, "embedded filesystem creation aborting due to error."
-
-    # this code is mostly duplication from the livecd stage2 module
-    def pre_build_fs(self):
-       try:
-               if self.settings.has_key("embedded/fs-prepare"):
-                       cmd("/bin/bash "+self.settings["embedded/fs-prepare"], "pre filesystem packaging cause an error in execution")
-       except CatalystError:
-               self.unbind()
-               raise CatalystError, "embedded pre filesystem creation script aborting due to error"
-
-    def post_build_fs(self):
-       try:
-               if self.settings.has_key("embedded/fs-finish"):
-                       cmd("/bin/bash "+self.settings["embedded/fs-finish"], "pre filesystem packaging cause an error in execution")
-       except CatalystError:
-               self.unbind()
-               raise CatalystError, "embedded post filesystem creation script aborting due to error"
+       self.set_build_kernel_vars(addlargs)
 
     def set_action_sequence(self):
        self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
-                                       "config_profile_link","setup_confdir","bind","chroot_setup",\
-                                       "setup_environment","build_packages","build_kernel","unmerge","unbind",\
-                                       "remove","empty","clean","pre_build_fs","build_fs","post_build_fs","clear_autoresume"]
+                                       "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\
+                                       "setup_environment","build_kernel","build_packages","bootloader","unmerge","unbind",\
+                                       "remove","empty","clean","livecd_update","target_setup","create_iso","clear_autoresume"]
 
     def set_stage_path(self):
         self.settings["stage_path"]=self.settings["chroot_path"]+"/tmp/mergeroot"
@@ -69,12 +43,10 @@ class embedded_target(generic_stage_target):
     def set_root_path(self):
         self.settings["root_path"]="/tmp/mergeroot"
        print "embedded root path is "+self.settings["root_path"]
+
     def set_dest_path(self):
        self.settings["destpath"]=self.settings["chroot_path"]+self.settings["root_path"]
                
-    def set_target_path(self):
-       self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
-
 def register(foo):
         foo.update({"embedded":embedded_target})
         return foo
index 5c1c23a980798f714ab21db3828cd2b775ec344d..e8027bfb7c122496ffdb1e3b4d708a7a2c257cf5 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.32 2005/04/15 16:49:45 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.33 2005/04/21 14:23:11 rocket Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -105,14 +105,14 @@ class generic_stage_target(generic_target):
                self.set_target_subpath()
        
                # set paths
+               self.set_autoresume_path()
                self.set_snapshot_path()
-               self.set_target_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()
+               self.set_target_path()
                
                self.set_controller_file()
                self.set_action_sequence()
@@ -121,8 +121,17 @@ class generic_stage_target(generic_target):
                self.set_iso_volume_id()
                self.set_build_kernel_vars(addlargs)    
                self.set_fsscript()
+               self.set_install_mask()
                self.set_rcadd()
                self.set_rcdel()
+               self.set_cdtar()
+               self.set_fstype()
+               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.
                file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0)
@@ -183,7 +192,12 @@ class generic_stage_target(generic_target):
                if self.makeconf.has_key("CXXFLAGS"):
                    print "Using CXXFLAGS setting from seed stage"
                    self.settings["CXXFLAGS"]=self.makeconf["CXXFLAGS"]
-
+       
+       def set_install_mask(self):
+               if self.settings.has_key("install_mask"):
+                       if type(self.settings["install_mask"]) != types.StringType:
+                               self.settings["install_mask"]=string.join(self.settings["install_mask"])
+       
        def set_spec_prefix(self):
                self.settings["spec_prefix"]=self.settings["target"]
 
@@ -195,7 +209,31 @@ 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"]+".tar.bz2"
+               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_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"
+       
+       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"):
@@ -212,6 +250,43 @@ class generic_stage_target(generic_target):
                        self.settings["rcdel"]=self.settings[self.settings["spec_prefix"]+"/rcdel"]
                        del self.settings[self.settings["spec_prefix"]+"/rcdel"]
 
+       def set_cdtar(self):    
+               if self.settings.has_key(self.settings["spec_prefix"]+"/cdtar"):
+                       self.settings["cdtar"]=self.settings[self.settings["spec_prefix"]+"/cdtar"]
+                       del self.settings[self.settings["spec_prefix"]+"/cdtar"]
+       
+       def set_iso(self):      
+               if self.settings.has_key(self.settings["spec_prefix"]+"/iso"):
+                       self.settings["iso"]=self.settings[self.settings["spec_prefix"]+"/iso"]
+                       del self.settings[self.settings["spec_prefix"]+"/iso"]
+
+       def set_fstype(self):   
+               if self.settings.has_key(self.settings["spec_prefix"]+"/cdfstype"):
+                       print "\n\n\nWarning!!!"+self.settings["spec_prefix"]+"/cdfstype" + "is deprecated and may be removed."
+                       print "\tUse "+self.settings["spec_prefix"]+"/fstype" + "instead.\n\n\n"
+                       self.settings["fstype"]=self.settings[self.settings["spec_prefix"]+"/cdfstype"]
+                       del self.settings[self.settings["spec_prefix"]+"/cdfstype"]
+               
+               if self.settings.has_key(self.settings["spec_prefix"]+"/fstype"):
+                       self.settings["fstype"]=self.settings[self.settings["spec_prefix"]+"/fstype"]
+                       del self.settings[self.settings["spec_prefix"]+"/fstype"]
+
+               if not self.settings.has_key("fstype"):
+                       self.settings["fstype"]="normal"
+
+       def set_fsops(self):
+               if self.settings.has_key("fstype"):
+                       self.valid_values.append("fsops")
+                       if self.settings.has_key(self.settings["spec_prefix"]+"/fs-ops"):
+                               print "\n\n\nWarning!!!"+self.settings["spec_prefix"]+"/fs-ops" + "is deprecated and may be removed."
+                               print "\tUse "+self.settings["spec_prefix"]+"/fsops" + "instead.\n\n\n"
+                               self.settings["fsops"]=self.settings[self.settings["spec_prefix"]+"/fs-ops"]
+                               del self.settings[self.settings["spec_prefix"]+"/fs-ops"]
+                       
+                       if self.settings.has_key(self.settings["spec_prefix"]+"/fsops"):
+                               self.settings["fsops"]=self.settings[self.settings["spec_prefix"]+"/fsops"]
+                               del self.settings[self.settings["spec_prefix"]+"/fsops"]
+       
        def set_source_path(self):
                self.settings["source_path"]=self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2"
                if os.path.isfile(self.settings["source_path"]):
@@ -267,6 +342,10 @@ class generic_stage_target(generic_target):
        def set_mounts(self):
                pass
 
+       def set_packages(self):
+               if self.settings.has_key("iso")
+                       self.settings[self.settings["spec_prefix"]+"/packages"].append("livecd-tools")
+
        def set_root_path(self):
                # ROOT= variable for emerges
                self.settings["root_path"]="/"
@@ -684,7 +763,7 @@ class generic_stage_target(generic_target):
 
                print "Creating stage tarball..."
                
-               cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["stage_path"]+\
+               cmd("tar cjf "+self.settings["target_file"]+" -C "+self.settings["stage_path"]+\
                        " .","Couldn't create stage tarball")
                touch(self.settings["autoresume_path"]+"capture")
 
@@ -781,7 +860,8 @@ class generic_stage_target(generic_target):
                and os.path.exists(self.settings["autoresume_path"]+"target_setup"):
                    print "Resume point detected, skipping target_setup operation..."
            else:
-               cmd("/bin/bash "+self.settings["controller_file"]+" cdfs","CDFS script failed.")
+               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.")
                touch(self.settings["autoresume_path"]+"target_setup")
        
        def setup_overlay(self):        
@@ -791,7 +871,7 @@ class generic_stage_target(generic_target):
            else:
                if self.settings.has_key(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.")
+                       self.settings["target_iso_path"], self.settings["spec_prefix"]+"overlay copy failed.")
                touch(self.settings["autoresume_path"]+"setup_overlay")
        
        def create_iso(self):
@@ -800,10 +880,10 @@ class generic_stage_target(generic_target):
                    print "Resume point detected, skipping create_iso operation..."
            else:
                # create the ISO - this is the preferred method (the iso scripts do not always work)
-               if self.settings.has_key(self.settings["spec_prefix"]+"/iso"):
+               if self.settings.has_key("iso"):
                        cmd("/bin/bash "+self.settings["controller_file"]+" iso "+\
-                               self.settings[self.settings["spec_prefix"]+"/iso"],"ISO creation script failed.")
-               touch(self.settings["autoresume_path"]+"create_iso")
+                               self.settings["iso"],"ISO creation script failed.")
+                       touch(self.settings["autoresume_path"]+"create_iso")
 
         def build_packages(self):
            if self.settings.has_key("AUTORESUME") \
@@ -823,7 +903,6 @@ class generic_stage_target(generic_target):
                                except CatalystError:
                                        self.unbind()
                                        raise CatalystError,self.settings["spec_prefix"] + "build aborting due to error."
-               touch(self.settings["autoresume_path"]+"build_packages")
        
        def build_kernel(self):
            if self.settings.has_key("AUTORESUME") \
@@ -902,10 +981,25 @@ class generic_stage_target(generic_target):
                    print "Resume point detected, skipping bootloader operation..."
            else:
                try:
-                       cmd("/bin/bash "+self.settings["controller_file"]+" bootloader",\
+                       cmd("/bin/bash "+self.settings["controller_file"]+" bootloader " + self.settings["target_iso_path"],\
                                "Bootloader runscript failed.")
                        touch(self.settings["autoresume_path"]+"bootloader")
                except CatalystError:
                        self.unbind()
                        raise CatalystError,"Runscript aborting due to error."
 
+        def livecd_update(self):
+           if self.settings.has_key("AUTORESUME") \
+               and os.path.exists(self.settings["autoresume_path"]+"livecd_update"):
+                   print "Resume point detected, skipping build_packages operation..."
+           else:
+               try:
+                       self.bind()
+                       cmd("/bin/bash "+self.settings["controller_file"]+" livecd-update",\
+                               "livecd-update failed.")
+                       self.unbind()
+                       touch(self.settings["autoresume_path"]+"livecd_update")
+               
+               except CatalystError:
+                       self.unbind()
+                       raise CatalystError,"build aborting due to livecd_update error."
index 4ec36ee40cd79b85e9f783240f42e8c41a778a27..7b08b6963a0950068c84b26e24221b433455e697 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/grp_target.py,v 1.9 2005/04/18 14:11:23 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/grp_target.py,v 1.10 2005/04/21 14:23:11 rocket Exp $
 
 """
 The builder class for GRP (Gentoo Reference Platform) builds.
@@ -32,9 +32,6 @@ class grp_target(generic_stage_target):
                        
                generic_stage_target.__init__(self,spec,addlargs)
        
-       def set_target_path(self):
-           self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
-       
        def run_local(self):
                for pkgset in self.settings["grp"]:
                        # example call: "grp.sh run pkgset cd1 xmms vim sys-apps/gleep"
@@ -51,7 +48,7 @@ class grp_target(generic_stage_target):
            self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
                                "config_profile_link","setup_confdir","bind","chroot_setup",\
                                            "setup_environment","run_local","unmerge","unbind",\
-                                           "remove","empty"]
+                                           "remove","empty","clear_autoresume"]
 
        
        def set_use(self):
index 38e865eed9dd6ddcb23773e4898dbfd369dc8661..fee5576e97e6fd3956b43d85325be6cc8db36ade 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.9 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.10 2005/04/21 14:23:11 rocket Exp $
 
 """
 Builder class for LiveCD stage1.
@@ -19,8 +19,7 @@ class livecd_stage1_target(generic_stage_target):
                self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
                                        "config_profile_link","setup_confdir","portage_overlay",\
                                        "bind","chroot_setup","setup_environment","build_packages",\
-                                       "preclean","fsscript","unmerge","unbind",\
-                                       "remove","empty","clean","clear_autoresume"]
+                                       "unbind", "clean","clear_autoresume"]
 
         def set_spec_prefix(self):
                        self.settings["spec_prefix"]="livecd"
index 5a054395888ec07190f87e5971fa716d533a343e..5bbeffb522ec5edab4ed5d0db01874aaec919305 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.35 2005/04/20 20:29:03 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.36 2005/04/21 14:23:11 rocket Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -12,7 +12,7 @@ from generic_stage_target import *
 
 class livecd_stage2_target(generic_stage_target):
        def __init__(self,spec,addlargs):
-               self.required_values=["boot/kernel","livecd/cdfstype"]
+               self.required_values=["boot/kernel","livecd/fstype"]
                
                self.valid_values=[]
                
@@ -25,13 +25,12 @@ class livecd_stage2_target(generic_stage_target):
                        "gamecd/conf","livecd/users","portage_overlay"])
                
                generic_stage_target.__init__(self,spec,addlargs)
-               
-               file_locate(self.settings, ["livecd/cdtar","controller_file"])
-               
+       
+               if not self.settings.has_key("livecd/type"):
+                   self.settings["livecd/type"] = "generic-livecd"
 
-       def set_target_path(self):
-           self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
-               
+               file_locate(self.settings, ["cdtar","controller_file"])
+               
        def set_source_path(self):
            self.settings["source_path"]=self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2"
            if os.path.isfile(self.settings["source_path"]):
@@ -61,15 +60,6 @@ class livecd_stage2_target(generic_stage_target):
                            touch(self.settings["autoresume_path"]+"unpack")
 
        def run_local(self):
-               # first clean up any existing target stuff
-               if os.path.exists(self.settings["target_path"]):
-                       print "cleaning previous livecd-stage2 build"
-                       cmd("rm -rf "+self.settings["target_path"],
-                               "Could not remove existing directory: "+self.settings["target_path"])
-                       
-               if not os.path.exists(self.settings["target_path"]):
-                       os.makedirs(self.settings["target_path"])
-                               
                # what modules do we want to blacklist?
                if self.settings.has_key("livecd/modblacklist"):
                        try:
@@ -88,7 +78,7 @@ class livecd_stage2_target(generic_stage_target):
                            "bind","chroot_setup","setup_environment","run_local",\
                            "root_overlay","build_kernel","bootloader","preclean",\
                            "fsscript","rcupdate","unmerge","unbind","remove",\
-                           "empty","target_setup",\
+                           "empty","livecd_update","target_setup",\
                            "setup_overlay","create_iso","clear_autoresume"]
 
 def register(foo):
index a3f2743cfc0242319e7a039123507c6dd0af34d1..b569c769028416a5275ab1719f78d2070e0daec5 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/netboot_target.py,v 1.2 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/netboot_target.py,v 1.3 2005/04/21 14:23:11 rocket Exp $
 
 """
 Builder class for a netboot build.
@@ -52,8 +52,6 @@ class netboot_target(generic_stage_target):
                        if not os.environ.has_key(envvar) and not addlargs.has_key(envvar):
                                self.settings[envvar] = "-Os -pipe"
        
-       def set_target_path(self):
-               self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
 
 #        def set_root_path(self):
 #              # ROOT= variable for emerges
index d319e7464604056f51952d35dcc33e460ac489bd..e14f2bac894ccfe8d432ae90a8c27e9b141ae987 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/stage4_target.py,v 1.3 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.4 2005/04/21 14:23:11 rocket Exp $
 
 """
 Builder class for LiveCD stage1.
@@ -25,9 +25,10 @@ class stage4_target(generic_stage_target):
                self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
                                        "config_profile_link","setup_confdir","portage_overlay",\
                                        "bind","chroot_setup","setup_environment","build_packages",\
-                                       "build_kernel","root_overlay","preclean","rcupdate","fsscript",\
-                                       "unmerge","unbind","remove","empty",\
-                                       "clean","capture","clear_autoresume"]
+                                       "build_kernel","bootloader","root_overlay","preclean","rcupdate",\
+                                       "fsscript","unmerge","unbind","remove","empty",\
+                                       "clean","capture","livecd_update","target_setup","create_iso",\
+                                       "clear_autoresume"]
 
 def register(foo):
        foo.update({"stage4":stage4_target})
index ba88faf0f94f8c1d2535d714b77a8fae6c8bc934..426f9986943b0e5b24aea3185cc068db421e577e 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/tinderbox_target.py,v 1.8 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/tinderbox_target.py,v 1.9 2005/04/21 14:23:11 rocket Exp $
 
 """
 builder class for the tinderbox target
@@ -27,9 +27,6 @@ class tinderbox_target(generic_stage_target):
                        self.unbind()
                        raise CatalystError,"Tinderbox aborting due to error."
        
-       def set_target_path(self):
-           self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
-
 def register(foo):
        foo.update({"tinderbox":tinderbox_target})
        return foo
index f2bb5a5b67e7d42f5a950e8305b7baf0714d76a0..ff8eb528186068368a1fb3742ea7e2b50757471a 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/embedded/embedded-chroot.sh,v 1.14 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.15 2005/04/21 14:23:11 rocket Exp $
 
 . /tmp/chroot-functions.sh
 
@@ -16,9 +16,19 @@ setup_myemergeopts
 # setup the environment
 export FEATURES="${clst_myfeatures}"
 export CONFIG_PROTECT="-*"
-export clst_myemergeopts="${clst_myemergeopts} -O"
+#export clst_myemergeopts="${clst_myemergeopts} -O"
 export USE="${clst_embedded_use}"
-
+export DESTROOT=${clst_root_path}
+export clst_root_path=/
 ## START BUILD
 
-run_emerge "${clst_embedded_packages}"
+run_emerge "${clst_myemergeopts}" -o "${clst_embedded_packages}"
+
+#export clst_myemergeopts="${clst_myemergeopts} -B"
+#run_emerge "${clst_embedded_packages}"
+
+export clst_root_path=${DESTROOT}
+export clst_myemergeopts="${clst_myemergeopts} -1 -O"
+INSTALL_MASK="${clst_install_mask}" run_emerge "${clst_embedded_packages}"
+
index fc4a2dd1b4863ef6d7148559331d647d0f4564e2..0008390b7748014d46196e63c9b2727758c57d6a 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.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-controller.sh,v 1.2 2005/04/21 14:23:11 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
@@ -18,16 +18,16 @@ case $1 in
        preclean)
        ;;
 
-       package)
-               export root_fs_path="${clst_chroot_path}/tmp/mergeroot"
-               install -d ${clst_image_path}
+#      package)
+#              export root_fs_path="${clst_chroot_path}/tmp/mergeroot"
+#              install -d ${clst_image_path}
                
-               ${clst_sharedir}/targets/embedded/embedded-fs-runscript.sh ${clst_embedded_fs_type} || exit 1
-               imagesize=`du -sk ${clst_image_path}/root.img | cut -f1`
-               echo "Created ${clst_embedded_fs_type} image at ${clst_image_path}/root.img"
-               echo "Image size: ${imagesize}k"
+#              ${clst_sharedir}/targets/embedded/embedded-fs-runscript.sh ${clst_embedded_fs_type} || exit 1
+#              imagesize=`du -sk ${clst_image_path}/root.img | cut -f1`
+#              echo "Created ${clst_embedded_fs_type} image at ${clst_image_path}/root.img"
+#              echo "Image size: ${imagesize}k"
        
-       ;;
+#      ;;
 
        kernel)
                shift
@@ -35,10 +35,33 @@ case $1 in
                exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
                exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh
                exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
-               extract_kernels ${clst_target_path}/kernels
        
        ;;
+
+       target_image_setup)
+               shift
+               ${clst_sharedir}/targets/support/target_image_setup.sh $1
+
+       ;;
+        livecd-update)
+               # now, finalize and tweak the livecd fs (inside of the chroot)
+               exec_in_chroot  ${clst_sharedir}/targets/support/livecdfs-update.sh
+       ;;
+
+       bootloader)
+               shift
+               # Here is where we poke in our identifier
+               touch $1/livecd
+
+               ${clst_sharedir}/targets/support/bootloader-setup.sh $1
+       ;;
        
+       iso)
+               shift
+               ${clst_sharedir}/targets/support/create-iso.sh $1
+       ;;
+
+
        clean)
        ;;
 
index 889726e8fb9eba32aaf5a5447620938af8a1aa7e..4060da14f9551e0821c3f4c60970c6106ffe06bd 100755 (executable)
@@ -1,24 +1,12 @@
 # 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.5 2005/04/20 19:48:29 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.6 2005/04/21 14:23:11 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 
 ## START RUNSCRIPT
 
 case $1 in
-       preclean)
-               echo "Cleared out by wolf31o2... this is a placeholder, BIATCH!!!"
-               ;;
-
-       rc-update)
-               exec_in_chroot  ${clst_sharedir}/targets/support/rc-update.sh
-               ;;
-
-       fsscript)
-               exec_in_chroot ${clst_fsscript}
-               ;;
-               
        build_packages)
                shift
                export clst_packages="$*"
diff --git a/targets/livecd-stage2/livecd-stage2-cdfs.sh b/targets/livecd-stage2/livecd-stage2-cdfs.sh
deleted file mode 100755 (executable)
index 528b8e5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# 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/Attic/livecd-stage2-cdfs.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
-. ${clst_sharedir}/targets/support/functions.sh
-. ${clst_sharedir}/targets/support/filesystem-functions.sh
-#. ${clst_sharedir}/targets/${clst_target}/${clst_mainarch}-archscript.sh
-
-#source ${clst_livecd_archscript}
-## START RUNSCRIPT
-
-loopret=1
-case ${clst_livecd_cdfstype} in
-       normal)
-               create_normal_loop
-               loopret=$?
-       ;;
-       zisofs)
-               create_zisofs
-               loopret=$?
-       ;;
-       noloop)
-               create_noloop
-               loopret=$?
-       ;;
-       gcloop)
-               create_gcloop
-               loopret=$?
-       ;;
-       squashfs)
-               create_squashfs
-               loopret=$?
-       ;;
-esac
-exit $loopret
index fc3089892c86fb6389f4b2859bcd4ebb0282c29d..f4a27857070df3ca8c404bcfdbce0bde3adab5da 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.7 2005/04/20 21:31:15 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.8 2005/04/21 14:23:11 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -56,10 +56,12 @@ case $1 in
                        exit 1
                    fi
                fi
-
+               ;;
+       livecd-update)
                # now, finalize and tweak the livecd fs (inside of the chroot)
                exec_in_chroot  ${clst_sharedir}/targets/support/livecdfs-update.sh
-
+               
+               
                # move over the xinitrc (if applicable)
                # this is moved here, so we can override any default xinitrc
                if [ -n "${clst_livecd_xinitrc}" ]
@@ -67,7 +69,6 @@ case $1 in
                        cp -a ${clst_livecd_xinitrc} ${clst_chroot_path}/etc/X11/xinit/xinitrc
                fi
                ;;
-
        rc-update)
                exec_in_chroot  ${clst_sharedir}/targets/support/rc-update.sh
                ;;
@@ -80,19 +81,21 @@ case $1 in
                ;;
 
        bootloader)
+               shift
                # Here is where we poke in our identifier
-               touch ${clst_target_path}/livecd
+               touch $1/livecd
                
-               ${clst_sharedir}/targets/livecd-stage2/livecd-stage2-bootloader.sh
+               ${clst_sharedir}/targets/support/bootloader-setup.sh $1
                ;;
 
-       cdfs)
-               ${clst_sharedir}/targets/livecd-stage2/livecd-stage2-cdfs.sh
+       target_image_setup)
+               shift
+               ${clst_sharedir}/targets/support/target_image_setup.sh $1
                ;;
 
        iso)
                shift
-               ${clst_sharedir}/targets/livecd-stage2/livecd-stage2-iso.sh $1
+               ${clst_sharedir}/targets/support/create-iso.sh $1
                ;;
 esac
 exit 0 
index 07e81afc7a5ff0f38a6bafbcfc37f66371485eb1..2e920f0eeaa28fbf1efb430165d666384e3a3c6c 100755 (executable)
@@ -19,4 +19,18 @@ setup_portage
 #turn off auto-use:
 export USE_ORDER="env:pkg:conf:defaults"       
 
+echo "Bringing system up to date using profile specific use flags"
+GRP_STAGE23_USE="$(portageq envvar GRP_STAGE23_USE)"
+export USE="-* ${clst_HOSTUSE} ${GRP_STAGE23_USE}"
+run_emerge -u system
+
+
+echo "Emerging packages using stage4 use flags"
+if [ -n "${clst_stage4_use}" ]
+then 
+       export USE="-* ${clst_HOSTUSE} ${GRP_STAGE23_USE}"
+else   
+       USE="${clst_stage4_use}"
+fi
+
 run_emerge "${clst_packages}"
index a0dd0da3d76ca571599546bc5e5d62f6624ad1f5..cbee6e6c4c57b5eb85aab4915ed3e8658e3d1ae4 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.2 2005/04/11 20:05:40 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.3 2005/04/21 14:23:11 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 
@@ -38,6 +38,30 @@ case $1 in
                exec_in_chroot ${clst_fsscript}
        ;;
 
+       livecd-update)
+               # now, finalize and tweak the livecd fs (inside of the chroot)
+               exec_in_chroot  ${clst_sharedir}/targets/support/livecdfs-update.sh
+       ;;
+
+        bootloader)
+               shift
+               # Here is where we poke in our identifier
+               touch $1/livecd
+               
+               ${clst_sharedir}/targets/support/bootloader-setup.sh $1
+       ;;
+       
+       target_image_setup)
+               shift
+               #${clst_sharedir}/targets/livecd-stage2/livecd-stage2-cdfs.sh
+               ${clst_sharedir}/targets/support/target_image_setup.sh $1
+       ;;
+
+       iso)
+       
+               shift
+               ${clst_sharedir}/targets/support/create-iso.sh $1
+       ;;
 
        clean)
                exit 0
similarity index 83%
rename from targets/livecd-stage2/livecd-stage2-bootloader.sh
rename to targets/support/bootloader-setup.sh
index 4a326ff513bfc6d1e61fb2730c76d6f912e716b8..fdc5268582a08d5290160ef307329b33b67f5319 100755 (executable)
@@ -1,14 +1,13 @@
 # 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/Attic/livecd-stage2-bootloader.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.1 2005/04/21 14:23:12 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
-#. ${clst_sharedir}/targets/${clst_target}/${clst_mainarch}-archscript.sh
 
-#source ${clst_livecd_archscript}
-## START RUNSCRIPT
-extract_cdtar
-extract_kernels ${clst_target_path}/boot
+# $1 is the destination root
+
+extract_cdtar $1
+extract_kernels $1/boot
 check_dev_manager
 check_filesystem_type
 
@@ -16,7 +15,7 @@ default_append_line="initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=off ${cmd
 
 case ${clst_mainarch} in
        alpha)
-               acfg=${clst_target_path}/etc/aboot.conf
+               acfg=$1/etc/aboot.conf
                bctr=0
                for x in ${clst_boot_kernel}
                do
@@ -30,9 +29,9 @@ case ${clst_mainarch} in
        arm)
                ;;
        hppa)
-               icfg=${clst_target_path}/boot/palo.conf
-               kmsg=${clst_target_path}/boot/kernels.msg
-               hmsg=${clst_target_path}/boot/help.msg
+               icfg=$1/boot/palo.conf
+               kmsg=$1/boot/kernels.msg
+               hmsg=$1/boot/help.msg
                echo "--commandline=0/${first} initrd=${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
                echo "--bootloader=boot/iplboot" >> ${icfg}
                echo "--ramdisk=boot/${x}.igz" >> ${icfg}
@@ -70,7 +69,7 @@ case ${clst_mainarch} in
                # but the following suffices for now:
                ;;
        sparc*)
-               scfg=${clst_target_path}/boot/silo.conf
+               scfg=$1/boot/silo.conf
                echo "default=\"help\"" > ${scfg}
                echo "message=\"/boot/boot.msg\"" >> ${scfg}
 
@@ -91,12 +90,12 @@ case ${clst_mainarch} in
                echo -e "label=\"help\"" >> ${scfg}
                ;;
        x86)
-               if [ -e ${clst_target_path}/boot/isolinux.bin ]
+               if [ -e $1/boot/isolinux.bin ]
                then
                        # the rest of this function sets up the config file for isolinux
-                       icfg=${clst_target_path}/boot/isolinux.cfg
-                       kmsg=${clst_target_path}/boot/kernels.msg
-                       hmsg=${clst_target_path}/boot/help.msg
+                       icfg=$1/boot/isolinux.cfg
+                       kmsg=$1/boot/kernels.msg
+                       hmsg=$1/boot/help.msg
                        echo "default ${first}" > ${icfg}
                        echo "timeout 150" >> ${icfg}
                        echo "prompt 1" >> ${icfg}
@@ -131,7 +130,7 @@ case ${clst_mainarch} in
                                echo "   ${x}-nofb" >> ${kmsg}
                        done
 
-                       if [ -f ${clst_target_path}/boot/memtest86 ]
+                       if [ -f $1/boot/memtest86 ]
                        then
                                echo >> $icfg
                                echo "   memtest86" >> $kmsg
@@ -140,10 +139,10 @@ case ${clst_mainarch} in
                        fi
                fi
 
-               if [ -e ${clst_target_path}/boot/grub/stage2_eltorito ]
+               if [ -e $1/boot/grub/stage2_eltorito ]
                then
-                       icfg=${clst_target_path}/boot/grub/grub.conf
-                       hmsg=${clst_target_path}/boot/grub/help.msg
+                       icfg=$1/boot/grub/grub.conf
+                       hmsg=$1/boot/grub/help.msg
                        echo "default 1" > ${icfg}
                        echo "timeout 150" >> ${icfg}
                        echo >> ${icfg}
@@ -163,7 +162,7 @@ case ${clst_mainarch} in
                                        echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
                                fi
 
-                               if [ -e ${clst_target_path}/boot/${x}.igz ]
+                               if [ -e $1/boot/${x}.igz ]
                                then
                                        echo "initrd /boot/${x}.igz" >> ${icfg}
                                fi
@@ -171,13 +170,13 @@ case ${clst_mainarch} in
                                echo >> ${icfg}
                                echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
                                echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
-                               if [ -e ${clst_target_path}/boot/${x}.igz ]
+                               if [ -e $1/boot/${x}.igz ]
                                then
                                        echo "initrd /boot/${x}.igz" >> ${icfg}
                                fi
                        done
 
-                       if [ -f ${clst_target_path}/boot/memtest86 ]
+                       if [ -f $1/boot/memtest86 ]
                        then
                                echo >> ${icfg}
                                echo "title memtest86" >> ${icfg}
index c41e8b8c4e416a9793bbcf2835dcc257abd7d57f..aaa3d9160ee946c90898c5331917d7567d453245 100755 (executable)
@@ -27,18 +27,23 @@ check_portage_version(){
 }
 
 check_genkernel_version(){
-    genkernel_version=$(genkernel --version)
-    genkernel_version_major=${genkernel_version%%.*}
-    genkernel_version_minor_sub=${genkernel_version#${genkernel_version_major}.}
-    genkernel_version_minor=${genkernel_version_minor_sub%%.*}
-    genkernel_version_sub=${genkernel_version##*.}
-    if [ -n "${genkernel_version}" -a "${genkernel_version_major}" -eq '3' -a "${genkernel_version_minor}" -ge '2' ]
+    if [ -x `which genkernel` ]
     then
-           echo "Genkernel version ${genkernel_version} found ... continuing"
+       genkernel_version=$(genkernel --version)
+       genkernel_version_major=${genkernel_version%%.*}
+       genkernel_version_minor_sub=${genkernel_version#${genkernel_version_major}.}
+       genkernel_version_minor=${genkernel_version_minor_sub%%.*}
+       genkernel_version_sub=${genkernel_version##*.}
+       if [ -n "${genkernel_version}" -a "${genkernel_version_major}" -eq '3' -a "${genkernel_version_minor}" -ge '2' ]
+       then
+               echo "Genkernel version ${genkernel_version} found ... continuing"
+       else
+               echo "ERROR: Your genkernel version is too low in your seed stage.  genkernel version 3.2.0"
+               echo "or greater is required."
+               exit 1
+       fi
     else
-           echo "ERROR: Your genkernel version is too low in your seed stage.  genkernel version 3.2.0"
-           echo "or greater is required."
-           exit 1
+       exit 1
     fi
 }
                
@@ -126,7 +131,6 @@ make_destpath() {
                        install -d ${ROOT}
                fi
        fi
-       echo "ROOT=${ROOT} emerge ...."
 }
 
 run_emerge() {
@@ -137,6 +141,7 @@ run_emerge() {
        
     if [ -n "${clst_VERBOSE}" ]
        then
+               echo "ROOT=${ROOT} emerge ${clst_myemergeopts} -vpt $@" || exit 1
                emerge ${clst_myemergeopts} -vpt $@ || exit 3
                echo "Press any key within 15 seconds to pause the build..."
                read -s -t 15 -n 1
@@ -146,6 +151,7 @@ run_emerge() {
                        read -s -n 1
                fi
        fi
+       echo "emerge ${clst_myemergeopts} $@" || exit 1
        emerge ${clst_myemergeopts} $@ || exit 1
 }
 
similarity index 59%
rename from targets/livecd-stage2/livecd-stage2-iso.sh
rename to targets/support/create-iso.sh
index 0db179cf12888fcb6ff17939bb386f472186a1de..d5c224f99816187c86e7f9af9d3630e23334a0b3 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/Attic/livecd-stage2-iso.sh,v 1.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.1 2005/04/21 14:23:12 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 #. ${clst_sharedir}/targets/${clst_target}/${clst_mainarch}-archscript.sh
@@ -12,12 +12,12 @@ case ${clst_mainarch} in
        alpha)
                # this is for the livecd-final target, and calls the proper
                # command to build the iso file
-               case ${clst_livecd_cdfstype} in
+               case ${clst_fstype} in
                        zisofs)
-                               mkisofs -J -R -l -z -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}  || die "Cannot make ISO image"
+                               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 -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"
                        ;;
                esac
                isomarkboot ${1} /boot/bootlx
@@ -27,19 +27,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_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"
                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_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}
+               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}
        ;;
        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_path}/boot/isofs.b -B ... ${clst_target_path} \
+               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -G ${clst_target_iso_path}/boot/isofs.b -B ... ${clst_target_iso_path} \
                        || die "Cannot make ISO image"
 
        ;;
@@ -48,11 +48,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_path}/boot/mkisofs.sparc.fu /tmp 
+               mv ${clst_target_iso_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_path}  || die "Cannot make ISO image"
+               -A 'G entoo Linux Sparc' ${clst_target_iso_path}  || die "Cannot make ISO image"
                rm /tmp/mkisofs.sparc.fu
                                                                                                                        
        ;;
@@ -61,30 +61,39 @@ 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_path}/boot/isolinux.bin ]
+               if [ -e ${clst_target_iso_path}/boot/isolinux.bin ]
                then
-                       case ${clst_livecd_cdfstype} in
+                       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_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table -z ${clst_target_iso_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_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table ${clst_target_iso_path} || die "Cannot make ISO image"
                                ;;
                        esac
-               fi
-
-               if [ -e ${clst_target_path}/boot/grub/stage2_eltorito ]
+               elif [ -e ${clst_target_iso_path}/boot/grub/stage2_eltorito ]
                then
-                       case ${clst_livecd_cdfstype} in
+                       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_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table -z ${clst_target_iso_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_path} || die "Cannot make ISO image"
+                                       -boot-load-size 4 -boot-info-table ${clst_target_iso_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"
+                               ;;
+                               *)
+                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} \
+                                       ${clst_target_iso_path} || die "Cannot make ISO image"
                                ;;
                        esac
                fi
index 2236bc11e2cbf18303ab9b606e6a73a51cd26a7e..95ed938de16064ddb13eadbaa78904f9880a2171 100755 (executable)
@@ -1,10 +1,10 @@
 # Dont forget to update functions.sh  check_looptype
-
+# $1 is the target directory for the filesystem
 
 create_normal_loop() {
-    export source_path="${clst_chroot_path}"
-    export destination_path="${clst_target_path}"
-    export loopname="livecd.loop"
+    export source_path="${clst_destpath}"
+    export destination_path="$1"
+    export loopname="image.loop"
 
     #We get genkernel-built kernels and initrds in place, create the loopback fs on 
     #$clst_target_path, mount it, copy our bootable filesystem over, umount it, and 
@@ -34,30 +34,52 @@ create_normal_loop() {
 
 
 create_zisofs() {
-       rm -rf "${clst_target_path}/zisofs" > /dev/null 2>&1
+       rm -rf "$1/zisofs" > /dev/null 2>&1
        echo "Creating zisofs..."
-       mkzftree -z 9 -p2 "${clst_chroot_path}" "${clst_target_path}/zisofs" || die "Could not run mkzftree, did you emerge zisofs"
+       mkzftree -z 9 -p2 "${clst_destpath}" "$1/zisofs" || die "Could not run mkzftree, did you emerge zisofs"
 
 }
 
 create_noloop() {
        echo "Copying files for image (no loop)..."
-       cp -a "${clst_chroot_path}"/* "${clst_target_path}" || die "Could not copy files to image (no loop)"
+       cp -a "${clst_destpath}"/* "$1" || die "Could not copy files to image (no loop)"
        
 }
 
 create_gcloop() {
        echo "Creating gcloop..."
+       export loopname="image.gloop"
        create_normal_loop
-       compress_gcloop_ucl -b 131072 -c 10 "${clst_target_path}/livecd.loop" "${clst_target_path}/livecd.gcloop" || die "compress_gcloop_ucl failed, did you emerge gcloop?"
-       rm -f "${clst_target_path}/livecd.loop"
+       compress_gcloop_ucl -b 131072 -c 10 "$1/livecd.loop" "$1/livecd.gcloop" || die "compress_gcloop_ucl failed, did you emerge gcloop?"
+       rm -f "$1/livecd.loop"
        # only a gcloop image should exist in target path
        
 }
 
 create_squashfs() {
        echo "Creating squashfs..."
-       mksquashfs "${clst_chroot_path}" "${clst_target_path}/livecd.squashfs" -noappend || die "mksquashfs failed, did you emerge squashfs-tools?"
+       export loopname="image.squashfs"
+       mksquashfs "${clst_destpath}" "$1/${loopname}" ${clst_fs_ops} -noappend || die "mksquashfs failed, did you emerge squashfs-tools?"
        
 }
 
+create_jffs() {
+       echo "Creating jffs..."
+       export loopname="image.jffs"
+       #fs_check /usr/sbin/mkfs.jffs jffs sys-fs/mtd
+       mkfs.jffs -d ${clst_destpath} -o $1/${loopname} ${clst_fs_ops} || die "Could not create a jffs filesystem"
+}
+
+create_jffs2(){
+       echo "Creating jffs2..."
+       export loopname="image.jffs"
+       #fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd
+       mkfs.jffs2 --root=${clst_destpath} --output=$1/${loopname} ${clst_fs_ops} || die "Could not create a jffs2 filesystem"
+}
+
+create_cramfs(){
+       echo "Creating cramfs..."
+       export loopname="image.cramfs"
+       #fs_check /sbin/mkcramfs cramfs sys-fs/cramfs
+       mkcramfs ${clst_fs_ops} ${clst_destpath} $1/${loopname} || die "Could not create a cramfs filesystem"
+}
index eaeae080fe9a73c2dbde3810e5445531bc5cded7..0b18da18cc2ced670b94b8f20b5446a0e74826a8 100755 (executable)
@@ -59,9 +59,9 @@ extract_cdtar() {
        # which will normally contains a pre-built binary
        # boot-loader/filesystem skeleton for the ISO.
 
-       cdtar=${clst_livecd_cdtar}
-       [ -z "${cdtar}" ] && die "Required key livecd/cdtar not defined, exiting"
-       tar xjpf ${cdtar} -C ${clst_target_path} || die "Couldn't extract cdtar ${cdtar}"
+       cdtar=${clst_cdtar}
+       [ -z "${cdtar}" ] && die "Required key cdtar not defined, exiting"
+       tar xjpf ${cdtar} -C $1 || die "Couldn't extract cdtar ${cdtar}"
 }
 
 extract_kernels() {
@@ -149,18 +149,18 @@ extract_kernel() {
 
 check_dev_manager(){
        # figure out what device manager we are using and handle it accordingly
-       if [ "${clst_livecd_devmanager}" == "udev" ]
+       if [ "${clst_livecd_devmanager}" == "devfs" ]
        then
-               cmdline_opts="${cmdline_opts} udev nodevfs"
-       else
                cmdline_opts="${cmdline_opts} noudev devfs"
+       else
+               cmdline_opts="${cmdline_opts} udev nodevfs"
        fi
 }
 
 check_filesystem_type(){
-       case ${clst_livecd_cdfstype} in
+       case ${clst_fstype} in
                normal)
-               cmdline_opts="${cmdline_opts} looptype=normal loop=/livecd.loop"
+               cmdline_opts="${cmdline_opts} looptype=normal loop=/image.loop"
                ;;
        zisofs)
                cmdline_opts="${cmdline_opts} looptype=zisofs loop=/zisofs"
@@ -168,10 +168,19 @@ check_filesystem_type(){
        noloop)
                ;;
        gcloop)
-               cmdline_opts="${cmdline_opts} looptype=gcloop loop=/livecd.gcloop"
+               cmdline_opts="${cmdline_opts} looptype=gcloop loop=/image.gcloop"
                ;;
        squashfs)
-               cmdline_opts="${cmdline_opts} looptype=squashfs loop=/livecd.squashfs"
-       ;;
+               cmdline_opts="${cmdline_opts} looptype=squashfs loop=/image.squashfs"
+               ;;
+       jffs)
+               cmdline_opts="${cmdline_opts} looptype=jffs loop=/image.jffs"
+               ;;
+       jffs2)
+               cmdline_opts="${cmdline_opts} looptype=jffs2 loop=/image.jffs2"
+               ;;
+       cramfs)
+               cmdline_opts="${cmdline_opts} looptype=cramfs loop=/image.cramfs"
+               ;;
        esac
 }                                                                                                                                                                                                                                              
index 2436ec4aafd7eec666b61c101d30a30d664d0746..800aef65dec94386308bc145cab772e8843ee45d 100755 (executable)
@@ -1,10 +1,10 @@
 #!/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/support/livecdfs-update.sh,v 1.10 2005/04/20 21:31:15 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.11 2005/04/21 14:23:12 rocket Exp $
 
-/usr/sbin/env-update
-source /etc/profile
+. /tmp/chroot-functions.sh
+update_env_settings
 
 # allow root logins to the livecd by default
 if [ -e /etc/sshd/sshd_config ]
@@ -52,6 +52,11 @@ case ${clst_livecd_type} in
                echo "gentoo" > /etc/dnsdomainname
                echo "127.0.0.1 livecd.gentoo livecd localhost" > /etc/hosts
                ;;
+       *)
+               echo "catalyst-livecd" > /etc/hostname
+               echo "gentoo" > /etc/dnsdomainname
+               echo "127.0.0.1 catalyst-livecd.gentoo livecd localhost" > /etc/hosts
+               ;;
 esac
 
 # Add any users
@@ -64,7 +69,10 @@ then
 fi
 
 # setup sudoers
-sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
+if [ -f /etc/sudoers ]
+then
+       sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
+fi
 
 # we want the first user to be used when auto-starting X
 if [ -n "${clst_livecd_users}" -a -e /etc/startx ]
@@ -241,6 +249,7 @@ case ${clst_livecd_type} in
                rm -rf /usr/livecd/profiles/{co*,default-{1*,a*,b*,d*,h*,i*,m*,p*,s*,x*},g*,hardened-*,n*,x*}
                mv -f /etc/gconf /usr/livecd
                mv -f /var/db /usr/livecd
+               ;;
        generic-livecd )
                # This is my hack to reduce tmpfs usage
                mkdir -p /usr/livecd
diff --git a/targets/support/target_image_setup.sh b/targets/support/target_image_setup.sh
new file mode 100755 (executable)
index 0000000..74a79e9
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+. ${clst_sharedir}/targets/support/functions.sh
+. ${clst_sharedir}/targets/support/filesystem-functions.sh
+
+# Make the directory if it doesnt exist
+mkdir -p $1
+
+loopret=1
+case ${clst_fstype} in
+       normal)
+               create_normal_loop $1
+               loopret=$?
+       ;;
+       zisofs)
+               create_zisofs $1
+               loopret=$?
+       ;;
+       noloop)
+               create_noloop $1
+               loopret=$?
+       ;;
+       gcloop)
+               create_gcloop $1
+               loopret=$?
+       ;;
+       squashfs)
+               create_squashfs $1
+               loopret=$?
+       ;;
+       jffs)
+               create_jffs $1
+               loopret=$?
+       ;;
+       jffs2)
+               create_jffs2 $1
+               loopret=$?
+       ;;
+       cramfs)
+               create_cramfs $1
+               loopret=$?
+       ;;
+esac
+exit $loopret