#!/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=(["snails"]="hbs" ["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