# 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.71 2004/07/13 14:06:44 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.72 2004/07/14 17:23:16 zhen Exp $
+
+ 14 Jul 2004; John Davis <zhen@gentoo.org>
+ livecd/runscript-support/livecdfs-update.sh,
+ modules/generic_stage_target.py, modules/livecd_stage2_target.py:
+ fixed a bug for livecd-stage2. somehow, the inheritance got mucked up and the
+ livecds were not cleaning out livecd/empty livecd/rm etc. I moved the code for
+ this out of generic_stage_target and into livecd-stage2 since the
+ livecd-stage2 class was overriding generic_stage_target for cleaning anyway.
13 Jul 2004; <zhen@gentoo.org> livecd/runscript-support/livecdfs-update.sh:
changed the behavior of rcadd/ rcdel. it was getting hokey to have to add the
#!/bin/bash
# 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-support/Attic/livecdfs-update.sh,v 1.7 2004/07/13 14:06:44 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.8 2004/07/14 17:23:16 zhen Exp $
/usr/sbin/env-update
source /etc/profile
# fix /etc/issue for mingetty and friends
echo "This is \n.gentoo (\s \m \r) \t" > /etc/issue
+# switch the order of rcadd/ rcdel
if [ -n "${clst_livecd_rcadd}" ] || [ -n "${clst_livecd_rcdel}" ]
then
if [ -n "${clst_livecd_rcadd}" ]
# Distributed under the GNU General Public License version 2
# Copyright 2003-2004 Gentoo Technologies, Inc.
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.6 2004/07/06 13:48:00 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.7 2004/07/14 17:23:16 zhen Exp $
"""
This class does all of the chroot setup, copying of files, etc. It is
def clean(self):
destpath=self.settings["chroot_path"]
- cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*"]
- if self.settings["target"] not in ["livecd-stage2"]:
- # we don't need to clean up a livecd-stage2
- cleanables.append("/usr/portage")
+ cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*","/usr/portage"]
if self.settings["target"]=="stage1":
destpath+="/tmp/stage1root"
print "Cleaning chroot: "+x+"..."
cmd("rm -rf "+destpath+x,"Couldn't clean "+x)
- if self.settings["target"]=="livecd-stage2":
-
- if self.settings.has_key("livecd/empty"):
-
- if type(self.settings["livecd/empty"])==types.StringType:
- self.settings["livecd/empty"]=[self.settings["livecd/empty"]]
-
- for x in self.settings["livecd/empty"]:
- myemp=self.settings["chroot_path"]+x
- if not os.path.isdir(myemp):
- print x,"not a directory or does not exist, skipping 'empty' operation."
- continue
- print "Emptying directory",x
- # stat the dir, delete the dir, recreate the dir and set the proper perms and ownership
- mystat=os.stat(myemp)
- shutil.rmtree(myemp)
- os.makedirs(myemp)
- os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
- os.chmod(myemp,mystat[ST_MODE])
-
- if self.settings.has_key("livecd/rm"):
-
- if type(self.settings["livecd/rm"])==types.StringType:
- self.settings["livecd/rm"]=[self.settings["livecd/rm"]]
-
- for x in self.settings["livecd/rm"]:
- # we're going to shell out for all these cleaning operations, so we get easy glob handling
- print "livecd: removing "+x
- os.system("rm -rf "+self.settings["chroot_path"]+x)
-
- if self.settings["target"]!="livecd-stage2":
- cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+\
- "/"+self.settings["target"]+".sh clean","clean script failed.")
+ cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+\
+ "/"+self.settings["target"]+".sh clean","clean script failed.")
def preclean(self):
# cleanup after distcc
# Distributed under the GNU General Public License version 2
# Copyright 2003-2004 Gentoo Technologies, Inc.
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.14 2004/07/14 04:26:45 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.15 2004/07/14 17:23:16 zhen Exp $
"""
Builder class for a LiveCD stage2 build.
"""
-import os,string,types
+import os,string,types,stat,shutil
from catalyst_support import *
from generic_stage_target import *
touch(self.settings["chroot_path"]+"/tmp/.clst_unmerge")
def clean(self):
+ if self.settings.has_key("livecd/empty"):
+
+ if type(self.settings["livecd/empty"])==types.StringType:
+ self.settings["livecd/empty"]=[self.settings["livecd/empty"]]
+
+ for x in self.settings["livecd/empty"]:
+ myemp=self.settings["chroot_path"]+x
+ if not os.path.isdir(myemp):
+ print x,"not a directory or does not exist, skipping 'empty' operation."
+ continue
+ print "Emptying directory",x
+ # stat the dir, delete the dir, recreate the dir and set
+ # the proper perms and ownership
+ mystat=os.stat(myemp)
+ shutil.rmtree(myemp)
+ os.makedirs(myemp)
+ os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+ os.chmod(myemp,mystat[ST_MODE])
+
+ if self.settings.has_key("livecd/rm"):
+
+ if type(self.settings["livecd/rm"])==types.StringType:
+ self.settings["livecd/rm"]=[self.settings["livecd/rm"]]
+
+ for x in self.settings["livecd/rm"]:
+ # we're going to shell out for all these cleaning operations,
+ # so we get easy glob handling
+ print "livecd: removing "+x
+ os.system("rm -rf "+self.settings["chroot_path"]+x)
+
try:
cmd("/bin/bash "+self.settings["livecd/runscript"]+" clean",\
"Clean runscript failed.")