From 454c1682889b9dedd0d1ffa122d72aa1534163a1 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 28 Feb 2008 04:26:14 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1334 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 7 +++++++ targets/grp/grp-chroot.sh | 7 ------- targets/stage1/stage1-chroot.sh | 18 +++++++++++++----- targets/support/kmerge.sh | 25 ++++++++----------------- targets/support/livecdfs-update.sh | 1 + 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index f68aa944..b9967cd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,13 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 28 Feb 2008; Chris Gianelloni + 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 targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh, targets/livecd-stage1/livecd-stage1-chroot.sh, diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh index 3ed29b61..a99f5316 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -5,14 +5,8 @@ source /tmp/chroot-functions.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} \ @@ -20,5 +14,4 @@ then else DISTDIR="/tmp/grp/${clst_grp_target}" run_merge --fetchonly \ ${clst_grp_packages} || exit 1 - unset PKGDIR fi diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 1b7204f1..8476114b 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -6,9 +6,8 @@ export clst_buildpkgs="$(/tmp/build.py)" 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}" ] @@ -22,6 +21,15 @@ fi ## 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 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index 6ab2d3c0..b5fa5221 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -126,7 +126,6 @@ filtered_kname=${clst_kname/\//_} 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" @@ -185,27 +184,19 @@ then 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 diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh index d73efd84..57d4cbd5 100755 --- a/targets/support/livecdfs-update.sh +++ b/targets/support/livecdfs-update.sh @@ -310,6 +310,7 @@ case ${clst_livecd_type} in # 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 -- 2.26.2