2012-10-26 01:12:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-08-12 15:06:35 +00:00
|
|
|
source common.sh
|
2012-10-26 01:12:08 +00:00
|
|
|
|
|
|
|
prepare_confs() {
|
|
|
|
local arch=$1
|
|
|
|
local flavor=$2
|
|
|
|
|
|
|
|
for s in 1 2 3; do
|
2013-05-09 21:10:48 +00:00
|
|
|
|
|
|
|
local cstage=stage${s}
|
|
|
|
local p=$(( s - 1 ))
|
|
|
|
[[ $p == 0 ]] && p=3
|
|
|
|
local pstage=stage${p}
|
|
|
|
|
|
|
|
local parch="${arch}"
|
|
|
|
[[ "${arch}" == "i686" ]] && parch="x86"
|
|
|
|
|
|
|
|
local tarch="${arch}"
|
|
|
|
[[ "${arch}" == "amd64" ]] && tarch="x86_64"
|
|
|
|
|
2014-08-17 12:14:15 +00:00
|
|
|
local profile=${flavor}
|
2018-10-08 19:29:51 +00:00
|
|
|
[[ "${flavor}" == "vanilla" ]] && profile="" || profile="/hardened"
|
2014-08-17 12:14:15 +00:00
|
|
|
|
2018-10-08 19:29:51 +00:00
|
|
|
cat stage.conf.template | \
|
2013-02-03 14:45:30 +00:00
|
|
|
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
2013-05-09 21:10:48 +00:00
|
|
|
-e "s:CSTAGE:${cstage}:g" \
|
|
|
|
-e "s:PSTAGE:${pstage}:g" \
|
|
|
|
-e "s:SARCH:${arch}:g" \
|
|
|
|
-e "s:PARCH:${parch}:g" \
|
2018-10-08 19:29:51 +00:00
|
|
|
-e "s:TARCHPROFILE:${profile}:g" \
|
2013-05-09 21:10:48 +00:00
|
|
|
-e "s:TARCH:${tarch}:g" \
|
2018-10-08 19:29:51 +00:00
|
|
|
-e "s:gentoo-linux-uclibc:unknown-linux-uclibc:" \
|
2013-05-09 21:10:48 +00:00
|
|
|
-e "s:FLAVOR:${flavor}:g" \
|
|
|
|
-e "s:MYCATALYST:$(pwd):g" \
|
|
|
|
> stage${s}-${arch}-uclibc-${flavor}.conf
|
2012-10-26 01:12:08 +00:00
|
|
|
done
|
2013-05-09 21:10:48 +00:00
|
|
|
|
|
|
|
sed -i "/^chost/d" stage3-${arch}-uclibc-${flavor}.conf
|
2012-10-26 01:12:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main() {
|
|
|
|
>zzz.log
|
|
|
|
|
2018-10-08 19:29:51 +00:00
|
|
|
# undo_grsec
|
2012-10-26 01:12:08 +00:00
|
|
|
|
2020-02-09 17:32:06 +00:00
|
|
|
catalyst -c $(pwd)/catalyst.conf.local -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
2012-10-26 01:12:08 +00:00
|
|
|
|
|
|
|
for arch in amd64 i686; do
|
|
|
|
for flavor in hardened vanilla; do
|
|
|
|
prepare_confs ${arch} ${flavor}
|
|
|
|
done
|
|
|
|
done
|
2014-08-12 15:06:35 +00:00
|
|
|
|
|
|
|
# The parallelization `( do_stages ... ) &` doesn't work here
|
|
|
|
# if catalyst is using snapcache, bug #519656
|
2012-10-26 01:12:08 +00:00
|
|
|
for arch in amd64 i686; do
|
|
|
|
for flavor in hardened vanilla; do
|
2018-03-02 16:25:44 +00:00
|
|
|
do_stages ${arch} ${flavor}
|
|
|
|
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
2012-10-26 01:12:08 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
main $1 &
|