From 7b1aef260402f538e3c60c83bfb79f9f41fcbf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 26 Aug 2018 14:11:30 +0200 Subject: Add initial configuration This is just initial test for turris3x-omnia --- jobs/turris3x-omnia.env | 2 ++ jobs/turris3x-omnia.run | 1 + scripts/utils | 23 +++++++++++++++++++++++ templates/turris3x.run | 24 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 jobs/turris3x-omnia.env create mode 120000 jobs/turris3x-omnia.run create mode 100644 scripts/utils create mode 100755 templates/turris3x.run diff --git a/jobs/turris3x-omnia.env b/jobs/turris3x-omnia.env new file mode 100644 index 0000000..9c2037e --- /dev/null +++ b/jobs/turris3x-omnia.env @@ -0,0 +1,2 @@ +SDK_URI=https://repo.turris.cz/omnia-nightly/OpenWrt-SDK-mvebu_gcc-4.8-linaro_musl-1.1.15_eabi.Linux-x86_64.tar.bz2 +GIT_REPO=https://git.cynerd.cz/openwrt-personal-pkgs diff --git a/jobs/turris3x-omnia.run b/jobs/turris3x-omnia.run new file mode 120000 index 0000000..7171463 --- /dev/null +++ b/jobs/turris3x-omnia.run @@ -0,0 +1 @@ +../templates/turris3x.run \ No newline at end of file diff --git a/scripts/utils b/scripts/utils new file mode 100644 index 0000000..b88d4a4 --- /dev/null +++ b/scripts/utils @@ -0,0 +1,23 @@ +# vim: ft=sh + +# Simple echo wrapper for stage marking +echo_stage() { + echo "========== $@ ==========" +} + +# Fetch git repository to WORKSPACE and create workspace in current directory +# First agument has to be a source URL +# Second argument is name of directory to which will be directory cloned in. +# Second argument is optional and should be branch name (master is used if not +# provided). +git_fetch() { + local BRANCH="$3" + [ -n "$BRANCH" ] || BRANCH=master + local GITARGS="--git-dir='$WORKSPACE/$2' --bare" + if [ ! -d "$WORKSPACE/$2" ]; then + git clone --bare "$1" "$WORKSPACE/$2" + else + git $GITARGS fetch --prune --prune-tags --force "$1" "$BRANCH:$BRANCH" + fi + git $GITARGS worktree add --detach $2 $BRANCH +} diff --git a/templates/turris3x.run b/templates/turris3x.run new file mode 100755 index 0000000..bc8b56a --- /dev/null +++ b/templates/turris3x.run @@ -0,0 +1,24 @@ +# vim: ft=sh +set -e +. utils + +echo_stage "Get packages" +git_fetch "$GIT_REPO" pkgs turris3x + +# TODO download only once a day +echo_strage "Download SDK" +wget "$SDK_URI" -O sdk.tar.bz2 +mv sdk.tar.bz2 "$WORKSPACE/sdk.tar.bz2" + +echo_stage "Export SDK" +tar -xjf "$WORKSPACE/sdk.tar.bz2" +cd OpenWRT-SDK-* + +echo_stage "Copy packages" +cp -r ../pkgs/* package/ + +echo_stage "Build" +make -j1 V=99 + +# TODO sign +# TODO copy to repository -- cgit v1.2.3