From 2d4ad3fb63e54bdd1a7d5b05a11f62f8e3e37af7 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Mon, 19 Dec 2005 15:23:50 +0000 Subject: [PATCH] Fixed up spacing/coding style on stage1. Also changed gcc-config/binutils-config to be outside the chroot. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@976 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 8 +++- targets/stage1/stage1-chroot.sh | 16 +------- targets/stage1/stage1-controller.sh | 52 ++++++++++++++++-------- targets/stage1/stage1-preclean-chroot.sh | 16 +++----- 4 files changed, 49 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 664ce4e9..9084ff1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.463 2005/12/19 15:03:25 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.464 2005/12/19 15:23:50 wolf31o2 Exp $ + + 19 Dec 2005; Chris Gianelloni + targets/stage1/stage1-chroot.sh, targets/stage1/stage1-controller.sh, + targets/stage1/stage1-preclean-chroot.sh: + Fixed up spacing/coding style on stage1. Also changed + gcc-config/binutils-config to be outside the chroot. 19 Dec 2005; Chris Gianelloni targets/netboot/netboot-chroot.sh, targets/netboot/netboot-combine.sh, diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 26e92507..afce9ac7 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,33 +1,21 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.40 2005/12/09 19:03:07 wolf31o2 Exp $ - +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.41 2005/12/19 15:23:50 wolf31o2 Exp $ . /tmp/chroot-functions.sh update_env_settings -#setup_gcc setup_myfeatures setup_myemergeopts -# setup our environment +# Setup our environment export clst_buildpkgs="$(/tmp/build.py)" export STAGE1_USE="$(portageq envvar STAGE1_USE)" export USE="-* build ${STAGE1_USE}" export FEATURES="${clst_myfeatures} nodoc noman noinfo" -## Sanity check profile -if [ -z "${clst_buildpkgs}" ] -then - echo "Your profile seems to be broken." - echo "Could not build a list of build packages." - echo "Double check your /etc/make.profile link and the 'packages' files." - exit 1 -fi - - ## Sanity check profile if [ -z "${clst_buildpkgs}" ] then diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh index 51eecf99..739f56fd 100755 --- a/targets/stage1/stage1-controller.sh +++ b/targets/stage1/stage1-controller.sh @@ -1,47 +1,65 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-controller.sh,v 1.5 2005/12/02 17:05:56 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-controller.sh,v 1.6 2005/12/19 15:23:50 wolf31o2 Exp $ . ${clst_sharedir}/targets/support/functions.sh case $1 in enter) ;; - run) cp ${clst_sharedir}/targets/stage1/build.py ${clst_chroot_path}/tmp - # set up "ROOT in chroot" dir + # Setup "ROOT in chroot" dir install -d ${clst_chroot_path}/${clst_root_path}/etc - # set up make.conf and make.profile link in "ROOT in chroot": + # Setup make.conf and make.profile link in "ROOT in chroot": copy_to_chroot ${clst_chroot_path}/etc/make.conf /${clst_root_path}/etc - copy_to_chroot ${clst_chroot_path}/etc/make.profile /${clst_root_path}/etc + copy_to_chroot ${clst_chroot_path}/etc/make.profile \ + /${clst_root_path}/etc - # enter chroot, execute our build script - exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh || exit 1 + # Enter chroot, execute our build script + exec_in_chroot \ + ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh \ + || exit 1 ;; - preclean) + # We run gcc-config here this way so it works on all arches. + if [ -x /usr/bin/gcc-config ] + then + mythang=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 ) + if [ -z "${mythang}" ] + then + mythang=1 + fi + ROOT=/tmp/stage1root gcc-config ${mythang} + fi + # We run binutils-config here so it works on all arches. + if [ -x /usr/bin/binutils-config ] + then + mythang=$( cd /etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 ) + if [ -z "${mythang}" ] + then + mythang=1 + fi + ROOT=/tmp/stage1root binutils-config ${mythang} + fi exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-preclean-chroot.sh /tmp/stage1root || exit 1 - ;; - clean) - # clean out man, info and doc files + # Clean out man, info and doc files rm -rf usr/share/{man,doc,info}/* - # zap all .pyc and .pyo files + # Zap all .pyc and .pyo files find -iname "*.py[co]" -exec rm -f {} \; - # cleanup all .a files except libgcc.a, *_nonshared.a and + # Cleanup all .a files except libgcc.a, *_nonshared.a and # /usr/lib/portage/bin/*.a - find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs rm -f + find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | \ + grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \ + rm -f ;; - *) exit 1 ;; - esac exit $? - diff --git a/targets/stage1/stage1-preclean-chroot.sh b/targets/stage1/stage1-preclean-chroot.sh index 746586d0..ca16d1be 100755 --- a/targets/stage1/stage1-preclean-chroot.sh +++ b/targets/stage1/stage1-preclean-chroot.sh @@ -1,23 +1,17 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-preclean-chroot.sh,v 1.7 2005/07/05 21:53:41 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-preclean-chroot.sh,v 1.8 2005/12/19 15:23:50 wolf31o2 Exp $ . /tmp/chroot-functions.sh -# now, some finishing touches to initialize gcc-config.... -unset ROOT +update_env_settings -setup_gcc -setup_binutils - -# stage1 is not going to have anything in zoneinfo, so save our Factory timezone -if [ -d /usr/share/zoneinfo ] ; then +# Stage1 is not going to have anything in zoneinfo, so save our Factory timezone +if [ -d /usr/share/zoneinfo ] +then rm -f /etc/localtime cp /usr/share/zoneinfo/Factory /etc/localtime else echo UTC > /etc/TZ fi - -# this cleans out /var/db, but leaves behind files portage needs for removal -#find /var/db/pkg -type f | grep -v '\(COUNTER\|CONTENTS\|ebuild\)' | xargs rm -f -- 2.26.2