Remove code for gcc-config/binutils-config since it should be getting done in the...
[catalyst.git] / targets / stage1 / stage1-controller.sh
1 #!/bin/bash
2
3 . ${clst_sharedir}/targets/support/functions.sh
4
5 case $1 in
6         enter)
7         ;;
8         run)
9                 cp ${clst_sharedir}/targets/stage1/build.py ${clst_chroot_path}/tmp
10                 
11                 # Setup "ROOT in chroot" dir
12                 install -d ${clst_chroot_path}/${clst_root_path}/etc
13                 
14                 # Setup make.conf and make.profile link in "ROOT in chroot":
15                 copy_to_chroot ${clst_chroot_path}/etc/make.conf /${clst_root_path}/etc
16                 copy_to_chroot ${clst_chroot_path}/etc/make.profile \
17                         /${clst_root_path}/etc
18
19                 # Enter chroot, execute our build script
20                 exec_in_chroot \
21                         ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh \
22                         || exit 1
23         ;;
24         preclean)
25                 exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-preclean-chroot.sh /tmp/stage1root || exit 1
26         ;;
27         clean)
28                 # Clean out man, info and doc files
29                 rm -rf usr/share/{man,doc,info}/*
30                 # Zap all .pyc and .pyo files
31                 find . -iname "*.py[co]" -exec rm -f {} \;
32                 # Cleanup all .a files except libgcc.a, *_nonshared.a and
33                 # /usr/lib/portage/bin/*.a
34                 find . -type f -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' \
35                         | grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \
36                         rm -f
37         ;;
38         *)
39                 exit 1
40         ;;
41 esac
42 exit $?