From ad1f64c26148971ee2e2172fdd59a5d9eb4c1895 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 20 Feb 2008 01:45:39 +0000 Subject: [PATCH] Removing any functions that we now call by default when we source chroot-functions.sh by default. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1306 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 12 ++++ targets/embedded/embedded-chroot.sh | 6 -- targets/grp/grp-chroot.sh | 6 -- targets/livecd-stage1/livecd-stage1-chroot.sh | 6 -- targets/netboot/netboot-chroot.sh | 6 -- targets/stage1/stage1-chroot.sh | 6 -- targets/stage2/stage2-chroot.sh | 6 -- targets/stage3/stage3-chroot.sh | 9 +-- targets/stage4/stage4-chroot.sh | 6 -- targets/support/chroot-functions.sh | 72 +++++++++++-------- targets/support/kmerge.sh | 5 +- targets/support/livecdfs-update.sh | 4 +- targets/support/post-kmerge.sh | 4 +- targets/support/pre-kmerge.sh | 11 --- targets/support/unmerge.sh | 2 - targets/tinderbox/tinderbox-chroot.sh | 4 -- 16 files changed, 62 insertions(+), 103 deletions(-) diff --git a/ChangeLog b/ChangeLog index a836db0a..0fcc89bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,18 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 20 Feb 2008; 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/stage1/stage1-chroot.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/livecdfs-update.sh, + targets/support/post-kmerge.sh, targets/support/pre-kmerge.sh, + targets/support/unmerge.sh, targets/tinderbox/tinderbox-chroot.sh: + Removing any functions that we now call by default when we source + chroot-functions.sh by default. + 20 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/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh index f1d63d64..6f2b97b0 100755 --- a/targets/embedded/embedded-chroot.sh +++ b/targets/embedded/embedded-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - # Setup the environment export DESTROOT="${clst_root_path}" export clst_root_path="/" diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh index 7f1c05e9..499a3901 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - ## START BUILD setup_portage diff --git a/targets/livecd-stage1/livecd-stage1-chroot.sh b/targets/livecd-stage1/livecd-stage1-chroot.sh index c9c4cbfc..f18ab810 100755 --- a/targets/livecd-stage1/livecd-stage1-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - ## START BUILD setup_portage diff --git a/targets/netboot/netboot-chroot.sh b/targets/netboot/netboot-chroot.sh index 6cfabbcc..5a541ae8 100755 --- a/targets/netboot/netboot-chroot.sh +++ b/targets/netboot/netboot-chroot.sh @@ -2,11 +2,5 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - # START BUILD run_emerge "${clst_packages}" diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 36b5d948..3ec42db9 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - # Setup our environment export clst_buildpkgs="$(/tmp/build.py)" export STAGE1_USE="$(portageq envvar STAGE1_USE)" diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index dc8d2407..40c627ed 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - # 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 92ab2ab6..1daf0341 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -2,15 +2,8 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - -setup_portage - ## START BUILD +setup_portage run_emerge "-e system" diff --git a/targets/stage4/stage4-chroot.sh b/targets/stage4/stage4-chroot.sh index c2443d11..686fb49f 100755 --- a/targets/stage4/stage4-chroot.sh +++ b/targets/stage4/stage4-chroot.sh @@ -2,12 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - ## START BUILD setup_portage diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index 426843e0..54277041 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -13,7 +13,10 @@ trap "echo SIGKILL signal recieved killing $0 with pid $$;kill -9 $$" SIGKILL # * user types ctrl-c # * kernel recognizes this and generates SIGINT signal trap "echo SIGINT signal recieved killing $0 with pid $$;kill -9 $$" SIGINT - + +# We do this everywhere, so why not put it in this script +run_default_funcs + check_genkernel_version(){ if [ -x /usr/bin/genkernel ] then @@ -118,7 +121,7 @@ setup_myfeatures(){ } setup_myemergeopts(){ - if [ -n "${clst_VERBOSE}" ] || [ -n "${clst_DEBUG}" ] + if [ -n "${clst_VERBOSE}" ] then clst_myemergeopts="--verbose" else @@ -243,6 +246,43 @@ run_emerge() { emerge ${clst_myemergeopts} $@ || exit 1 } +show_debug() { + if [ "${clst_DEBUG}" = "1" ] + then + echo "DEBUG:" + echo "Profile inheritance:" + python -c 'import portage; print portage.settings.profiles' + echo + echo "STAGE1_USE: $(portageq envvar STAGE1_USE)" + echo + echo "USE (profile): $(portageq envvar USE)" + echo "USE (stage1): ${USE}" + echo "FEATURES (profile): $(portageq envvar FEATURES)" + echo "FEATURES (stage1): ${FEATURES}" + echo + echo "ARCH: $(portageq envvar ARCH)" + echo "CHOST: $(portageq envvar CHOST)" + echo "CFLAGS: $(portageq envvar CFLAGS)" + echo + echo "PROFILE_ARCH: $(portageq envvar PROFILE_ARCH)" + echo + echo "ABI: $(portageq envvar ABI)" + echo "DEFAULT_ABI: $(portageq envvar DEFAULT_ABI)" + echo "KERNEL_ABI: $(portageq envvar KERNEL_ABI)" + echo "MULTILIB_ABIS: $(portageq envvar MULTILIB_ABIS)" + echo + fi +} + +run_default_funcs() { + if [ -z "${RUN_DEFAULT_FUNCS}" ] + then + update_env_settings + setup_myfeatures + show_debug + fi +} + # Functions # Copy libs of a executable in the chroot function copy_libs() { @@ -331,31 +371,3 @@ GenericName=Gentoo Linux Handbook Comment=This is a link to the local copy of the Gentoo Linux Handbook. Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop } - -show_debug() { - if [ "${clst_DEBUG}" = "1" ] - then - echo "DEBUG:" - echo "Profile inheritance:" - python -c 'import portage; print portage.settings.profiles' - echo - echo "STAGE1_USE: $(portageq envvar STAGE1_USE)" - echo - echo "USE (profile): $(portageq envvar USE)" - echo "USE (stage1): ${USE}" - echo "FEATURES (profile): $(portageq envvar FEATURES)" - echo "FEATURES (stage1): ${FEATURES}" - echo - echo "ARCH: $(portageq envvar ARCH)" - echo "CHOST: $(portageq envvar CHOST)" - echo "CFLAGS: $(portageq envvar CFLAGS)" - echo - echo "PROFILE_ARCH: $(portageq envvar PROFILE_ARCH)" - echo - echo "ABI: $(portageq envvar ABI)" - echo "DEFAULT_ABI: $(portageq envvar DEFAULT_ABI)" - echo "KERNEL_ABI: $(portageq envvar KERNEL_ABI)" - echo "MULTILIB_ABIS: $(portageq envvar MULTILIB_ABIS)" - echo - fi -} diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index 128a85a2..111d3742 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -1,11 +1,12 @@ #!/bin/bash -source /tmp/chroot-functions.sh +RUN_DEFAULT_FUNCS="no" -mkdir -p /tmp/kerncache +source /tmp/chroot-functions.sh check_genkernel_version +mkdir -p /tmp/kerncache PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds setup_gk_args() { diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh index c5d8a48d..2829a058 100755 --- a/targets/support/livecdfs-update.sh +++ b/targets/support/livecdfs-update.sh @@ -1,8 +1,8 @@ #!/bin/bash -source /tmp/chroot-functions.sh +RUN_DEFAULT_FUNCS="no" -update_env_settings +source /tmp/chroot-functions.sh # Allow root logins to our CD by default if [ -e /etc/sshd/sshd_config ] diff --git a/targets/support/post-kmerge.sh b/targets/support/post-kmerge.sh index 951740b2..c17680c4 100755 --- a/targets/support/post-kmerge.sh +++ b/targets/support/post-kmerge.sh @@ -1,8 +1,8 @@ #!/bin/bash -. /tmp/chroot-functions.sh +RUN_DEFAULT_FUNCS="no" -update_env_settings +source /tmp/chroot-functions.sh # Only run depscan.sh if modules exist if [ -n "$(ls /lib/modules)" ] diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh index 2570ce32..d86ff13b 100755 --- a/targets/support/pre-kmerge.sh +++ b/targets/support/pre-kmerge.sh @@ -2,17 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - -show_debug - -if [ -n "${clst_FETCH}" ] -then - export clst_myemergeopts="${clst_myemergeopts} -f" -fi - case ${clst_target} in livecd*|stage4) run_emerge --oneshot genkernel diff --git a/targets/support/unmerge.sh b/targets/support/unmerge.sh index 43aefd0b..b5aec801 100644 --- a/targets/support/unmerge.sh +++ b/targets/support/unmerge.sh @@ -2,8 +2,6 @@ source /tmp/chroot-functions.sh -update_env_settings - run_emerge -C ${clst_packages} exit 0 diff --git a/targets/tinderbox/tinderbox-chroot.sh b/targets/tinderbox/tinderbox-chroot.sh index a4b55e3e..8f98d093 100755 --- a/targets/tinderbox/tinderbox-chroot.sh +++ b/targets/tinderbox/tinderbox-chroot.sh @@ -2,10 +2,6 @@ . /tmp/chroot-functions.sh -update_env_settings - -setup_myfeatures - # START THE BUILD setup_portage -- 2.26.2