From 8f11a3eb90a5321bd43ba74c6b530ba1039bf94a Mon Sep 17 00:00:00 2001 From: Daniel Robbins Date: Tue, 23 Dec 2003 04:59:22 +0000 Subject: [PATCH] livecd-stage2 initial commit git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@107 d1e1f19c-881f-0410-ab34-b69fee027534 --- examples/x86-livecd-stage2-20031215.spec | 10 ++++++ modules/targets.py | 23 ++++++++++++- targets/livecd-stage2/livecd-stage2.sh | 42 ++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 examples/x86-livecd-stage2-20031215.spec create mode 100755 targets/livecd-stage2/livecd-stage2.sh diff --git a/examples/x86-livecd-stage2-20031215.spec b/examples/x86-livecd-stage2-20031215.spec new file mode 100644 index 00000000..de1ea157 --- /dev/null +++ b/examples/x86-livecd-stage2-20031215.spec @@ -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 diff --git a/modules/targets.py b/modules/targets.py index ab6e30f8..d1a669fb 100644 --- a/modules/targets.py +++ b/modules/targets.py @@ -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 index 00000000..fd94c92b --- /dev/null +++ b/targets/livecd-stage2/livecd-stage2.sh @@ -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 -- 2.26.2