2014-06-18 10:57:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-06-28 10:44:04 +00:00
|
|
|
source common.sh
|
2014-06-18 10:57:51 +00:00
|
|
|
|
|
|
|
prepare_confs() {
|
|
|
|
local arch=$1
|
|
|
|
local flavor=$2
|
|
|
|
|
|
|
|
for s in 1 2 3; do
|
|
|
|
|
|
|
|
local cstage=stage${s}
|
|
|
|
local p=$(( s - 1 ))
|
|
|
|
[[ $p == 0 ]] && p=3
|
|
|
|
local pstage=stage${p}
|
|
|
|
local tarch="${arch%3}"
|
|
|
|
local parch="mips/${tarch}"
|
|
|
|
|
2017-12-13 03:43:45 +00:00
|
|
|
local profile=${flavor}
|
|
|
|
[[ "${flavor}" == "vanilla" ]] && profile="default"
|
|
|
|
|
2014-06-18 10:57:51 +00:00
|
|
|
cat stage-all.conf.template | \
|
|
|
|
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
|
|
-e "s:CSTAGE:${cstage}:g" \
|
|
|
|
-e "s:PSTAGE:${pstage}:g" \
|
|
|
|
-e "s:SARCH:${arch}:g" \
|
|
|
|
-e "s:PARCH:${parch}:g" \
|
|
|
|
-e "s:TARCH:${tarch}:g" \
|
|
|
|
-e "s:FLAVOR:${flavor}:g" \
|
2017-12-13 03:43:45 +00:00
|
|
|
-e "s:PROFILE:${profile}:g" \
|
2014-06-18 10:57:51 +00:00
|
|
|
-e "s:MYCATALYST:$(pwd):g" \
|
2014-06-27 16:27:54 +00:00
|
|
|
-e "s|^cflags:.*|cflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
|
|
|
-e "s|^cxxflags:.*|cxxflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
2014-06-18 10:57:51 +00:00
|
|
|
> stage${s}-${arch}-musl-${flavor}.conf
|
2015-06-14 21:03:31 +00:00
|
|
|
|
|
|
|
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
2015-06-14 21:34:32 +00:00
|
|
|
| sed -e 's/^.*:[ \t]*//')
|
2015-06-14 21:03:31 +00:00
|
|
|
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
|
|
stage${s}-${arch}-musl-${flavor}.conf
|
2014-06-18 10:57:51 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main() {
|
|
|
|
>zzz.log
|
|
|
|
|
2014-06-18 11:13:14 +00:00
|
|
|
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
2014-06-18 10:57:51 +00:00
|
|
|
|
|
|
|
for arch in mipsel3; do
|
|
|
|
for flavor in vanilla; do
|
|
|
|
prepare_confs ${arch} ${flavor}
|
|
|
|
done
|
|
|
|
done
|
2014-08-13 14:30:43 +00:00
|
|
|
|
|
|
|
# No parallelization for mips. Its too hard on the cpu!
|
2014-06-18 11:13:14 +00:00
|
|
|
for arch in mipsel3; do
|
|
|
|
for flavor in vanilla; do
|
|
|
|
do_stages ${arch} ${flavor}
|
2014-08-13 14:30:43 +00:00
|
|
|
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
2014-06-18 11:13:14 +00:00
|
|
|
done
|
|
|
|
done
|
2014-06-18 10:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main $1 &
|