Generalized kernel support, fsscript, rcupdate, etc for stage4
authorEric Edgar <rocket@gentoo.org>
Mon, 11 Apr 2005 20:05:40 +0000 (20:05 +0000)
committerEric Edgar <rocket@gentoo.org>
Mon, 11 Apr 2005 20:05:40 +0000 (20:05 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@598 d1e1f19c-881f-0410-ab34-b69fee027534

13 files changed:
ChangeLog
modules/generic_stage_target.py
modules/livecd_stage1_target.py
modules/livecd_stage2_target.py
modules/stage4_target.py
targets/livecd-stage1/livecd-stage1-controller.sh
targets/livecd-stage2/livecd-stage2-controller.sh
targets/stage4/stage4-controller.sh
targets/stage4/unmerge.sh [new file with mode: 0644]
targets/support/functions.sh
targets/support/kmerge.sh
targets/support/livecdfs-update.sh
targets/support/rc-update.sh [new file with mode: 0644]

index 1c186156f0abfc42f74084bf0d3643e3cc6583fb..920c8a5a2bd0a1de54fe48ce1aaccf9e2cd8f93b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,16 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.215 2005/04/09 12:49:16 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.216 2005/04/11 20:05:40 rocket Exp $
+
+  11 Apr 2005; Eric Edgar <rocket@gentoo.org>
+  modules/generic_stage_target.py, modules/livecd_stage1_target.py,
+  modules/livecd_stage2_target.py, modules/stage4_target.py,
+  targets/livecd-stage1/livecd-stage1-controller.sh,
+  targets/livecd-stage2/livecd-stage2-controller.sh,
+  targets/stage4/stage4-controller.sh, +targets/stage4/unmerge.sh,
+  targets/support/functions.sh, targets/support/kmerge.sh,
+  targets/support/livecdfs-update.sh, +targets/support/rc-update.sh:
+  Generalized kernel support, fsscript, rcupdate, etc for stage4
 
   09 Apr 2005; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/support/pre-kmerge.sh:
index 9ed379e9a8b4d728a20141b79c4f247c2e41a600..8805a0191f5ad93876c597e19b5f19385420bed7 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.27 2005/04/07 23:02:20 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.28 2005/04/11 20:05:40 rocket Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -96,6 +96,9 @@ class generic_stage_target(generic_target):
                else:
                        print "Building on",self.settings["hostarch"],"for alternate machine type",\
                                self.settings["mainarch"]
+               # This should be first to be set as other set_ options depend on this
+               self.set_spec_prefix()
+               
                
                # define all of our core variables
                self.set_target_profile()
@@ -114,8 +117,11 @@ class generic_stage_target(generic_target):
                self.set_action_sequence()
                self.set_use()
                self.set_cleanables()
-               self.set_spec_prefix()
                self.set_iso_volume_id()
+               self.set_build_kernel_vars(addlargs)    
+               self.set_fsscript()
+               self.set_rcadd()
+               self.set_rcdel()
 
                # 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)
@@ -189,7 +195,22 @@ class generic_stage_target(generic_target):
 
        def set_target_path(self):
                self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+".tar.bz2"
+
+       def set_fsscript(self): 
+               if self.settings.has_key(self.settings["spec_prefix"]+"/fsscript"):
+                       self.settings["fsscript"]=self.settings[self.settings["spec_prefix"]+"/fsscript"]
+                       del self.settings[self.settings["spec_prefix"]+"/fsscript"]
        
+       def set_rcadd(self):    
+               if self.settings.has_key(self.settings["spec_prefix"]+"/rcadd"):
+                       self.settings["rcadd"]=self.settings[self.settings["spec_prefix"]+"/rcadd"]
+                       del self.settings[self.settings["spec_prefix"]+"/rcadd"]
+       
+       def set_rcdel(self):    
+               if self.settings.has_key(self.settings["spec_prefix"]+"/rcdel"):
+                       self.settings["rcdel"]=self.settings[self.settings["spec_prefix"]+"/rcdel"]
+                       del self.settings[self.settings["spec_prefix"]+"/rcdel"]
+
        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"]):
@@ -240,6 +261,35 @@ class generic_stage_target(generic_target):
                # ROOT= variable for emerges
                self.settings["root_path"]="/"
 
+       def set_build_kernel_vars(self,addlargs):
+               
+           if addlargs.has_key("boot/kernel"):
+               if type(addlargs["boot/kernel"]) == types.StringType:
+                       loopy=[addlargs["boot/kernel"]]
+               else:
+                       loopy=addlargs["boot/kernel"]
+                           
+               for x in loopy:
+                       self.required_values.append("boot/kernel/"+x+"/sources")
+                       self.required_values.append("boot/kernel/"+x+"/config")
+                       self.valid_values.append("boot/kernel/"+x+"/extraversion")
+                       self.valid_values.append("boot/kernel/"+x+"/packages")
+                       self.valid_values.append("boot/kernel/"+x+"/use")
+                       self.valid_values.append("boot/kernel/"+x+"/gk_kernargs")
+                       self.valid_values.append("boot/kernel/"+x+"/gk_action")
+                   
+           if self.settings.has_key(self.settings["spec_prefix"]+"/devmanager"):
+               self.settings["devmanager"]=self.settings[self.settings["spec_prefix"]+"/devmanager"]
+               del self.settings[self.settings["spec_prefix"]+"/devmanager"]
+           
+           if self.settings.has_key(self.settings["spec_prefix"]+"/splashtype"):
+               self.settings["splashtype"]=self.settings[self.settings["spec_prefix"]+"/splashtype"]
+               del self.settings[self.settings["spec_prefix"]+"/splashtype"]
+           
+           if self.settings.has_key(self.settings["spec_prefix"]+"/gk_mainargs"):
+               self.settings["gk_mainargs"]=self.settings[self.settings["spec_prefix"]+"/gk_mainargs"]
+               del self.settings[self.settings["spec_prefix"]+"/gk_mainargs"]
+       
        def mount_safety_check(self):
                mypath=self.settings["chroot_path"]
                
@@ -476,6 +526,16 @@ class generic_stage_target(generic_target):
                                myf.write('PORTDIR_OVERLAY="'+string.join(self.settings["portage_overlay"])+'"\n')
                    myf.close()
        
+       def fsscript(self):
+               if self.settings.has_key("fsscript"):
+                       if os.path.exists(self.settings["controller_file"]):
+                               cmd("/bin/bash "+self.settings["controller_file"]+" fsscript","fsscript script failed.")
+       
+       def rcupdate(self):
+               if self.settings.has_key("rcadd") or self.settings.has_key("rcdel"):
+                       if os.path.exists(self.settings["controller_file"]):
+                               cmd("/bin/bash "+self.settings["controller_file"]+" rc-update","rc-update script failed.")
+
        def clean(self):
                for x in self.settings["cleanables"]: 
                        print "Cleaning chroot: "+x+"... "
@@ -657,19 +717,19 @@ class generic_stage_target(generic_target):
                        cmd("/bin/bash "+self.settings["controller_file"]+" iso "+\
                                self.settings[self.settings["spec_prefix"]+"/iso"],"ISO creation script failed.")
         def build_packages(self):
-               
-               if self.settings.has_key("AUTORESUME") \
-                       and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_build_packages"):
-                               print "Resume point detected, skipping build_packages operation..."
-               else:
-                       mypack=list_bashify(self.settings[self.settings["spec_prefix"]+"/packages"])
-                       try:
-                               cmd("/bin/bash "+self.settings["controller_file"]+\
-                                       " build_packages "+mypack)
-                               touch(self.settings["chroot_path"]+"/tmp/.clst_build_packages")
-                       except CatalystError:
-                               self.unbind()
-                               raise CatalystError,self.settings["spec_prefix"] + "build aborting due to error."
+               if self.settings.has_key(self.settings["spec_prefix"]+"/packages"):
+                       if self.settings.has_key("AUTORESUME") \
+                               and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_build_packages"):
+                                       print "Resume point detected, skipping build_packages operation..."
+                       else:
+                               mypack=list_bashify(self.settings[self.settings["spec_prefix"]+"/packages"])
+                               try:
+                                       cmd("/bin/bash "+self.settings["controller_file"]+\
+                                               " build_packages "+mypack)
+                                       touch(self.settings["chroot_path"]+"/tmp/.clst_build_packages")
+                               except CatalystError:
+                                       self.unbind()
+                                       raise CatalystError,self.settings["spec_prefix"] + "build aborting due to error."
        
        def build_kernel(self):
                if self.settings.has_key("boot/kernel"):
@@ -709,7 +769,7 @@ class generic_stage_target(generic_target):
                                                os.putenv(kname+"_kernelopts", "")
 
                                        if not self.settings.has_key("boot/kernel/"+kname+"/extraversion"):
-                                               self.settings["boot/kernel/"+kname+"/extraversion"]="NULL_VALUE"
+                                               self.settings["boot/kernel/"+kname+"/extraversion"]=""
 
                                        os.putenv("clst_kextraversion", self.settings["boot/kernel/"+kname+"/extraversion"])
 
@@ -720,23 +780,3 @@ class generic_stage_target(generic_target):
                        except CatalystError:
                                self.unbind()
                                raise CatalystError,"build aborting due to kernel build error."
-
-       def set_build_kernel_vars(self,addlargs):
-               
-           if not addlargs.has_key("boot/kernel"):
-                   raise CatalystError, "Required value boot/kernel not specified."
-                                   
-                   if type(addlargs["boot/kernel"]) == types.StringType:
-                       loopy=[addlargs["boot/kernel"]]
-                   else:
-                       loopy=addlargs["boot/kernel"]
-                           
-                   for x in loopy:
-                       self.required_values.append("boot/kernel/"+x+"/sources")
-                       self.required_values.append("boot/kernel/"+x+"/config")
-                       self.valid_values.append("boot/kernel/"+x+"/extraversion")
-                       self.valid_values.append("boot/kernel/"+x+"/packages")
-                       self.valid_values.append("boot/kernel/"+x+"/use")
-                       self.valid_values.append("boot/kernel/"+x+"/gk_kernargs")
-                       self.valid_values.append("boot/kernel/"+x+"/gk_action")
-                   
index af7966dec7c32aa1873817519efe7c38b6ec2ddf..d805841bb67c544abdbb773f3b35c38d74c590db 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.7 2005/04/04 17:48:32 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.8 2005/04/11 20:05:40 rocket Exp $
 
 """
 Builder class for LiveCD stage1.
@@ -19,7 +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","clear_autoresume","unmerge","unbind",\
+                                       "preclean","fsscript","clear_autoresume","unmerge","unbind",\
                                        "remove","empty","clean"]
 
 
index 5cf46afe589c719771b02c2b116abd6927ee0646..9682b6106eee8ee3a1bf8a5d447176b2b857068e 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.31 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.32 2005/04/11 20:05:40 rocket Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -15,7 +15,7 @@ class livecd_stage2_target(generic_stage_target):
                self.required_values=["boot/kernel","livecd/cdfstype"]
                
                self.valid_values=[]
-               self.set_build_kernel_vars(addlargs)
+               
                self.valid_values.extend(self.required_values)
                self.valid_values.extend(["livecd/cdtar","livecd/empty","livecd/rm",\
                        "livecd/unmerge","livecd/iso","livecd/gk_mainargs","livecd/type",\
@@ -25,9 +25,9 @@ class livecd_stage2_target(generic_stage_target):
                        "gamecd/conf","portage_overlay"])
                
                generic_stage_target.__init__(self,spec,addlargs)
+               
                file_locate(self.settings, ["livecd/cdtar","controller_file"])
-               if self.settings.has_key("portage_confdir"):
-                       file_locate(self.settings,["portage_confdir"],expand=0)
+               
 
        def set_target_path(self):
            self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
@@ -92,7 +92,8 @@ class livecd_stage2_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","run_local",\
-                           "root_overlay","build_kernel","bootloader","clear_autoresume",\
+                           "root_overlay","build_kernel","bootloader","preclean",\
+                           "fsscript","rcupdate","clear_autoresume",\
                            "unmerge","unbind","remove","empty","target_setup",\
                            "setup_overlay","create_iso"]
 
index ec7d5624eafe43a3212ef637a40809e792e9a70d..2c472081440ffb7c5efbdd200b4932d139a92203 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.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.2 2005/04/11 20:05:40 rocket Exp $
 
 """
 Builder class for LiveCD stage1.
@@ -11,21 +11,28 @@ from generic_stage_target import *
 
 class stage4_target(generic_stage_target):
        def __init__(self,spec,addlargs):
-               self.required_values=["stage4/packages","stage4/use"]
+               #self.required_values=["stage4/use"]
+               self.required_values=[]
                self.valid_values=self.required_values[:]
-               self.valid_values.append("stage4/root_overlay")
+               self.valid_values.extend(["stage4/use", "stage4/packages", "stage4/root_overlay", "stage4/fsscript", \
+                                            "stage4/rcadd","stage4/rcdel"])
                generic_stage_target.__init__(self,spec,addlargs)
        
        def set_use(self):
-                   self.settings["use"]=self.settings["stage4/use"]
+               if self.settings.has_key("use"):
+                       self.settings["use"]=self.settings["stage4/use"]
+               else:
+                       pass
+       def set_cleanables(self):
+               self.settings["cleanables"]=["/var/tmp/*","/tmp/*"]
 
        def set_action_sequence(self):
                self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
                                        "config_profile_link","setup_confdir","portage_overlay",\
-                                       "bind","chroot_setup","setup_environment",\
-                                       "root_overlay","build_packages","preclean","clear_autoresume",\
-                                       "unmerge","unbind","remove","empty","clean","capture"]
-
+                                       "bind","chroot_setup","setup_environment","build_packages",\
+                                       "build_kernel","root_overlay","preclean","rcupdate","fsscript",\
+                                       "clear_autoresume","unmerge","unbind","remove","empty",\
+                                       "clean","capture"]
 
 def register(foo):
        foo.update({"stage4":stage4_target})
index d5bc653007b21b39b45c412231eafe6c8bc414f0..c9d6334341c98bf4eb4e09aa0cccb3c43994bcf2 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.3 2005/04/06 23:23:57 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.4 2005/04/11 20:05:40 rocket Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 
@@ -53,12 +53,14 @@ case $1 in
                
                # now, finalize and tweak the livecd fs (inside of the chroot)
                exec_in_chroot  ${clst_sharedir}/targets/support/livecdfs-update.sh
-               
-               # if the user has their own fs update script, execute it
-               if [ -n "${clst_livecd_fsscript}" ]
-               then
-                       exec_in_chroot ${clst_livecd_fsscript}
-               fi
+               ;;
+
+       rc-update)
+               exec_in_chroot  ${clst_sharedir}/targets/support/rc-update.sh
+               ;;
+
+       fsscript)
+               exec_in_chroot ${clst_fsscript}
                ;;
                
        build_packages)
@@ -69,6 +71,6 @@ case $1 in
 
        clean)
                find ${clst_chroot_path}/usr/lib -iname "*.pyc" -exec rm -f {} \;
-       ;;
+               ;;
 esac
 exit 0 
index fa6bedfbb5d613ebcb69e74decfbe02c690e6948..9d8adb2bc48c3727d3ddafbd8f130d3b4ca2efb5 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.3 2005/04/06 23:23:57 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.4 2005/04/11 20:05:40 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -66,12 +66,13 @@ case $1 in
 
                # now, finalize and tweak the livecd fs (inside of the chroot)
                exec_in_chroot  ${clst_sharedir}/targets/support/livecdfs-update.sh
+               ;;
 
-               # if the user has their own fs update script, execute it
-               if [ -n "${clst_livecd_fsscript}" ]
-               then
-                       exec_in_chroot ${clst_livecd_fsscript}
-               fi
+       rc-update)
+               exec_in_chroot  ${clst_sharedir}/targets/support/rc-update.sh
+               ;;
+       fsscript)
+               exec_in_chroot ${clst_fsscript}
                ;;
 
        clean)
index 1d5730db0e6c682edbeb776439d7c2649575b779..a0dd0da3d76ca571599546bc5e5d62f6624ad1f5 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.1 2005/04/04 17:48:33 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.2 2005/04/11 20:05:40 rocket Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 
 
@@ -11,7 +11,15 @@ case $1 in
        enter)
                ${clst_CHROOT} ${clst_chroot_path}
        ;;
-
+       kernel)
+               shift
+               export clst_kname="$1"
+               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_modules ${clst_chroot_path} ${clst_kname}
+               extract_kernel ${clst_chroot_path}/boot ${clst_kname}
+       ;;
        build_packages)
                shift
                export clst_packages="$*"
@@ -21,6 +29,15 @@ case $1 in
        preclean)
                exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path}
        ;;
+       
+       rc-update)
+               exec_in_chroot  ${clst_sharedir}/targets/support/rc-update.sh
+       ;;
+       
+       fsscript)
+               exec_in_chroot ${clst_fsscript}
+       ;;
+
 
        clean)
                exit 0
diff --git a/targets/stage4/unmerge.sh b/targets/stage4/unmerge.sh
new file mode 100644 (file)
index 0000000..6ed5722
--- /dev/null
@@ -0,0 +1,9 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/Attic/unmerge.sh,v 1.1 2005/04/11 20:05:40 rocket Exp $
+
+${clst_CHROOT} ${clst_chroot_path} /bin/bash << EOF
+       EMERGE_WARNING_DELAY=0 emerge -C $*
+EOF
+
+exit 0
index bf83a2c64e175a1c092ee757da4985e2df6bf9ec..eaeae080fe9a73c2dbde3810e5445531bc5cded7 100755 (executable)
@@ -65,6 +65,7 @@ extract_cdtar() {
 }
 
 extract_kernels() {
+       # extract multiple kernels
        #$1 = Destination
        #${clst_target_path}/kernel is often a good choice for ${1}
 
@@ -112,11 +113,38 @@ extract_kernels() {
 extract_modules() {
        #$1 = Destination
        #$2 = kname     
-       kbinary="${clst_chroot_path}/usr/portage/packages/gk_binaries/${2}-modules-${clst_version_stamp}.tar.bz2"
+       kmodules="${clst_chroot_path}/usr/portage/packages/gk_binaries/${2}-modules-${clst_version_stamp}.tar.bz2"
                
+       [ ! -e "${kmodules}" ] && die "Can't find kernel modules tarball at ${kmodules}"
+       mkdir -p ${1}/
+       tar xjf ${kmodules} -C ${1} lib
+}
+extract_kernel() {
+       #$1 = Destination
+       #$2 = kname     
+       
+       kbinary="${clst_chroot_path}/usr/portage/packages/gk_binaries/${2}-kernel-initrd-${clst_version_stamp}.tar.bz2"
        [ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}"
        mkdir -p ${1}/
-       tar xjf ${kbinary} -C ${1}/ lib
+       tar xjf ${kbinary} -C ${1}/
+       # change config name from "config-*" to "gentoo", for example
+       #mv ${1}/config-* ${1}/${2}-config
+       rm ${1}/config-*
+
+       # change kernel name from "kernel" to "gentoo", for example
+       mv ${1}/kernel-* ${1}/${2}
+       
+       # change initrd name from "initrd" to "gentoo.igz", for example
+       if [ -e ${1}/initrd-* ]
+       then
+               mv ${1}/initrd-* ${1}/${2}.igz
+       fi
+       
+       # change initramfs name from "initramfs" to "gentoo.igz", for example
+       if [ -e ${1}/initramfs-* ]
+       then
+           mv ${1}/initramfs-* ${1}/${2}.igz
+       fi
 }
 
 check_dev_manager(){
index 07975f94742134bb389ef9d55712f1571d4db45d..9309f4545fbb7f53be3379878faf7642bcf37da9 100755 (executable)
@@ -10,7 +10,7 @@ PKGDIR=/usr/portage/packages/gk_binaries/${clst_kname}/ebuilds
 
 setup_gk_args() {
        # default genkernel args
-       GK_ARGS="${clst_livecd_gk_mainargs} \
+       GK_ARGS="${clst_gk_mainargs} \
                         ${clst_kernel_gk_kernargs} \
                         --no-mountboot \
                         --no-install \
@@ -20,14 +20,14 @@ setup_gk_args() {
                         --minkernpackage=/usr/portage/packages/gk_binaries/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 \
                         --kerncache=/usr/portage/packages/gk_binaries/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2 all"
        # extra genkernel options that we have to test for
-       if [ "${clst_livecd_splash_type}" == "bootsplash" -a -n "${clst_livecd_splash_theme}" ]
+       if [ "${clst_splash_type}" == "bootsplash" -a -n "${clst_splash_theme}" ]
        then
-               GK_ARGS="${GK_ARGS} --bootsplash=${clst_livecd_splash_theme}"
+               GK_ARGS="${GK_ARGS} --bootsplash=${clst_splash_theme}"
        fi
        
-       if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
+       if [ "${clst_splash_type}" == "gensplash" -a -n "${clst_splash_theme}" ]
        then
-               GK_ARGS="${GK_ARGS} --gensplash=${clst_livecd_splash_theme}"
+               GK_ARGS="${GK_ARGS} --gensplash=${clst_splash_theme}"
        fi
 
        if [ -n "${clst_CCACHE}" ]
@@ -35,10 +35,8 @@ setup_gk_args() {
                GK_ARGS="${GK_ARGS} --kernel-cc=/usr/lib/ccache/bin/gcc --utils-cc=/usr/lib/ccache/bin/gcc"
        fi
        
-       if [ "${clst_livecd_devmanager}" == "udev" ]
+       if [ "${clst_devmanager}" == "devfs" ]
        then
-               GK_ARGS="${GK_ARGS} --udev"
-       else
                GK_ARGS="${GK_ARGS} --no-udev"
        fi
 }
@@ -70,7 +68,6 @@ genkernel_compile(){
                        genkernel --postconf="PKGDIR=${PKGDIR} emerge -kb ${clst_kernel_postconf}" \
                                ${GK_ARGS} || exit 1
                else
-                       echo "genkernel"
                        genkernel ${GK_ARGS} || exit 1
                fi
        else
@@ -89,7 +86,6 @@ genkernel_compile(){
                        genkernel --postconf="emerge ${clst_kernel_postconf}" \
                                ${GK_ARGS} || exit 1
                else
-                       echo "genkernel"
                        genkernel ${GK_ARGS} || exit 1
                fi
        fi
@@ -161,7 +157,6 @@ then
                        #echo "EXTRAVERSION match"
                        EXTRAVERSION_MATCH=1
                fi
-
        fi
 fi
 
@@ -174,7 +169,7 @@ then
        then 
                if [ -n "${clst_KERNCACHE}" ]
                then
-                       echo "CONFIG match"
+                       #echo "CONFIG match"
                        CONFIG_MATCH=1
                fi
 
@@ -213,15 +208,17 @@ else
        USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
 fi
 
-#if catalyst has set NULL_VALUE, extraversion wasn't specified so we skip this part
+#if catalyst has set to a empty string, extraversion wasn't specified so we skip this part
 if [ "${EXTRAVERSION_MATCH}" != "1" ]
 then
-    if [ "${clst_kextraversion}" != "NULL_VALUE" ]
+    if [ "${clst_kextraversion}" != "" ]
     then
        echo "Setting extraversion to ${clst_kextraversion}"
        sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
+       echo ${clst_kextraversion} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+    else 
+       touch /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
     fi
-    echo ${clst_kextraversion} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
 fi
        
 
index 7aacdc15b449f286c0072f467d0b4acdc4abe468..8e305568c58df940fc6c6b083fd42cd6081082e1 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/support/livecdfs-update.sh,v 1.6 2005/04/08 22:39:45 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.7 2005/04/11 20:05:40 rocket Exp $
 
 /usr/sbin/env-update
 source /etc/profile
@@ -15,55 +15,6 @@ fi
 # turn off udev tarball
 sed -i 's:RC_DEVICE_TARBALL="yes":RC_DEVICE_TARBALL="no":' /etc/conf.d/rc
 
-
-# default programs that we always want to start
-rc-update del iptables default
-rc-update del netmount default
-rc-update add autoconfig default
-rc-update del keymaps
-rc-update del serial
-rc-update del consolefont
-rc-update add modules default
-rc-update add pwgen default
-[ -e /etc/init.d/bootsplash ] && rc-update add bootsplash default
-[ -e /etc/init.d/splash ] && rc-update add splash default
-[ -e /etc/init.d/sysklogd ] && rc-update add sysklogd default
-[ -e /etc/init.d/metalog ] && rc-update add metalog default
-[ -e /etc/init.d/syslog-ng ] && rc-update add syslog-ng default
-[ -e /etc/init.d/alsasound ] && rc-update add alsasound default
-[ -e /etc/init.d/hdparm ] && rc-update add hdparm default
-
-# Do some livecd_type specific rc-update changes
-case ${clst_livecd_type} in
-       gentoo-gamecd )
-               # we add spind to default here since we don't want the CD to spin down
-               rc-update add spind default
-               rc-update add x-setup default
-       ;;
-       *)
-       ;;
-esac
-
-# perform any rcadd then any rcdel
-if [ -n "${clst_livecd_rcadd}" ] || [ -n "${clst_livecd_rcdel}" ]
-then
-       if [ -n "${clst_livecd_rcadd}" ]
-       then
-               for x in ${clst_livecd_rcadd}
-               do
-                       rc-update add "${x%%:*}" "${x##*:}"
-               done
-       fi
-       
-       if [ -n "${clst_livecd_rcdel}" ]
-       then
-               for x in ${clst_livecd_rcdel}
-               do
-                       rc-update del "${x%%:*}" "${x##*:}"
-               done
-       fi
-fi
-
 # Comment out current getty settings
 sed -i -e '/^c[0-9]/ s/^/#/' /etc/inittab
 
diff --git a/targets/support/rc-update.sh b/targets/support/rc-update.sh
new file mode 100644 (file)
index 0000000..3532d7d
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${clst_spec_prefix}" == "livecd" ]
+then
+    # default programs that we always want to start
+    rc-update del iptables default
+    rc-update del netmount default
+    rc-update add autoconfig default
+    rc-update del keymaps
+    rc-update del serial
+    rc-update del consolefont
+    rc-update add modules default
+    rc-update add pwgen default
+    [ -e /etc/init.d/bootsplash ] && rc-update add bootsplash default
+    [ -e /etc/init.d/splash ] && rc-update add splash default
+    [ -e /etc/init.d/sysklogd ] && rc-update add sysklogd default
+    [ -e /etc/init.d/metalog ] && rc-update add metalog default
+    [ -e /etc/init.d/syslog-ng ] && rc-update add syslog-ng default
+    [ -e /etc/init.d/alsasound ] && rc-update add alsasound default
+    [ -e /etc/init.d/hdparm ] && rc-update add hdparm default
+
+    # Do some livecd_type specific rc-update changes
+    case ${clst_livecd_type} in
+           gentoo-gamecd )
+               # we add spind to default here since we don't want the CD to spin down
+               rc-update add spind default
+               rc-update add x-setup default
+           ;;
+           *)
+           ;;
+    esac
+fi
+
+# perform any rcadd then any rcdel
+if [ -n "${clst_rcadd}" ] || [ -n "${clst_rcdel}" ]
+then
+    if [ -n "${clst_rcadd}" ]
+    then
+       for x in ${clst_rcadd}
+       do
+           rc-update add "${x%%:*}" "${x##*:}"
+       done
+    fi
+
+    if [ -n "${clst_rcdel}" ]
+    then
+       for x in ${clst_rcdel}
+       do
+           rc-update del "${x%%:*}" "${x##*:}"
+       done
+    fi
+fi
+