livecd-stage2 initial commit
authorDaniel Robbins <drobbins@gentoo.org>
Tue, 23 Dec 2003 04:59:22 +0000 (04:59 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Tue, 23 Dec 2003 04:59:22 +0000 (04:59 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@107 d1e1f19c-881f-0410-ab34-b69fee027534

examples/x86-livecd-stage2-20031215.spec [new file with mode: 0644]
modules/targets.py
targets/livecd-stage2/livecd-stage2.sh [new file with mode: 0755]

diff --git a/examples/x86-livecd-stage2-20031215.spec b/examples/x86-livecd-stage2-20031215.spec
new file mode 100644 (file)
index 0000000..de1ea15
--- /dev/null
@@ -0,0 +1,10 @@
+subarch: x86
+version_stamp: 20031215
+target: livecd-stage2
+rel_type: default
+rel_version: 1.4
+snapshot: 20031215
+source_subpath: default-x86-1.4/livecd-stage1-x86-20031215
+boot/kernel: gentoo
+boot/kernel/gentoo/sources: =sys-kernel/gentoo-dev-sources-2.6.0
+boot/kernel/gentoo/config: /path/to/mykernelconfig
index ab6e30f8f13963ced432e1c67dc5b2427e5f7f3e..d1a669fb86adef553d884730924d91202c4de441 100644 (file)
@@ -265,6 +265,23 @@ class generic_stage_target(generic_target):
                        except CatalystError:
                                self.unbind()
                                raise CatalystError,"GRP build aborting due to error."
+               elif self.settings["target"]=="livecd-stage2":
+                       mynames=self.settings["boot/kernel"]
+                       if type(mynames)==types.StringType:
+                               mynames=[mynames]
+                       args=`len(mynames)`
+                       for x in mynames:
+                               args=args+" "+x+" "+self.settings["boot/kernel/"+x+"/sources"]
+                               if not os.path.exists(self.settings["boot/kernel/"+x+"/config"]:
+                                       raise CatalystError, "Can't find kernel config: "+self.settings["boot/kernel/"+x+"/config"]
+                               retval=os.system("cp "+self.settings["boot/kernel/"+x+"/config "+self.settings["chroot_dir"]+"/var/tmp/"+x+".config")
+                               if retval!=0:
+                                       raise CatalystError, "Couldn't copy kernel config: "+self.settings["boot/kernel/"+x+"/config"]
+                       try:
+                               cmd(self.settings["sharedir"]+"/targets/livecd-stage2/livecd-stage2.sh run "+args))
+                       except CatalystError:
+                               self.unbind()
+                               raise CatalystError,"GRP build aborting due to error."
                else:
                        #tinderbox
                        #example call: "grp.sh run xmms vim sys-apps/gleep"
@@ -354,8 +371,12 @@ class livecd_stage1_target(generic_stage_target):
        def __init__(self,spec,addlargs):
                generic_target.__init__(self,spec,addlargs)
 
+class livecd_stage2_target(generic_stage_target):
+       def __init__(self,spec,addlargs):
+               generic_target.__init__(self,spec,addlargs)
+
 def register(foo):
        foo.update({"stage1":stage1_target,"stage2":stage2_target,"stage3":stage3_target,
-       "grp":grp_target,"livecd-stage1":livecd_stage1_target,"snapshot":snapshot_target,"tinderbox":tinderbox_target})
+       "grp":grp_target,"livecd-stage1":livecd_stage1_target,"livecd-stage2":livecd_stage2_target,"snapshot":snapshot_target,"tinderbox":tinderbox_target})
        return foo
        
diff --git a/targets/livecd-stage2/livecd-stage2.sh b/targets/livecd-stage2/livecd-stage2.sh
new file mode 100755 (executable)
index 0000000..fd94c92
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/Attic/livecd-stage2.sh,v 1.1 2003/12/23 04:59:22 drobbins Exp $
+
+case $1 in
+enter)
+       $clst_CHROOT $clst_chroot_path
+       ;;
+run)
+       numkernels="$1"
+       shift
+       count=0
+       while [ $count -lt $numkernels ]
+       do
+               clst_ksource="$1"
+               shift
+               clst_kname="$1"
+               shift
+               $clst_CHROOT $clst_chroot_path /bin/bash << EOF
+               env-update
+               source /etc/profile
+               export CONFIG_PROTECT="-*"
+               emerge genkernel
+               rm -f /usr/src/linux
+               if [ -n "${clst_PKGCACHE}" ]
+               then
+                       emerge --usepkg --buildpkg --noreplace $clst_ksource || exit 1
+               else
+                       emerge --noreplace $clst_ksource || exit 1
+               fi
+               genkernel --kerneldir=/usr/src/linux --kernel-config=/var/tmp/$clst_kname.config --kernelpackage=/var/tmp/$clst_kname.tar.gz || exit 1
+               emerge -C genkernel $clst_ksource
+EOF
+               [ $? -ne 0 ] && exit 1
+               count=$(( $count + 1 ))
+       done
+       ;;
+*)
+       exit 1
+       ;;
+esac
+exit 0