# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.664 2006/10/02 20:41:53 wolf31o2 Exp $
+ 11 Oct 2006; Chris Gianelloni <wolf31o2@gentoo.org> AUTHORS,
+ modules/generic_stage_target.py, targets/stage1/stage1-controller.sh,
+ targets/support/chroot-functions.sh:
+ Added initial Gentoo/FreeBSD support. Patch from Diego Pettenò
+ <flameeyes@gentoo.org> and attached to bug #150351.
+
02 Oct 2006; Chris Gianelloni <wolf31o2@gentoo.org> README, arch/alpha.py,
arch/amd64.py, arch/arm.py, arch/hppa.py, arch/ia64.py, arch/mips.py,
arch/ppc.py, arch/ppc64.py, arch/s390.py, arch/sh.py, arch/sparc.py,
# setup our mount points
if self.settings.has_key("SNAPCACHE"):
- self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage","/usr/portage/distfiles" ]
+ self.mounts=[ "/proc","/dev","/usr/portage","/usr/portage/distfiles" ]
self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
"/usr/portage/distfiles":self.settings["distdir"]}
else:
- self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage/distfiles" ]
+ self.mounts=[ "/proc","/dev","/usr/portage/distfiles" ]
self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
"/usr/portage/distfiles":self.settings["distdir"]}
+ if os.uname()[0] == "Linux":
+ self.mounts.append("/dev/pts")
self.set_mounts()
src=self.mountmap[x]
if self.settings.has_key("SNAPCACHE") and x == "/usr/portage":
self.snapshot_lock_object.read_lock()
- retval=os.system("mount --bind "+src+" "+self.settings["chroot_path"]+x)
+ if os.uname()[0] == "FreeBSD":
+ if src == "/dev":
+ retval=os.system("mount -t devfs none "+self.settings["chroot_path"]+x)
+ else:
+ retval=os.system("mount_nullfs "+src+" "+self.settings["chroot_path"]+x)
+ else:
+ retval=os.system("mount --bind "+src+" "+self.settings["chroot_path"]+x)
if retval!=0:
self.unbind()
raise CatalystError,"Couldn't bind mount "+src
# it's not mounted, continue
continue
- retval=os.system("umount "+mypath+x)
+ retval=os.system("umount "+os.path.join(mypath,x.lstrip(os.path.sep)))
if retval!=0:
warn("First attempt to unmount: "+mypath+x+" failed.")
# the proper perms and ownership
mystat=os.stat(myemp)
#cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp,env=self.env)
+ if os.uname()[0] == "FreeBSD": # There's no easy way to change flags recursively in python
+ os.system("chflags -R noschg "+myemp)
shutil.rmtree(myemp)
os.makedirs(myemp,0755)
os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
# Clean out man, info and doc files
rm -rf usr/share/{man,doc,info}/*
# Zap all .pyc and .pyo files
- find -iname "*.py[co]" -exec rm -f {} \;
+ find . -iname "*.py[co]" -exec rm -f {} \;
# Cleanup all .a files except libgcc.a, *_nonshared.a and
# /usr/lib/portage/bin/*.a
- find -type f -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' \
+ find . -type f -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' \
| grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \
rm -f
;;