summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/turris4x.run26
1 files changed, 14 insertions, 12 deletions
diff --git a/templates/turris4x.run b/templates/turris4x.run
index 9321d90..97aa745 100755
--- a/templates/turris4x.run
+++ b/templates/turris4x.run
@@ -5,16 +5,7 @@ set -e
MAKE="make -j4 IS_TTY=1 BUILD_LOG=1"
-laminar_self_lock sdk
-curl "https://repo.turris.cz/$BOARD-$BRANCH/git-hash" > git-hash
-if [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then
- echo_info "Using previous version of SDK"
- cp -a "$WORKSPACE/openwrt-sdk" openwrt
- cd openwrt
-
-else
- echo_info "Building new version of SDK"
-
+build_sdk() {
echo_stage "Get turris-build"
HASH="$(awk '/ \* turris-build\: /{print $3}' git-hash)"
git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$HASH"
@@ -36,10 +27,21 @@ else
rm -rf "$WORKSPACE/openwrt-sdk"
cp -a openwrt "$WORKSPACE/openwrt-sdk"
cp git-hash "$WORKSPACE/openwrt-git-hash"
- cd openwrt
+}
+
+copy_sdk() {
+ cp -a "$WORKSPACE/openwrt-sdk" openwrt
+}
+curl "https://repo.turris.cz/$BOARD-$BRANCH/git-hash" > git-hash
+if [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then
+ echo_info "Using previous version of SDK"
+ flock --shared "$WORKSPACE/openwrt-sdk.lock" -c copy_sdk
+else
+ echo_info "Building new version of SDK"
+ flock --exclusive "$WORKSPACE/openwrt-sdk.lock" -c build_sdk
fi
-laminar_self_release sdk
+cd openwrt
echo_stage "Add our repository as feed"
echo "src-git personal git@cynerd.cz:openwrt-personal-pkgs" >> feeds.conf