diff options
author | Karel Kočí <cynerd@email.cz> | 2018-10-10 18:27:14 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-10-10 18:27:14 +0200 |
commit | 0a442b052000d5deeb1d0bf3db79a3fe7b5daa93 (patch) | |
tree | baa4f73f3b97b253b5c7c18c3fc6f6719bf74f98 | |
parent | e3de17dc4be50aa251e687a2cf4d246b8c993ace (diff) | |
download | laminar-cnf-0a442b052000d5deeb1d0bf3db79a3fe7b5daa93.tar.gz laminar-cnf-0a442b052000d5deeb1d0bf3db79a3fe7b5daa93.tar.bz2 laminar-cnf-0a442b052000d5deeb1d0bf3db79a3fe7b5daa93.zip |
turris4x: tar sdk
It also for now drops flock. Change of sdk should be atomic thanks to
mv.
-rwxr-xr-x | templates/turris4x.run | 23 |
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 |