diff options
Diffstat (limited to 'generate.sh')
-rwxr-xr-x | generate.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..70e80d4 --- /dev/null +++ b/generate.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -eu +cd "$(dirname "$(readlink -f "$0")")" + +# Turris ######################################################################### +declare -A boards animals +boards=(["mox"]="aarch64_cortex-a53" ["omnia"]="arm_cortex-a9_vfpv3-d16" ["turris1x"]="powerpc_8540") +animals=(["turtles"]="hbt" ["kittens"]="hbk" ["lions"]="hbl" ["dragons"]="hbd") + +for animal in "${!animals[@]}"; do + for board in "${!boards[@]}"; do + job="turris-$animal-$board" + echo "Generating: $job" + ln -sf ../templates/turris.run "jobs/$job.run" + ln -sf ../templates/turris.conf "jobs/$job.conf" + cat >"jobs/$job.env" <<-EOF + BOARD=$board + ANIMAL=${animals[$animal]} + ARCH=${boards[$board]} + EOF + done +done + + +# Alpine ######################################################################### +declare -A archmap qemu +archs=("aarch64" "amd64" "armhf" "armv7") +archmap=(["amd64"]="x86_64") +qemu=(["armhf"]="arm" ["armv7"]="arm") + +for arch in "${archs[@]}"; do + job="alpine-$arch" + echo "Generating: $job" + ln -sf ../templates/alpine.run "jobs/$job.run" + ln -sf ../templates/alpine.conf "jobs/$job.conf" + if [ -n "${archmap[$arch]+x}" ]; then + arch="${archmap[$arch]}" + fi + { + echo "ARCH=$arch" + [ -z "${qemu[$arch]+x}" ] || \ + echo "QEMU_ARCH=${qemu[$arch]}" + } >"jobs/$job.env" +done |