From: Chris Gianelloni Date: Wed, 20 Feb 2008 01:27:45 +0000 (+0000) Subject: Clean up the debug code that I've added to stage1, move it to chroot_functions.sh... X-Git-Tag: CATALYST_2_0_6_916~189 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=208ca9a5e3c8949edfa553525be174957c956c4d;p=catalyst.git Clean up the debug code that I've added to stage1, move it to chroot_functions.sh, and call it from all of our main targets. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1305 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 392d2f2e..a836db0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,16 @@ # 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/netboot2/netboot2-pkg.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/pre-kmerge.sh: + Clean up the debug code that I've added to stage1, move it to + chroot_functions.sh, and call it from all of our main targets. + 14 Feb 2008; Chris Gianelloni catalyst, modules/generic_stage_target.py: Wow. I need to make sure that we actually comment comments in make.conf or diff --git a/targets/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh index b7c7e88d..f1d63d64 100755 --- a/targets/embedded/embedded-chroot.sh +++ b/targets/embedded/embedded-chroot.sh @@ -6,6 +6,8 @@ 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 69f41453..7f1c05e9 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -4,10 +4,10 @@ update_env_settings -[ -f /tmp/envscript ] && source /tmp/envscript - 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 5274937a..c9c4cbfc 100755 --- a/targets/livecd-stage1/livecd-stage1-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-chroot.sh @@ -6,6 +6,8 @@ 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 370ec0c7..6cfabbcc 100755 --- a/targets/netboot/netboot-chroot.sh +++ b/targets/netboot/netboot-chroot.sh @@ -6,5 +6,7 @@ update_env_settings setup_myfeatures +show_debug + # START BUILD run_emerge "${clst_packages}" diff --git a/targets/netboot2/netboot2-pkg.sh b/targets/netboot2/netboot2-pkg.sh index bf51a0b3..3e302127 100644 --- a/targets/netboot2/netboot2-pkg.sh +++ b/targets/netboot2/netboot2-pkg.sh @@ -6,6 +6,8 @@ update_env_settings setup_myfeatures +show_debug + # Setup our environment export FEATURES="${clst_myfeatures}" diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 62fd52ba..36b5d948 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -6,6 +6,8 @@ update_env_settings setup_myfeatures +show_debug + # Setup our environment export clst_buildpkgs="$(/tmp/build.py)" export STAGE1_USE="$(portageq envvar STAGE1_USE)" @@ -21,20 +23,6 @@ then exit 1 fi -if [ "${clst_DEBUG}" = "1" ] -then - echo "DEBUG:" - echo "Profile inheritance:" - python -c 'import portage; print portage.settings.profiles' - echo "STAGE1_USE: $(portageq envvar STAGE1_USE)" - echo "USE (profile): $(portageq envvar USE)" - echo "USE (stage1): ${USE}" - echo "FEATURES (profile): $(portageq envvar FEATURES)" - echo "FEATURES (stage1): ${FEATURES}" - - exit 1 -fi - ## START BUILD clst_root_path=/ setup_portage diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index ec9016cc..dc8d2407 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -6,6 +6,8 @@ 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 7e1665ec..92ab2ab6 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -6,12 +6,12 @@ update_env_settings setup_myfeatures -## START BUILD -# 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. +show_debug setup_portage +## START BUILD + run_emerge "-e system" rm -f /var/lib/portage/world diff --git a/targets/stage4/stage4-chroot.sh b/targets/stage4/stage4-chroot.sh index 7b6f08be..c2443d11 100755 --- a/targets/stage4/stage4-chroot.sh +++ b/targets/stage4/stage4-chroot.sh @@ -6,6 +6,8 @@ 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 e7ab348e..426843e0 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -118,7 +118,7 @@ setup_myfeatures(){ } setup_myemergeopts(){ - if [ -n "${clst_VERBOSE}" ] + if [ -n "${clst_VERBOSE}" ] || [ -n "${clst_DEBUG}" ] then clst_myemergeopts="--verbose" else @@ -283,9 +283,9 @@ function copy_symlink() { cp -vfdp ${1} ${clst_root_path}/${1} if [[ -n $(type -p realpath) ]]; then - TARGET=`realpath ${1}` + TARGET=`realpath ${1}` else - TARGET=`readlink -f ${1}` + TARGET=`readlink -f ${1}` fi if [ -h ${TARGET} ] then @@ -331,3 +331,31 @@ 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/pre-kmerge.sh b/targets/support/pre-kmerge.sh index a224a231..2570ce32 100755 --- a/targets/support/pre-kmerge.sh +++ b/targets/support/pre-kmerge.sh @@ -4,6 +4,10 @@ update_env_settings +setup_myfeatures + +show_debug + if [ -n "${clst_FETCH}" ] then export clst_myemergeopts="${clst_myemergeopts} -f" @@ -11,7 +15,6 @@ fi case ${clst_target} in livecd*|stage4) - export USE="livecd" run_emerge --oneshot genkernel install -d /tmp/kerncache