local overlay profile
if [[ $1 == -o ]]; then
	overlay=$2
	shift 2
else
	overlay=ccx-packages
fi

[[ -d $build_dir/var/portage/$overlay ]] || die "overlay dir ${(qqq)overlay} not found"

for profile in "$@"; do
	[[ $profile != /* ]] && \
		profile=/var/portage/$overlay/profiles/$profile
	print -r - $profile >>$build_dir/var/portage/local/profiles/custom/parent || die
done

if [[ -x $build_dir/var/portage/$overlay/scripts/update_profiles ]]; then
	fsb_chroot_bash /var/portage/$overlay/scripts/update_profiles || die update_profiles
fi