From 24cf0e408aa24e48d62fb42deb499cf2b00d0820 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 10 Apr 2007 21:28:05 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1225 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 17 +++++++++++ targets/embedded/embedded-chroot.sh | 1 - targets/grp/grp-chroot.sh | 21 ++----------- targets/livecd-stage1/livecd-stage1-chroot.sh | 1 - targets/netboot/netboot-chroot.sh | 1 - targets/netboot/netboot-combine.sh | 1 - targets/netboot2/netboot2-pkg.sh | 1 - targets/stage1/stage1-chroot.sh | 1 - targets/stage1/stage1-controller.sh | 4 +-- targets/stage2/stage2-chroot.sh | 1 - targets/stage3/stage3-chroot.sh | 5 ++-- targets/stage4/stage4-chroot.sh | 1 - targets/support/chroot-functions.sh | 5 ++-- targets/support/kmerge.sh | 30 +++++++++---------- targets/support/pre-kmerge.sh | 5 ++++ 15 files changed, 45 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ccffd01..a9d33d39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,23 @@ # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 10 Apr 2007; Chris Gianelloni + 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 catalyst, modules/grp_target.py: Added patch from Åsmund Grammeltvedt to add diff --git a/targets/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh index 11ac4ce6..e4c123dc 100755 --- a/targets/embedded/embedded-chroot.sh +++ b/targets/embedded/embedded-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup the environment export FEATURES="${clst_myfeatures}" diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh index 0db3b61d..228b8e4a 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -23,27 +23,10 @@ then 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 diff --git a/targets/livecd-stage1/livecd-stage1-chroot.sh b/targets/livecd-stage1/livecd-stage1-chroot.sh index 2a562482..13b2074a 100755 --- a/targets/livecd-stage1/livecd-stage1-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup the environment diff --git a/targets/netboot/netboot-chroot.sh b/targets/netboot/netboot-chroot.sh index 2a82b1e2..bf51a0b3 100755 --- a/targets/netboot/netboot-chroot.sh +++ b/targets/netboot/netboot-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup our environment export FEATURES="${clst_myfeatures}" diff --git a/targets/netboot/netboot-combine.sh b/targets/netboot/netboot-combine.sh index df5d49b2..8d9898b3 100644 --- a/targets/netboot/netboot-combine.sh +++ b/targets/netboot/netboot-combine.sh @@ -7,7 +7,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Ssetup our environment export FEATURES="${clst_myfeatures}" diff --git a/targets/netboot2/netboot2-pkg.sh b/targets/netboot2/netboot2-pkg.sh index 2a82b1e2..bf51a0b3 100644 --- a/targets/netboot2/netboot2-pkg.sh +++ b/targets/netboot2/netboot2-pkg.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup our environment export FEATURES="${clst_myfeatures}" diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index e4aa826c..69a51ba6 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup our environment export clst_buildpkgs="$(/tmp/build.py)" diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh index 6dd0f117..11856173 100755 --- a/targets/stage1/stage1-controller.sh +++ b/targets/stage1/stage1-controller.sh @@ -23,7 +23,7 @@ case $1 in ;; 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}" ] @@ -34,7 +34,7 @@ case $1 in 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}" ] diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index 0662ac73..002a6051 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup the environment export FEATURES="${clst_myfeatures} nodoc noman noinfo" diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index b693eb24..55393a13 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -5,15 +5,14 @@ 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 diff --git a/targets/stage4/stage4-chroot.sh b/targets/stage4/stage4-chroot.sh index 1575dd6a..ba9ab85e 100755 --- a/targets/stage4/stage4-chroot.sh +++ b/targets/stage4/stage4-chroot.sh @@ -5,7 +5,6 @@ update_env_settings setup_myfeatures -setup_myemergeopts # Setup the environment export FEATURES="${clst_myfeatures}" diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index bd5c9d5f..ae8fbdd1 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -35,6 +35,7 @@ check_genkernel_version(){ } setup_myfeatures(){ + setup_myemergeopts if [ -n "${clst_CCACHE}" ] then export clst_myfeatures="${clst_myfeatures} ccache" @@ -42,7 +43,7 @@ setup_myfeatures(){ #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 @@ -55,7 +56,7 @@ setup_myfeatures(){ #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 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index d3714f2b..490dce04 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -68,23 +68,22 @@ genkernel_compile(){ 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 } @@ -98,7 +97,6 @@ build_kernel() { source /etc/profile setup_myfeatures -setup_myemergeopts [ -n "${clst_ENVSCRIPT}" ] && source /tmp/envscript export CONFIG_PROTECT="-*" @@ -188,7 +186,7 @@ then 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 diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh index 2b7544ff..b8805e71 100755 --- a/targets/support/pre-kmerge.sh +++ b/targets/support/pre-kmerge.sh @@ -4,6 +4,11 @@ update_env_settings +if [ -n "${clst_FETCH}" ] +then + export clst_myemergeopts="${clst_myemergeopts} -f" +fi + case ${clst_target} in livecd*|stage4) export USE="livecd" -- 2.26.2