2 ===================================================================
3 --- catalyst (revision 1234)
4 +++ catalyst (working copy)
6 print "Setting",x,"to default value \""+confdefaults[x]+"\""
7 conf_values[x]=confdefaults[x]
9 + # use local stuff if we're running out of a svn dir
10 + if os.path.isdir(os.path.join(os.path.dirname(sys.argv[0]), ".svn")):
11 + conf_values["sharedir"] = os.path.dirname(sys.argv[0]);
13 # parse out the rest of the options from the config file
14 if "autoresume" in string.split(conf_values["options"]):
15 print "Autoresuming support enabled."
16 Index: targets/stage1/stage1-preclean-chroot.sh
17 ===================================================================
18 --- targets/stage1/stage1-preclean-chroot.sh (revision 1234)
19 +++ targets/stage1/stage1-preclean-chroot.sh (working copy)
23 -. /tmp/chroot-functions.sh
24 +. ./tmp/chroot-functions.sh
26 # Now, some finishing touches to initialize gcc-config....
31 # Stage1 is not going to have anything in zoneinfo, so save our Factory timezone
32 -if [ -d /usr/share/zoneinfo ]
33 +if [ -d ./usr/share/zoneinfo ]
35 - rm -f /etc/localtime
36 - cp /usr/share/zoneinfo/Factory /etc/localtime
37 + rm -f ./etc/localtime
38 + cp ./usr/share/zoneinfo/Factory ./etc/localtime
44 #if [ -n "${clst_CCACHE}" ]
45 Index: targets/stage1/stage1-chroot.sh
46 ===================================================================
47 --- targets/stage1/stage1-chroot.sh (revision 1234)
48 +++ targets/stage1/stage1-chroot.sh (working copy)
52 -. /tmp/chroot-functions.sh
53 +. ./tmp/chroot-functions.sh
61 # Setup our environment
62 -export clst_buildpkgs="$(/tmp/build.py)"
63 +export clst_buildpkgs="$(./tmp/build.py)"
64 export STAGE1_USE="$(portageq envvar STAGE1_USE)"
65 export USE="-* build ${STAGE1_USE}"
66 export FEATURES="${clst_myfeatures} nodoc noman noinfo"
68 clst_root_path=/ setup_portage
70 run_emerge "--noreplace --oneshot ${clst_buildpkgs}"
71 -rm -f /var/lib/portage/world
72 -touch /var/lib/portage/world
73 +rm -f ./var/lib/portage/world
74 +touch ./var/lib/portage/world
76 -rm -f /var/log/emerge.log
77 +rm -f ./var/log/emerge.log
78 Index: targets/support/functions.sh
79 ===================================================================
80 --- targets/support/functions.sh (revision 1234)
81 +++ targets/support/functions.sh (working copy)
83 chmod 755 ${dest_dir}/${file_name}
85 echo "copying ${file_name} to ${clst_chroot_path}/tmp"
86 - mkdir -p ${chroot_path}/tmp
87 + mkdir -p ${clst_chroot_path}/tmp
88 cp -pPR ${1} ${clst_chroot_path}/tmp
89 chmod 755 ${clst_chroot_path}/tmp/${file_name}
92 chroot_path=${clst_chroot_path}${subdir}
93 copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \
95 - echo "Running ${file_name} in chroot ${chroot_path}"
96 - ${clst_CHROOT} ${chroot_path} /tmp/${file_name} || exit 1
97 + echo "Running ${file_name} in chroot ${chroot_path}"
98 + if ${clst_crosscompile} ; then
99 + pushd ${chroot_path} > /dev/null || exit 1
100 + export CFLAGS="$(portageq envvar CFLAGS) --sysroot=${chroot_path}"
101 + export CPPFLAGS="$(portageq envvar CPPFLAGS) --sysroot=${chroot_path}"
102 + ROOT=${chroot_path} ./tmp/${file_name} || exit 1
105 + ${clst_CHROOT} ${chroot_path} /tmp/${file_name} || exit 1
108 copy_to_chroot ${1} tmp/
109 chroot_path=${clst_chroot_path}
110 copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \
112 echo "Running ${file_name} in chroot ${chroot_path}"
113 - ${clst_CHROOT} ${chroot_path}/ /tmp/${file_name} || exit 1
114 + if ${clst_crosscompile} ; then
115 + pushd ${chroot_path} > /dev/null || exit 1
116 + export CFLAGS="$(portageq envvar CFLAGS) --sysroot=${chroot_path}"
117 + export CPPFLAGS="$(portageq envvar CPPFLAGS) --sysroot=${chroot_path}"
118 + ROOT=${chroot_path} ./tmp/${file_name} || exit 1
121 + ${clst_CHROOT} ${chroot_path}/ /tmp/${file_name} || exit 1
125 rm -f ${chroot_path}/tmp/${file_name}
131 - crossdev ${clst_CHOST}
133 +. ${clst_sharedir}/targets/support/cross-functions.sh
134 Index: targets/support/chroot-functions.sh
135 ===================================================================
136 --- targets/support/chroot-functions.sh (revision 1234)
137 +++ targets/support/chroot-functions.sh (working copy)
142 - if [ -x /usr/bin/gcc-config ]
143 + if [ -x ./usr/bin/gcc-config ]
145 - mythang=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
146 + mythang=$( cd ./etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
147 if [ -z "${mythang}" ]
154 - if [ -x /usr/bin/binutils-config ]
155 + if [ -x ./usr/bin/binutils-config ]
157 - mythang=$( cd /etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 )
158 + mythang=$( cd ./etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 )
159 if [ -z "${mythang}" ]
162 @@ -120,31 +120,24 @@
166 - rm -rf /etc/distcc/hosts
167 + rm -rf ./etc/distcc/hosts
170 update_env_settings(){
172 - source /etc/profile
173 - [ -f /tmp/envscript ] && source /tmp/envscript
174 + ${clst_crosscompile} || source /etc/profile
175 + [ -f ./tmp/envscript ] && source ./tmp/envscript
190 - if [ ! -d ${ROOT} ]
195 + export ROOT=${1:-/}
196 + ${clst_crosscompile} && export ROOT=${clst_chroot_path}${ROOT}
197 + [ ! -d ${ROOT} ] && install -d ${ROOT}