summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/turris4x.run23
1 files changed, 11 insertions, 12 deletions
diff --git a/templates/turris4x.run b/templates/turris4x.run
index 794bd04..49d82cb 100755
--- a/templates/turris4x.run
+++ b/templates/turris4x.run
@@ -12,10 +12,10 @@ fi
curl "https://repo.turris.cz/$BOARD-$BRANCH/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"
- flock --shared "$WORKSPACE/openwrt-sdk.lock" \
- cp -a "$WORKSPACE/openwrt-sdk" openwrt
+ tar -xzf "$WORKSPACE/openwrt.tar.gz"
else
echo_info "Building new version of SDK"
echo_stage "Get turris-build"
@@ -24,16 +24,15 @@ else
echo_stage "Prepare SDK"
mkdir openwrt
- flock --exclusive "$WORKSPACE/openwrt-sdk.lock" /bin/sh -s <<EOF
- cd openwrt
- GIT_MIRROR="$TWORKSPACE/openwrt-git-mirror" \
- CCACHE_HOST_DIR="$TWORKSPACE/ccache-host" \
- CCACHE_TARGET_DIR="$WORKSPACE/ccache-target" \
- ../turris-build/compile_fw -a "$njobs" -t $BOARD -p $BRANCH repo_prepare prepare_tools
- cd ..
- rm -rf "$WORKSPACE/openwrt-sdk"
- cp -a openwrt "$WORKSPACE/openwrt-sdk"
- cp git-hash "$WORKSPACE/openwrt-git-hash"
+ cd openwrt
+ GIT_MIRROR="$TWORKSPACE/openwrt-git-mirror" \
+ CCACHE_HOST_DIR="$TWORKSPACE/ccache-host" \
+ CCACHE_TARGET_DIR="$WORKSPACE/ccache-target" \
+ ../turris-build/compile_fw -a "$njobs" -t $BOARD -p $BRANCH repo_prepare prepare_tools
+ cd ..
+ tar -czf openwrt.tar.gz openwrt
+ mv openwrt.tar.gz "$WORKSPACE/openwrt.tar.gz"
+ mv git-hash "$WORKSPACE/openwrt-git-hash"
EOF
fi
cd openwrt