From 4ddd4057e2ab91e30f61cfa757605bfd0cca4d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 9 Feb 2019 17:34:28 +0100 Subject: turris: change how we do Turris 4.x --- jobs/turris-dragons-mox.conf | 1 + jobs/turris-dragons-mox.env | 3 ++ jobs/turris-dragons-mox.run | 1 + jobs/turris-dragons-omnia.conf | 1 + jobs/turris-dragons-omnia.env | 3 ++ jobs/turris-dragons-omnia.run | 1 + jobs/turris-kittens-mox.conf | 1 + jobs/turris-kittens-mox.env | 3 ++ jobs/turris-kittens-mox.run | 1 + jobs/turris-kittens-omnia.conf | 1 + jobs/turris-kittens-omnia.env | 3 ++ jobs/turris-kittens-omnia.run | 1 + jobs/turris4x-mox.conf | 1 - jobs/turris4x-mox.env | 3 -- jobs/turris4x-mox.run | 1 - jobs/turris4x-omnia.conf | 1 - jobs/turris4x-omnia.env | 3 -- jobs/turris4x-omnia.run | 1 - jobs/turris4x-turris.conf | 1 - jobs/turris4x-turris.env | 3 -- jobs/turris4x-turris.run | 1 - templates/turris.run | 62 ++++++++++++++++++++++++++++++++++++++++++ templates/turris4x.run | 62 ------------------------------------------ 23 files changed, 82 insertions(+), 77 deletions(-) create mode 120000 jobs/turris-dragons-mox.conf create mode 100644 jobs/turris-dragons-mox.env create mode 120000 jobs/turris-dragons-mox.run create mode 120000 jobs/turris-dragons-omnia.conf create mode 100644 jobs/turris-dragons-omnia.env create mode 120000 jobs/turris-dragons-omnia.run create mode 120000 jobs/turris-kittens-mox.conf create mode 100644 jobs/turris-kittens-mox.env create mode 120000 jobs/turris-kittens-mox.run create mode 120000 jobs/turris-kittens-omnia.conf create mode 100644 jobs/turris-kittens-omnia.env create mode 120000 jobs/turris-kittens-omnia.run delete mode 120000 jobs/turris4x-mox.conf delete mode 100644 jobs/turris4x-mox.env delete mode 120000 jobs/turris4x-mox.run delete mode 120000 jobs/turris4x-omnia.conf delete mode 100644 jobs/turris4x-omnia.env delete mode 120000 jobs/turris4x-omnia.run delete mode 120000 jobs/turris4x-turris.conf delete mode 100644 jobs/turris4x-turris.env delete mode 120000 jobs/turris4x-turris.run create mode 100755 templates/turris.run delete mode 100755 templates/turris4x.run diff --git a/jobs/turris-dragons-mox.conf b/jobs/turris-dragons-mox.conf new file mode 120000 index 0000000..fafbc63 --- /dev/null +++ b/jobs/turris-dragons-mox.conf @@ -0,0 +1 @@ +../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris-dragons-mox.env b/jobs/turris-dragons-mox.env new file mode 100644 index 0000000..350ce74 --- /dev/null +++ b/jobs/turris-dragons-mox.env @@ -0,0 +1,3 @@ +BOARD=mox +ANIMAL=hbd +ARCH=aarch64_cortex-a53 diff --git a/jobs/turris-dragons-mox.run b/jobs/turris-dragons-mox.run new file mode 120000 index 0000000..683ec07 --- /dev/null +++ b/jobs/turris-dragons-mox.run @@ -0,0 +1 @@ +../templates/turris.run \ No newline at end of file diff --git a/jobs/turris-dragons-omnia.conf b/jobs/turris-dragons-omnia.conf new file mode 120000 index 0000000..fafbc63 --- /dev/null +++ b/jobs/turris-dragons-omnia.conf @@ -0,0 +1 @@ +../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris-dragons-omnia.env b/jobs/turris-dragons-omnia.env new file mode 100644 index 0000000..daaff0b --- /dev/null +++ b/jobs/turris-dragons-omnia.env @@ -0,0 +1,3 @@ +BOARD=omnia +ANIMAL=hbd +ARCH=arm_cortex-a9_vfpv3 diff --git a/jobs/turris-dragons-omnia.run b/jobs/turris-dragons-omnia.run new file mode 120000 index 0000000..683ec07 --- /dev/null +++ b/jobs/turris-dragons-omnia.run @@ -0,0 +1 @@ +../templates/turris.run \ No newline at end of file diff --git a/jobs/turris-kittens-mox.conf b/jobs/turris-kittens-mox.conf new file mode 120000 index 0000000..fafbc63 --- /dev/null +++ b/jobs/turris-kittens-mox.conf @@ -0,0 +1 @@ +../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris-kittens-mox.env b/jobs/turris-kittens-mox.env new file mode 100644 index 0000000..d9adf5f --- /dev/null +++ b/jobs/turris-kittens-mox.env @@ -0,0 +1,3 @@ +BOARD=mox +ANIMAL=hbk +ARCH=aarch64_cortex-a53 diff --git a/jobs/turris-kittens-mox.run b/jobs/turris-kittens-mox.run new file mode 120000 index 0000000..683ec07 --- /dev/null +++ b/jobs/turris-kittens-mox.run @@ -0,0 +1 @@ +../templates/turris.run \ No newline at end of file diff --git a/jobs/turris-kittens-omnia.conf b/jobs/turris-kittens-omnia.conf new file mode 120000 index 0000000..fafbc63 --- /dev/null +++ b/jobs/turris-kittens-omnia.conf @@ -0,0 +1 @@ +../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris-kittens-omnia.env b/jobs/turris-kittens-omnia.env new file mode 100644 index 0000000..3d6c6bf --- /dev/null +++ b/jobs/turris-kittens-omnia.env @@ -0,0 +1,3 @@ +BOARD=omnia +ANIMAL=hbk +ARCH=arm_cortex-a9_vfpv3 diff --git a/jobs/turris-kittens-omnia.run b/jobs/turris-kittens-omnia.run new file mode 120000 index 0000000..683ec07 --- /dev/null +++ b/jobs/turris-kittens-omnia.run @@ -0,0 +1 @@ +../templates/turris.run \ No newline at end of file diff --git a/jobs/turris4x-mox.conf b/jobs/turris4x-mox.conf deleted file mode 120000 index fafbc63..0000000 --- a/jobs/turris4x-mox.conf +++ /dev/null @@ -1 +0,0 @@ -../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris4x-mox.env b/jobs/turris4x-mox.env deleted file mode 100644 index 73cfdbc..0000000 --- a/jobs/turris4x-mox.env +++ /dev/null @@ -1,3 +0,0 @@ -BOARD=mox -BRANCH=hbk -ARCH=aarch64_cortex-a53 diff --git a/jobs/turris4x-mox.run b/jobs/turris4x-mox.run deleted file mode 120000 index 4523cf7..0000000 --- a/jobs/turris4x-mox.run +++ /dev/null @@ -1 +0,0 @@ -../templates/turris4x.run \ No newline at end of file diff --git a/jobs/turris4x-omnia.conf b/jobs/turris4x-omnia.conf deleted file mode 120000 index fafbc63..0000000 --- a/jobs/turris4x-omnia.conf +++ /dev/null @@ -1 +0,0 @@ -../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris4x-omnia.env b/jobs/turris4x-omnia.env deleted file mode 100644 index 28401f8..0000000 --- a/jobs/turris4x-omnia.env +++ /dev/null @@ -1,3 +0,0 @@ -BOARD=omnia -BRANCH=hbk -ARCH=arm_cortex-a9_vfpv3 diff --git a/jobs/turris4x-omnia.run b/jobs/turris4x-omnia.run deleted file mode 120000 index 4523cf7..0000000 --- a/jobs/turris4x-omnia.run +++ /dev/null @@ -1 +0,0 @@ -../templates/turris4x.run \ No newline at end of file diff --git a/jobs/turris4x-turris.conf b/jobs/turris4x-turris.conf deleted file mode 120000 index fafbc63..0000000 --- a/jobs/turris4x-turris.conf +++ /dev/null @@ -1 +0,0 @@ -../templates/turris.conf \ No newline at end of file diff --git a/jobs/turris4x-turris.env b/jobs/turris4x-turris.env deleted file mode 100644 index b490946..0000000 --- a/jobs/turris4x-turris.env +++ /dev/null @@ -1,3 +0,0 @@ -BOARD=turris -BRANCH=hbk -ARCH=powerpc_8540 diff --git a/jobs/turris4x-turris.run b/jobs/turris4x-turris.run deleted file mode 120000 index 4523cf7..0000000 --- a/jobs/turris4x-turris.run +++ /dev/null @@ -1 +0,0 @@ -../templates/turris4x.run \ No newline at end of file diff --git a/templates/turris.run b/templates/turris.run new file mode 100755 index 0000000..5f4aeb3 --- /dev/null +++ b/templates/turris.run @@ -0,0 +1,62 @@ +#!/bin/sh +# vim: ft=sh +. "$(dirname "$(readlink -f "$0")")/../job.common" + +if [ "$V" -ge 1 ]; then + make="make -j1 IS_TTY=1 BUILD_LOG=1 V=99" +else + make="make -j4 IS_TTY=1 BUILD_LOG=1" +fi + +curl "https://repo.turris.cz/$ANIMAL/packages/$BOARD/git-hash" > git-hash +cat git-hash +# TODO take lock so we won't run multiple instances of new builds +if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then + echo_info "Using previous version of SDK" + tar -xzf "$WORKSPACE/openwrt.tar.gz" +else + echo_info "Building new version of SDK" + echo_stage "Get turris-build" + TB_HASH="$(awk '/ \* turris-build\: /{print $3}' git-hash)" + git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$TB_HASH" + + echo_stage "Prepare SDK" + mkdir openwrt + ( + cd openwrt + cat > .turris-build.conf <> feeds.conf +./scripts/feeds update personal +./scripts/feeds list -r personal | awk '{print $1}' | xargs ./scripts/feeds uninstall # Remove any package provided by personal feed +./scripts/feeds install -p personal -d y -f -a + +echo_stage "Compile packages from personal feed" +find package/feeds/personal -mindepth 1 -maxdepth 1 -printf 'package/%P/compile\0' | \ + xargs --null $make + +echo_stage "Generate index and sign" +$make package/index BUILD_KEY=~/openwrt-repo.key + +echo_stage "Deploy" +ssh upload rm -rf "deploy-turris-$ANIMAL-$BOARD" +scp -r "bin/packages/$ARCH/personal" upload:deploy-turris-$BOARD +ssh upload /bin/sh -e < git-hash -cat git-hash -# TODO take lock so we won't run multiple instances of new builds -if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then - echo_info "Using previous version of SDK" - tar -xzf "$WORKSPACE/openwrt.tar.gz" -else - echo_info "Building new version of SDK" - echo_stage "Get turris-build" - TB_HASH="$(awk '/ \* turris-build\: /{print $3}' git-hash)" - git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$TB_HASH" - - echo_stage "Prepare SDK" - mkdir openwrt - ( - cd openwrt - cat > .turris-build.conf <> feeds.conf -./scripts/feeds update personal -./scripts/feeds list -r personal | awk '{print $1}' | xargs ./scripts/feeds uninstall # Remove any package provided by personal feed -./scripts/feeds install -p personal -d y -f -a - -echo_stage "Compile packages from personal feed" -find package/feeds/personal -mindepth 1 -maxdepth 1 -printf 'package/%P/compile\0' | \ - xargs --null $make - -echo_stage "Generate index and sign" -$make package/index BUILD_KEY=~/openwrt-repo.key - -echo_stage "Deploy" -ssh upload rm -rf "deploy-turris4x-$BOARD" -scp -r "bin/packages/$ARCH/personal" upload:deploy-turris4x-$BOARD -ssh upload /bin/sh -e <