gentoo-asahi-releng/tools-musl/run.sh

58 lines
1.3 KiB
Bash
Raw Normal View History

2014-01-27 12:22:49 +00:00
#!/bin/bash
source common.sh
2014-01-27 12:22:49 +00:00
2014-06-09 00:00:41 +00:00
prepare_confs() {
local arch=$1
local flavor=$2
2014-01-27 12:22:49 +00:00
2014-06-09 00:00:41 +00:00
for s in 1 2 3; do
2014-01-27 12:22:49 +00:00
2014-06-09 00:00:41 +00:00
local cstage=stage${s}
local p=$(( s - 1 ))
[[ $p == 0 ]] && p=3
local pstage=stage${p}
2014-06-09 00:00:41 +00:00
local parch="${arch}"
[[ "${arch}" == "i686" ]] && parch="x86"
2014-01-27 12:22:49 +00:00
2014-06-09 00:00:41 +00:00
local tarch="${arch}"
[[ "${arch}" == "amd64" ]] && tarch="x86_64"
2014-06-09 00:00:41 +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" \
-e "s:MYCATALYST:$(pwd):g" \
> stage${s}-${arch}-musl-${flavor}.conf
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
2015-06-14 21:34:32 +00:00
| sed -e 's/^.*:[ \t]*//')
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
stage${s}-${arch}-musl-${flavor}.conf
2014-06-09 00:00:41 +00:00
done
2014-06-09 00:00:41 +00:00
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
}
main() {
>zzz.log
undo_grsec
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
for arch in amd64 i686; do
for flavor in hardened vanilla; do
2014-06-09 00:00:41 +00:00
prepare_confs ${arch} ${flavor}
done
done
2014-01-27 12:22:49 +00:00
}
2014-06-09 00:00:41 +00:00
main $1 &