# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
# $Id: $
+ 28 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
+ targets/grp/grp-chroot.sh, targets/stage1/stage1-chroot.sh,
+ targets/support/kmerge.sh, targets/support/livecdfs-update.sh:
+ Rather than using the environment, we write out our USE to make.conf, then
+ remove it once we're done. We don't bother adding clst_HOSTUSE, since it'll
+ be written to make.conf, already.
+
28 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh,
targets/livecd-stage1/livecd-stage1-chroot.sh,
## START BUILD
setup_pkgmgr
-unset DISTDIR
-
-# Don't grab MS core fonts, etc.
-export USE="${USE} ${clst_HOSTUSE} ${clst_use}"
-
if [ "${clst_grp_type}" = "pkgset" ]
then
- unset DISTDIR
export PKGDIR="/tmp/grp/${clst_grp_target}"
run_merge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
else
DISTDIR="/tmp/grp/${clst_grp_target}" run_merge --fetchonly \
${clst_grp_packages} || exit 1
- unset PKGDIR
fi
source /tmp/chroot-functions.sh
# Setup our environment
-export STAGE1_USE="$(portageq envvar STAGE1_USE)"
-export USE="-* bindist build ${STAGE1_USE}"
-export FEATURES="${clst_myfeatures} nodoc noman noinfo"
+STAGE1_USE="$(portageq envvar STAGE1_USE)"
+FEATURES="${clst_myfeatures} nodoc noman noinfo"
## Sanity check profile
if [ -z "${clst_buildpkgs}" ]
## START BUILD
clst_root_path=/ setup_pkgmgr
-USE="-build" run_merge "--oneshot --nodeps virtual/baselayout"
+# First, we drop in a known-good baselayout
+[ -e ${ROOT}/etc/make.conf ] && \
+ echo 'USE="${USE} -build' >> ${ROOT}/etc/make.conf
+run_merge "--oneshot --nodeps virtual/baselayout"
+sed -i '/USE="${USE} -build/d' ${ROOT}/etc/make.conf
-USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}" run_merge "--noreplace --oneshot --newuse ${clst_buildpkgs}"
+[ -e ${ROOT}/etc/make.conf ] && \
+ echo 'USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}"' \
+ >> ${ROOT}/etc/make.conf
+run_merge "--noreplace --oneshot --newuse ${clst_buildpkgs}"
+sed -i '/USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}"/d' \
+ ${ROOT}/etc/make.conf
filtered_kname=${filtered_kname/\./_}
eval "clst_kernel_use=\$clst_boot_kernel_${filtered_kname}_use"
-export USE="${clst_kernel_use} ${clst_HOSTUSE}"
eval "clst_kernel_gk_kernargs=\$clst_boot_kernel_${filtered_kname}_gk_kernargs"
eval "clst_ksource=\$clst_boot_kernel_${filtered_kname}_sources"
fi
fi
-mkdir -p /tmp/kerncache/${clst_kname}
-
+[ -e /etc/make.conf ] && echo 'USE="${USE} ${clst_kernel_use} symlink build' \
+ >> /etc/make.conf
+
if [ -n "${clst_KERNCACHE}" ]
then
- ROOT=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} USE="${USE} symlink build" emerge --nodeps -uqkb "${clst_ksource}" || exit 1
-# KERNELVERSION=`/usr/lib/portage/bin/portageq best_visible / "${clst_ksource}"`
-# if [ ! -e /etc/portage/profile/package.provided ]
-# then
-# mkdir -p /etc/portage/profile
-# echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
-# else
-# if ( ! grep -q "^${KERNELVERSION}" /etc/portage/profile/package.provided )
-# then
-# echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
-# fi
-# fi
- [ -d /usr/src/linux ] && rm /usr/src/linux
+mkdir -p /tmp/kerncache/${clst_kname}
+ ROOT=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} run_emerge --nodeps -uqkb "${clst_ksource}" || exit 1
+ [ -l /usr/src/linux ] && rm -f /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
+ run_emerge "${clst_ksource}" || exit 1
fi
+sed -i '/USE="${USE} ${clst_kernel_use} symlink build/d' /etc/make.conf
# If catalyst has set to a empty string, extraversion wasn't specified so we
# skip this part
# This gives us our list of system packages for the installer
mkdir -p /usr/livecd
+ ### XXX: Andrew says we don't need this anymore
USE="-* $(cat /var/db/pkg/sys-libs/glibc*/USE)" emerge -eqp system | grep -e '^\[ebuild' | sed -e 's:^\[ebuild .\+\] ::' -e 's: .\+$::' > /usr/livecd/systempkgs.txt
# This is my hack to reduce tmpfs usage