From d42e01deb3eeff2a169b2bbbbff615d55c4c4ef7 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 21 Mar 2021 00:57:44 +0800 Subject: [PATCH] build: enhance make download speed --- .github/workflows/lo-test.yml | 15 ++++++++++++--- files/etc/opkg/distfeeds.conf | 12 ++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lo-test.yml b/.github/workflows/lo-test.yml index 1ba2e7c..7b26768 100644 --- a/.github/workflows/lo-test.yml +++ b/.github/workflows/lo-test.yml @@ -69,7 +69,6 @@ jobs: - name: Custom configure file run: | cd ~/lede - make defconfig && make tools/upx/compile -j$(($(nproc) + 1)) cat $GITHUB_WORKSPACE/$DEVICE.config.seed | sed '/CONFIG_PACKAGE_luci-app-/d' > .config echo >> .config find package/ -type d -name luci-app-* | rev | cut -d'/' -f1 | rev | xargs -n1 -i echo "# CONFIG_PACKAGE_{} is not set" >> .config @@ -90,6 +89,10 @@ jobs: rm -rf build_dir staging_dir; mv sdk/*/build_dir ./ && rsync -a --ignore-existing sdk/*/staging_dir/ ./staging_dir/ rm -rf sdk fi + sed -i '/182.140.223.146/d' scripts/download.pl + sed -i '/\.cn\//d' scripts/download.pl + sed -i '/tencent/d' scripts/download.pl + make defconfig && make tools/upx/compile -j$(($(nproc) + 1)) sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile echo -e '# CONFIG_SIGNED_PACKAGES is not set\n' >> .config @@ -109,6 +112,7 @@ jobs: mkdir -p files/local_feed/core files/local_feed/base sudo mount --bind bin/targets/*/*/packages/ files/local_feed/core sudo mount --bind bin/packages/*/base/ files/local_feed/base + pushd bin/ && . ../files/etc/opkg/distfeeds.conf | tee ../files/etc/opkg/distfeeds.conf && popd make -j$(($(nproc) + 1)) sudo umount files/local_feed/core files/local_feed/base @@ -165,8 +169,13 @@ jobs: ret=$(curl -sH "$AUTH" "https://api.$cache_path/tags/cache") echo $ret | jq -r '.assets[] | select(.name | contains ("'$DEVICE'.img")).id' | \ xargs -n1 -i curl -X DELETE -H "$AUTH" "https://api.$cache_path/assets/{}" - zstdmt -c --adapt --long lede.img | parallel --wc --block 1.99G --pipe \ - 'curl -s --data-binary @- -H "$AUTH" -H "Content-Type: application/octet-stream" https://uploads.$cache_path/$cache_repo_id/assets?name=lede.'$DEVICE'.img.zst.0{#} > /dev/null' + #zstdmt -c --adapt --long lede.img | parallel --wc --block 1.99G --pipe \ + #'curl -s --data-binary @- -H "$AUTH" -H "Content-Type: application/octet-stream" https://uploads.$cache_path/$cache_repo_id/assets?name=lede.'$DEVICE'.img.zst.0{#} > /dev/null' + zstdmt -c --long lede.img | split --numeric=1 -b 2000m - lede.$DEVICE.img.zst. + for f in *img.zst* + do + while true; do curl --data-binary @$f -H "$AUTH" -H 'Content-Type: application/octet-stream' "https://uploads.$cache_path/$cache_repo_id/assets?name=$f" && break || true; done + done - name: Send tg notification uses: appleboy/telegram-action@master diff --git a/files/etc/opkg/distfeeds.conf b/files/etc/opkg/distfeeds.conf index 6c6f3e7..824f376 100644 --- a/files/etc/opkg/distfeeds.conf +++ b/files/etc/opkg/distfeeds.conf @@ -1,6 +1,6 @@ -src/gz immortalwrt_core file:///local_feed/core -src/gz immortalwrt_base file:///local_feed/base -src/gz immortalwrt_luci https://mirrors.tencent.com/lede/releases/18.06.9/packages/aarch64_generic/luci -src/gz immortalwrt_packages https://mirrors.tencent.com/lede/releases/18.06.9/packages/aarch64_generic/packages -src/gz immortalwrt_routing https://mirrors.tencent.com/lede/releases/18.06.9/packages/aarch64_generic/routing -src/gz immortalwrt_telephony https://mirrors.tencent.com/lede/releases/18.06.9/packages/aarch64_generic/telephony +echo src/gz immortalwrt_core file:///local_feed/core +echo src/gz immortalwrt_base file:///local_feed/base +echo src/gz immortalwrt_packages https://mirrors.tencent.com/lede/snapshots/$(ls -d packages/*/packages) +echo src/gz immortalwrt_luci https://mirrors.tencent.com/lede/releases/18.06.9/$(ls -d packages/*/luci) +echo src/gz immortalwrt_routing https://mirrors.tencent.com/lede/releases/18.06.9/$(ls -d packages/*/routing) +echo src/gz immortalwrt_telephony https://mirrors.tencent.com/lede/releases/18.06.9/$(ls -d packages/*/telephony) \ No newline at end of file