From b3966853d6c336bc66d304b448ac65280bce7957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 19 Jan 2017 15:10:01 +0100 Subject: Initial commit --- build_repo.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 build_repo.sh (limited to 'build_repo.sh') diff --git a/build_repo.sh b/build_repo.sh new file mode 100755 index 0000000..dd7f6bc --- /dev/null +++ b/build_repo.sh @@ -0,0 +1,61 @@ +#!/bin/sh +set -e +#set -x + +cd `dirname $0` + +BOARD=omnia +if [ "$1" = "omnia" ] || [ "$1" = "turris" ] || [ "$1" = "all" ]; then + BOARD=$1 + shift +fi + +# remove previous build +rm -rf .omnia-sdk +rm -rf .turris-sdk + +if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then + echo "Getting current SDK for omnia" + curl "https://repo.turris.cz/omnia/OpenWrt-SDK-mvebu_gcc-4.8-linaro_musl-1.1.15_eabi.Linux-x86_64.tar.bz2" \ + | tar -xjf - + mv OpenWrt-SDK-mvebu_* .omnia-sdk +fi +if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then + echo "Getting current SDK for turris" + wget "https://repo.turris.cz/turris/OpenWrt-SDK-mpc85xx-p2020-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2" \ + | tar -xjf - + mv OpenWrt-SDK-mpc85xx* .turris-sdk +fi + +echo "Copy packages" +for d in *; do + [ -f $d/Makefile ] || continue + [ -d .omnia-sdk ] && cp -r $d .omnia-sdk/package/ + [ -d .turris-sdk ] && cp -r $d .turris-sdk/package/ +done + +if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then + echo "Building omnia" + (cd .omnia-sdk; make $@) +fi +if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then + echo "Building turris" + (cd .turris-sdk; make $@) +fi + +deploy() { + echo "Sign and deploy $1" + SEC=$PWD/myrepo-cert/files/key.sec + pushd .$1-sdk + staging_dir/host/bin/usign -S -s $SEC -m bin/mvebu-musl/packages/base/Packages + scp bin/mvebu-musl/packages/base/* freebsd@cynerd.cz:/usr/local/www/data/myrepo/$1/ + popd + scp $1.lua freebsd@cynerd.cz:/usr/local/www/data/myrepo/$1.lua +} + +if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then + deploy omnia +fi +if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then + deploy turris +fi -- cgit v1.2.3