# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
# $Id: $
+ 10 Apr 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+ targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh,
+ targets/livecd-stage1/livecd-stage1-chroot.sh,
+ targets/netboot/netboot-chroot.sh, targets/netboot/netboot-combine.sh,
+ targets/netboot2/netboot2-pkg.sh, targets/stage1/stage1-chroot.sh,
+ targets/stage1/stage1-controller.sh, targets/stage2/stage2-chroot.sh,
+ targets/stage3/stage3-chroot.sh, targets/stage4/stage4-chroot.sh,
+ targets/support/chroot-functions.sh, targets/support/kmerge.sh,
+ targets/support/pre-kmerge.sh:
+ Added setup_myemergeopts to setup_myfeatures and removed redundant calls to
+ setup_myemergeopts. Added some extra checks for clst_FETCH to disable
+ certain functions/code paths when running with -F/--fetchonly. Simplified
+ kmerge.sh with regards to kerncache and callback packages. Also, changed
+ ccache/distcc installs to use run_emerge instead of emerge directly, which
+ allows us to more easily replace the underlying package manager, or add
+ support for multiple package managers to catalyst.
+
20 Mar 2007; Chris Gianelloni <wolf31o2@gentoo.org> catalyst,
modules/grp_target.py:
Added patch from Åsmund Grammeltvedt <grammel@online.no> to add
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup the environment
export FEATURES="${clst_myfeatures}"
unset DISTDIR
export PKGDIR="/tmp/grp/${clst_grp_target}"
- if [ -n "${clst_FETCH}" ]
- then
- export clst_myemergeopts="${clst_myemergeopts} -f"
- fi
-
- if [ -n "${clst_VERBOSE}" ]
- then
- emerge --usepkg --buildpkg --noreplace --newuse -vp \
- ${clst_myemergeopts} ${clst_grp_packages} || exit 1
- echo "Press any key within 15 seconds to pause the build..."
- read -s -t 15 -n 1
- if [ $? -eq 0 ]
- then
- echo "Press any key to continue..."
- read -s -n 1
- fi
- fi
- emerge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
+ run_emerge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
${clst_grp_packages} || exit 1
else
- DISTDIR="/tmp/grp/${clst_grp_target}" emerge --fetchonly \
+ DISTDIR="/tmp/grp/${clst_grp_target}" run_emerge --fetchonly \
${clst_grp_packages} || exit 1
unset PKGDIR
fi
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup the environment
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup our environment
export FEATURES="${clst_myfeatures}"
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Ssetup our environment
export FEATURES="${clst_myfeatures}"
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup our environment
export FEATURES="${clst_myfeatures}"
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup our environment
export clst_buildpkgs="$(/tmp/build.py)"
;;
preclean)
# Before we enter the chroot, we need to run gcc-config/binutils-config
- if [ -x /usr/bin/gcc-config ]
+ if [ -x /usr/bin/gcc-config ] && [ -z "${clst_FETCH}" ]
then
mythang=$( cd ${clst_chroot_path}/tmp/stage1root/etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
if [ -z "${mythang}" ]
CHOST=${clst_CHOST} \
gcc-config ${mythang}
fi
- if [ -x /usr/bin/binutils-config ]
+ if [ -x /usr/bin/binutils-config ] && [ -z "${clst_FETCH}" ]
then
mythang=$( cd ${clst_chroot_path}/tmp/stage1root/etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 )
if [ -z "${mythang}" ]
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup the environment
export FEATURES="${clst_myfeatures} nodoc noman noinfo"
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup the build environment
export FEATURES="${clst_myfeatures}"
export USE="${USE} ${clst_HOSTUSE}"
## START BUILD
-# portage needs to be merged manually with USE="build" set to avoid frying our
-# make.conf. emerge system could merge it otherwise.
+# We need portage to be merged manually with USE="build" set to avoid frying
+# our make.conf, otherwise, the system target could take care of it.
setup_portage
update_env_settings
setup_myfeatures
-setup_myemergeopts
# Setup the environment
export FEATURES="${clst_myfeatures}"
}
setup_myfeatures(){
+ setup_myemergeopts
if [ -n "${clst_CCACHE}" ]
then
export clst_myfeatures="${clst_myfeatures} ccache"
#then
# echo "CCACHE Autoresume point found not emerging ccache"
#else
- emerge --oneshot --nodeps -b -k ccache || exit 1
+ run_emerge --oneshot --nodeps ccache || exit 1
# touch /tmp/.clst_ccache
#fi
fi
#then
# echo "DISTCC Autoresume point found not emerging distcc"
#else
- USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
+ USE="-gtk -gnome" run_emerge --oneshot --nodeps distcc || exit 1
#touch /tmp/.clst_distcc
#fi
mkdir -p /etc/distcc
fi
# Build with genkernel using the set options
# callback is put here to avoid escaping issues
+ gk_callback_opts="-q"
+ PKGDIR=${PKGDIR}
if [ -n "${clst_KERNCACHE}" ]
then
- if [ "$clst_kernel_merge" != "" ]
- then
- genkernel --callback="PKGDIR=${PKGDIR} emerge -kqb \
- ${clst_kernel_merge}" ${GK_ARGS} || exit 1
- else
- genkernel ${GK_ARGS} || exit 1
- fi
+ gk_callback_opts="${gk_callback_opts} -kb"
+ fi
+ if [ -n "${clst_FETCH}" ]
+ then
+ gk_callback_opts="${gk_callback_opts} -f"
+ fi
+ if [ "${clst_kernel_merge}" != "" ]
+ then
+ genkernel --callback="emerge ${gk_callback_opts} ${clst_kernel_merge}" \
+ ${GK_ARGS} || exit 1
else
- if [ "$clst_kernel_merge" != "" ]
- then
- genkernel --callback="emerge -q ${clst_kernel_merge}" \
- ${GK_ARGS} || exit 1
- else
- genkernel ${GK_ARGS} || exit 1
- fi
+ genkernel ${GK_ARGS} || exit 1
fi
md5sum /var/tmp/${clst_kname}.config|awk '{print $1}' > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
}
source /etc/profile
setup_myfeatures
-setup_myemergeopts
[ -n "${clst_ENVSCRIPT}" ] && source /tmp/envscript
export CONFIG_PROTECT="-*"
echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
fi
fi
- [ -d /usr/src/linux ] && rm /usr/src/linux
+ [ -d /usr/src/linux ] && rm /usr/src/linux
ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
else
USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
update_env_settings
+if [ -n "${clst_FETCH}" ]
+then
+ export clst_myemergeopts="${clst_myemergeopts} -f"
+fi
+
case ${clst_target} in
livecd*|stage4)
export USE="livecd"