summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2018-08-27 13:50:20 +0200
committerKarel Kočí <karel.koci@nic.cz>2018-08-27 13:50:20 +0200
commit6ae29849feb8c4234f9ffd9a92d00d346da0e6be (patch)
treeb6bc3be65c4c04d01fbec4265d5b33fc57bb48be
parent97bf9457b18156e77c5fb6e9d61fbcdc93e06163 (diff)
downloadlaminar-cnf-6ae29849feb8c4234f9ffd9a92d00d346da0e6be.tar.gz
laminar-cnf-6ae29849feb8c4234f9ffd9a92d00d346da0e6be.tar.bz2
laminar-cnf-6ae29849feb8c4234f9ffd9a92d00d346da0e6be.zip
Add initial implementation for turris4x
-rw-r--r--jobs/turris4x-mox.env3
l---------jobs/turris4x-mox.run1
-rwxr-xr-xtemplates/turris4x.run42
3 files changed, 46 insertions, 0 deletions
diff --git a/jobs/turris4x-mox.env b/jobs/turris4x-mox.env
new file mode 100644
index 0000000..165a6fe
--- /dev/null
+++ b/jobs/turris4x-mox.env
@@ -0,0 +1,3 @@
+BOARD=mox
+BRANCH=hbd
+ARCH=aarch64_cortex-a53
diff --git a/jobs/turris4x-mox.run b/jobs/turris4x-mox.run
new file mode 120000
index 0000000..4523cf7
--- /dev/null
+++ b/jobs/turris4x-mox.run
@@ -0,0 +1 @@
+../templates/turris4x.run \ No newline at end of file
diff --git a/templates/turris4x.run b/templates/turris4x.run
new file mode 100755
index 0000000..210aa44
--- /dev/null
+++ b/templates/turris4x.run
@@ -0,0 +1,42 @@
+#!/bin/sh
+# vim: ft=sh
+set -e
+. utils
+
+echo_stage "Get packages"
+git_fetch "https://git.cynerd.cz/openwrt-personal-pkgs" pkgs
+
+echo_stage "Get turris-build"
+HASH="$(curl "https://repo.turris.cz/$BOARD-$BRANCH/git-hash" | awk '/ \* turris-build\: /{print $3}')"
+HASH="repo_checkout" # TODO remove this when repo_checkout is integrated
+git_fetch "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$HASH"
+
+echo_stage "Prepare SDK"
+mkdir openwrt
+cd openwrt
+echo ../turris-build/compile_fw -t $BOARD -p $BRANCH repo_prepare
+../turris-build/compile_fw -t $BOARD -p $BRANCH repo_prepare
+
+echo_stage "Add our repository as feed"
+echo "src-git personal $WORKSPACE/pkgs" >> feeds.conf
+./scripts/feeds update personal
+./scripts/feeds install -p personal -d y -f -a
+
+echo_stage "Compile tools"
+make -j4 tools/compile toolchain/compile
+
+echo_stage "Compile packages from our feed"
+make -j4 $(./scripts/feeds list -r turrispackages | sed -n 's/^\([^ ]*\).*$/package\/\1\/compile/p' | tr '\n' ' ')
+
+# TODO is there Packages index? Where the hack it is?
+#echo_stage "Sign"
+#./staging_dir/host/bin/usign -S -s ~/openwrt-repo.key -m "bin/packages/$ARCH/personal/Packages"
+
+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 <<EOF
+ mkdir -p /var/www/repo/turris4x
+ rm -rf /var/www/repo/turris4x/$BOARD
+ mv deploy-turris4x-$BOARD /var/www/repo/turris4x/$BOARD
+EOF