diff -Nur catalyst-2.0.11.orig/arch/x86.py catalyst-2.0.11/arch/x86.py --- catalyst-2.0.11.orig/arch/x86.py 2012-09-09 06:38:02.000000000 +0900 +++ catalyst-2.0.11/arch/x86.py 2012-10-13 17:25:26.000000000 +0900 @@ -7,9 +7,12 @@ def __init__(self,myspec): builder.generic.__init__(self,myspec) if self.settings["buildarch"]=="amd64": - if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"): - raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)" - self.settings["CHROOT"]="linux32 chroot" + if os.uname()[0] == "Linux": + if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"): + raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)" + self.settings["CHROOT"]="linux32 chroot" + else: + self.settings["CHROOT"]="chroot" self.settings["crosscompile"] = False; else: self.settings["CHROOT"]="chroot" diff -Nur catalyst-2.0.11.orig/modules/generic_stage_target.py catalyst-2.0.11/modules/generic_stage_target.py --- catalyst-2.0.11.orig/modules/generic_stage_target.py 2012-09-09 06:38:02.000000000 +0900 +++ catalyst-2.0.11/modules/generic_stage_target.py 2012-10-13 17:32:58.000000000 +0900 @@ -400,7 +400,7 @@ def set_cleanables(self): self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\ - "/root/*","/usr/portage"] + "/root/*","/usr/portage","/etc/portage/make.conf.catalyst"] def set_snapshot_path(self): self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ @@ -1083,9 +1083,15 @@ if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"): cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\ "Could not remove /usr/local/portage",env=self.env) - cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ - "/etc/portage/make.conf",\ - "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) + if os.path.exists(self.settings["chroot_path"]+"/etc/portage/make.conf"): + if os.path.exists("/usr/bin/gsed"): + cmd("gsed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ + "/etc/portage/make.conf",\ + "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) + else: + cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ + "/etc/portage/make.conf",\ + "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) """ Clean up old and obsoleted files in /etc """ if os.path.exists(self.settings["stage_path"]+"/etc"): diff -Nur catalyst-2.0.11.orig/modules/stage1_target.py catalyst-2.0.11/modules/stage1_target.py --- catalyst-2.0.11.orig/modules/stage1_target.py 2012-09-09 06:38:02.000000000 +0900 +++ catalyst-2.0.11/modules/stage1_target.py 2012-10-13 17:25:26.000000000 +0900 @@ -92,10 +92,14 @@ # stage_path/proc probably doesn't exist yet, so create it if not os.path.exists(self.settings["stage_path"]+"/proc"): os.makedirs(self.settings["stage_path"]+"/proc") + if not os.path.exists(self.settings["stage_path"]+"/dev"): + os.makedirs(self.settings["stage_path"]+"/dev") # alter the mount mappings to bind mount proc onto it self.mounts.append("/tmp/stage1root/proc") self.mountmap["/tmp/stage1root/proc"]="/proc" + self.mounts.append("/tmp/stage1root/dev") + self.mountmap["/tmp/stage1root/dev"]="/dev" def set_update_seed(self): if self.settings.has_key("update_seed"): diff -Nur catalyst-2.0.11.orig/targets/stage3/stage3-chroot.sh catalyst-2.0.11/targets/stage3/stage3-chroot.sh --- catalyst-2.0.11.orig/targets/stage3/stage3-chroot.sh 2012-09-09 06:38:02.000000000 +0900 +++ catalyst-2.0.11/targets/stage3/stage3-chroot.sh 2012-10-13 17:25:26.000000000 +0900 @@ -5,4 +5,11 @@ ## START BUILD setup_pkgmgr -run_merge "-e system" +if [[ $(uname) == "FreeBSD" ]] ; then + # workaround fix bug 438112 + run_merge "-e @system --exclude=sys-apps/portage" + run_merge "sys-apps/portage" +else + run_merge "-e system" +fi + diff -Nur catalyst-2.0.11.orig/targets/support/chroot-functions.sh catalyst-2.0.11/targets/support/chroot-functions.sh --- catalyst-2.0.11.orig/targets/support/chroot-functions.sh 2012-09-09 06:38:02.000000000 +0900 +++ catalyst-2.0.11/targets/support/chroot-functions.sh 2012-10-13 17:25:26.000000000 +0900 @@ -413,5 +413,22 @@ Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop } +# GNU sed wrapper +sed(){ + if [ -e /usr/bin/gsed ] + then + /usr/bin/gsed "$@" + elif [ -e /bin/sed ] + then + /bin/sed "$@" + elif [ -e /usr/bin/sed ] + then + /usr/bin/sed "$@" + else + echo "ERROR: failed the selection of sed." + exit 1 + fi +} + # We do this everywhere, so why not put it in this script run_default_funcs