From eefa0cc605538a0017ad11ef90c5b226f282bba4 Mon Sep 17 00:00:00 2001 From: "John P. Davis" Date: Tue, 30 Mar 2004 19:45:14 +0000 Subject: [PATCH] more bufixes, check changelog git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@327 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 7 ++++- livecd/runscript/default-runscript.sh | 10 ++++-- modules/targets.py | 44 ++++++++++----------------- targets/stage1/build.sh | 6 ++-- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30851066..a8351033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.28 2004/03/26 17:03:29 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.29 2004/03/30 19:45:14 zhen Exp $ + + 30 Mar 2004; John Davis + livecd/runscript/default-runscript.sh, modules/targets.py, + targets/stage1/build.sh: + fix for bug 46022, more stackable profile fixes, embedded patches added 26 Mar 2004; John Davis livecd/runscript/default-runscript.sh, modules/targets.py, diff --git a/livecd/runscript/default-runscript.sh b/livecd/runscript/default-runscript.sh index 3c2762da..8c4b6926 100644 --- a/livecd/runscript/default-runscript.sh +++ b/livecd/runscript/default-runscript.sh @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.4 2004/03/26 17:03:29 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.5 2004/03/30 19:45:14 zhen Exp $ #return codes to be used by archscript @@ -181,7 +181,7 @@ EOF #!/sbin/runscript # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.4 2004/03/26 17:03:29 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.5 2004/03/30 19:45:14 zhen Exp $ depend() { after * @@ -226,6 +226,12 @@ EOF sed -i -e '/\/dev\/[RBS]*/ s/^/#/' /etc/fstab echo "tmpfs / tmpfs defaults 0 0" >> /etc/fstab sed -i -e '/dev-state/ s/^/#/' /etc/devfsd.conf + + echo "alias cp='cp -i'" >> /etc/profile + echo "alias ls='ls --color'" >> /etc/profile + echo "alias mv='mv -i'" >> /etc/profile + echo "alias pico='nano -w'" >> /etc/profile + echo "alias rm='rm -i'" >> /etc/profile # END OF SCRIPT TO UPDATE FILESYSTEM EOF [ $? -ne 0 ] && exit 1 diff --git a/modules/targets.py b/modules/targets.py index 2907beff..d10d0912 100644 --- a/modules/targets.py +++ b/modules/targets.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.95 2004/03/26 17:03:29 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.96 2004/03/30 19:45:14 zhen Exp $ import os,string,imp,types,shutil from catalyst_support import * @@ -17,8 +17,8 @@ class generic_stage_target(generic_target): def __init__(self,myspec,addlargs): - self.required_values.extend(["version_stamp","target","subarch","rel_type","rel_version","snapshot","source_subpath"]) - self.valid_values.extend(["version_stamp","target","subarch","rel_type","rel_version","snapshot","source_subpath"]) + self.required_values.extend(["version_stamp","target","subarch","rel_type","profile","snapshot","source_subpath"]) + self.valid_values.extend(["version_stamp","target","subarch","rel_type","profile","snapshot","source_subpath"]) generic_target.__init__(self,addlargs,myspec) # map the mainarch we are running under to the mainarches we support for # building stages and LiveCDs. (for example, on amd64, we can build stages for @@ -79,10 +79,9 @@ class generic_stage_target(generic_target): print "Building natively for",self.settings["hostarch"] else: print "Building on",self.settings["hostarch"],"for alternate machine type",self.settings["mainarch"] - #we are going to do a little hack for stackable profile integration here. - #if rel_version does not exist, then assume that the profile is stackable. - self.settings["target_profile"]=self.settings["rel_type"]+"-"+self.settings["mainarch"]+"-"+self.settings["rel_version"] - self.settings["target_subpath"]=self.settings["target_profile"]+"/"+self.settings["target"]+"-"+self.settings["subarch"]+"-"+self.settings["version_stamp"] + + self.settings["target_profile"]=self.settings["profile"] + self.settings["target_subpath"]=self.settings["rel_type"]+"/"+self.settings["target"]+"-"+self.settings["subarch"]+"-"+self.settings["version_stamp"] st=self.settings["storedir"] self.settings["snapshot_path"]=st+"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2" if self.settings["target"] in ["grp","tinderbox"]: @@ -288,6 +287,8 @@ class generic_stage_target(generic_target): print "Creating stage tarball..." if self.settings["target"]=="stage1": cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+"/tmp/stage1root .","Couldn't create stage tarball") + elif self.settings["target"]=="embedded": + cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+"/tmp/mergeroot .","Couldn't create stage tarball") else: cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+" .","Couldn't create stage tarball") @@ -385,7 +386,7 @@ class stage3_target(generic_stage_target): class grp_target(generic_stage_target): def __init__(self,spec,addlargs): - self.required_values=["version_stamp","target","subarch","rel_type","rel_version","snapshot","source_subpath"] + self.required_values=["version_stamp","target","subarch","rel_type","profile","snapshot","source_subpath"] self.valid_values=self.required_values[:] if not addlargs.has_key("grp"): raise CatalystError,"Required value \"grp\" not specified in spec." @@ -614,22 +615,22 @@ class embedded_target(generic_stage_target): if self.settings.has_key("embedded/unmerge"): if type(self.settings["embedded/unmerge"])==types.StringType: self.settings["embedded/unmerge"]=[self.settings["embedded/unmerge"]] - myunmerge=self.settings["embedded/unmerge"][:] + myunmerge=self.settings["embedded/unmerge"][:] for x in range(0,len(myunmerge)): myunmerge[x]="'"+myunmerge[x]+"'" - myunmerge=string.join(myunmerge) + myunmerge=string.join(myunmerge) # before cleaning unmerge stuff cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/unmerge.sh "+myunmerge,"unmerge script failed.") def clean(self): if self.settings.has_key("embedded/rm"): if type(self.settings["embedded/rm"])==types.StringType: - self.settings["lembedded/rm"]=[self.settings["embedded/rm"]] - print "Removing directories from image" - for x in self.settings["embedded/rm"]: - print "Removing "+x - os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x) + self.settings["embedded/rm"]=[self.settings["embedded/rm"]] + print "Removing directories from image" + for x in self.settings["embedded/rm"]: + print "Removing "+x + os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x) def run_local(self): mypackages=list_bashify(self.settings["embedded/packages"]) print "Merging embedded image" @@ -646,19 +647,6 @@ class embedded_target(generic_stage_target): except CatalystError: self.unbind() raise CatalystError, "embedded runscript aborting due to error." - - - def capture(self): - """capture target in a tarball""" - mypath=self.settings["target_path"].split("/") - #remove filename from path - mypath=string.join(mypath[:-1],"/") - #now make sure path exists - if not os.path.exists(mypath): - os.makedirs(mypath) - print "Creating stage tarball..." - cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+"/tmp/mergeroot .","Couldn't create stage tarball") - def register(foo): foo.update({"stage1":stage1_target,"stage2":stage2_target,"stage3":stage3_target, diff --git a/targets/stage1/build.sh b/targets/stage1/build.sh index 086e02c2..2513dbb3 100755 --- a/targets/stage1/build.sh +++ b/targets/stage1/build.sh @@ -1,11 +1,11 @@ #!/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/stage1/Attic/build.sh,v 1.5 2003/11/05 17:03:57 drobbins Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/build.sh,v 1.6 2004/03/30 19:45:14 zhen Exp $ -for x in `cat /usr/portage/profiles/${clst_rel_type}-${clst_mainarch}-${clst_rel_version}/packages.build | grep -v '^#'` +for x in `cat /etc/make.profile/packages.build | grep -v '^#'` do - myp=$(grep -E "${x}(-[^[:space:]]*)?[[:space:]]*$" /usr/portage/profiles/${clst_rel_type}-${clst_mainarch}-${clst_rel_version}/packages | grep -v '^#' | sed -e 's:^\*::' | cat ) + myp=$(grep -E "${x}(-[^[:space:]]*)?[[:space:]]*$" /etc/make.profile/packages | grep -v '^#' | sed -e 's:^\*::' | cat ) if [ "$myp" = "" ] then #if not in the system profile, include it anyway -- 2.26.2