2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-controller.sh,v 1.7 2005/12/20 17:05:39 wolf31o2 Exp $
6 . ${clst_sharedir}/targets/support/functions.sh
12 cp ${clst_sharedir}/targets/stage1/build.py ${clst_chroot_path}/tmp
14 # Setup "ROOT in chroot" dir
15 install -d ${clst_chroot_path}/${clst_root_path}/etc
17 # Setup make.conf and make.profile link in "ROOT in chroot":
18 copy_to_chroot ${clst_chroot_path}/etc/make.conf /${clst_root_path}/etc
19 copy_to_chroot ${clst_chroot_path}/etc/make.profile \
20 /${clst_root_path}/etc
22 # Enter chroot, execute our build script
24 ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh \
28 # We run gcc-config here this way so it works on all arches.
29 if [ -x /usr/bin/gcc-config ]
31 mythang=$( cd /tmp/stage1root/etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
32 if [ -z "${mythang}" ]
36 ROOT=/tmp/stage1root/ gcc-config ${mythang}
38 # We run binutils-config here so it works on all arches.
39 if [ -x /usr/bin/binutils-config ]
41 mythang=$( cd /tmp/stage1root/etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 )
42 if [ -z "${mythang}" ]
46 ROOT=/tmp/stage1root/ binutils-config ${mythang}
48 exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-preclean-chroot.sh /tmp/stage1root || exit 1
51 # Clean out man, info and doc files
52 rm -rf usr/share/{man,doc,info}/*
53 # Zap all .pyc and .pyo files
54 find -iname "*.py[co]" -exec rm -f {} \;
55 # Cleanup all .a files except libgcc.a, *_nonshared.a and
56 # /usr/lib/portage/bin/*.a
57 find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | \
58 grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \