diff --git a/.github/workflows/bcm27xx-bcm2708.yml b/.github/workflows/bcm27xx-bcm2708.yml deleted file mode 100644 index 4f0e790b..00000000 --- a/.github/workflows/bcm27xx-bcm2708.yml +++ /dev/null @@ -1,505 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build bcm27xx/bcm2708 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 0 * * 2,4,6 - # watch: - # types: started - -env: - CONFIG_FILE: config/bcm27xx/bcm2708.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv6 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-rpi1 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-rpi1 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-rpi1 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/bcm27xx-bcm2709.yml b/.github/workflows/bcm27xx-bcm2709.yml deleted file mode 100644 index cce6ee5f..00000000 --- a/.github/workflows/bcm27xx-bcm2709.yml +++ /dev/null @@ -1,505 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build bcm27xx/bcm2709 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 6 * * 0,1,3,5 - # watch: - # types: started - -env: - CONFIG_FILE: config/bcm27xx/bcm2709.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv7 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-rpi2 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-rpi2 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-rpi2 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/bcm27xx-bcm2710.yml b/.github/workflows/bcm27xx-bcm2710.yml deleted file mode 100644 index d729552d..00000000 --- a/.github/workflows/bcm27xx-bcm2710.yml +++ /dev/null @@ -1,505 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build bcm27xx/bcm2710 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 12 * * 0,1,3,5 - # watch: - # types: started - -env: - CONFIG_FILE: config/bcm27xx/bcm2710.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv8 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-rpi3 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-rpi3 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-rpi3 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/bcm27xx-bcm2711.yml b/.github/workflows/bcm27xx-bcm2711.yml deleted file mode 100644 index 99d34d26..00000000 --- a/.github/workflows/bcm27xx-bcm2711.yml +++ /dev/null @@ -1,507 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build bcm27xx/bcm2711 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 18 * * 0,1,3,5 - # watch: - # types: started - -env: - CONFIG_FILE: config/bcm27xx/bcm2711.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv8 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-rpi4 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-rpi4 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - echo -e "CONFIG_USB_LAN78XX=y\nCONFIG_USB_NET_DRIVERS=y" >> target/linux/bcm27xx/bcm2711/config-5.4 - sed -i 's/36/44/g;s/VHT80/VHT20/g' package/kernel/mac80211/files/lib/wifi/mac80211.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-rpi4 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/cache-packages.yml b/.github/workflows/cache-packages.yml index b7e6bf36..f76a2965 100644 --- a/.github/workflows/cache-packages.yml +++ b/.github/workflows/cache-packages.yml @@ -6,15 +6,14 @@ # Blog: https://p3terx.com #================================================= -name: Cache OpenWrt Packages +name: Cache Packages on: repository_dispatch: + types: [cache] workflow_dispatch: schedule: - cron: 0 18 * * * -# watch: -# types: started env: REPO_URL: https://github.com/immortalwrt/immortalwrt @@ -22,47 +21,32 @@ env: jobs: Build: - runs-on: project-cache + runs-on: cache steps: - name: Checkout uses: actions/checkout@main - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - - name: Clone Source Code run: | df -hT $PWD git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt - - name: Update Feeds + - name: Install Feeds run: | cd openwrt - echo "OPENWRTROOT=$PWD" >> $GITHUB_ENV ./scripts/feeds update -a - - - name: Install Feeds - run: | - cd $OPENWRTROOT ./scripts/feeds install -a - name: Download All Packages run: | - cd $OPENWRTROOT - wget -q https://raw.githubusercontent.com/openwrt/openwrt/master/scripts/download.pl -O scripts/download.pl + cd openwrt echo "CONFIG_ALL=y" >> .config make defconfig - make download -j16 IGNORE_ERRORS=1 + make download -j32 IGNORE_ERRORS=1 find dl -size -1024c -exec ls -l {} \; find dl -size -1024c -exec rm -f {} \; mkdir -p /data/cache rm -rf /data/cache/dl - cp -r dl /data/cache + mv dl /data/cache diff --git a/.github/workflows/delete-workflows.yml b/.github/workflows/delete-workflows.yml index eef96fd7..71786071 100644 --- a/.github/workflows/delete-workflows.yml +++ b/.github/workflows/delete-workflows.yml @@ -1,4 +1,4 @@ -name: Delete Old Workflows +name: Delete Workflows on: workflow_dispatch: @@ -16,12 +16,3 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} retain_days: 7 - - - name: Delete Old Toolchain Assets - uses: mknejp/delete-release-assets@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: rockchip-armv8 - fail-if-no-assets: false - fail-if-no-release: false - assets: "*" diff --git a/.github/workflows/ipq40xx-generic.yml b/.github/workflows/ipq40xx-generic.yml deleted file mode 100644 index e236ee90..00000000 --- a/.github/workflows/ipq40xx-generic.yml +++ /dev/null @@ -1,390 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build ipq40xx/generic openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 0 * * 2,4,6 - # watch: - # types: started - -env: - CONFIG_FILE: config/ipq40xx/generic.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv7 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-gdock - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-gdock - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 00000000..8de386a4 --- /dev/null +++ b/.github/workflows/packages.yml @@ -0,0 +1,255 @@ +#================================================= +# https://github.com/P3TERX/Actions-OpenWrt +# Description: Build OpenWrt using GitHub Actions +# Lisence: MIT +# Author: P3TERX +# Blog: https://p3terx.com +#================================================= + +name: Build Packages + +on: + repository_dispatch: + types: [packages] + workflow_dispatch: + inputs: + INPUT_TARGET: + description: "Target to build (platform/target/subtarget)" + required: false + default: "all" + schedule: + - cron: 0 20 * * 0,2,4 + +env: + SOURCE_URL: https://github.com/immortalwrt/immortalwrt + SOURCE_BRANCH: openwrt-18.06-k5.4 + CURRENT_BRANCH: main + WEB_ROOT_PATH: /data/www/openwrt.cc + TOOLCHAIN_TAG: toolchain + TZ: Asia/Shanghai + +jobs: + Config: + name: Generate Config + runs-on: ubuntu-latest + outputs: + TARGETS: ${{ steps.find-targets.outputs.TARGETS }} + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Find Targets + id: find-targets + env: + INPUT_TARGET: ${{ github.event.inputs.INPUT_TARGET }} + run: | + if [ "$INPUT_TARGET" = "all" ] || [ "$INPUT_TARGET" = "" ]; then + export TARGETS="$(cat $GITHUB_WORKSPACE/data/support/platform.config)" + else + export TARGETS="$INPUT_TARGET" + fi + JSON='{"config": ["default"], "targets":[' + FIRST=1 + for TARGET in $TARGETS; do + [[ $FIRST -ne 1 ]] && JSON="$JSON"',' + JSON="$JSON"'"'"${TARGET}"'"' + FIRST=0 + done + JSON="$JSON"']}' + echo $JSON + echo "::set-output name=TARGETS::$JSON" + + Packages: + name: Packages ${{ matrix.TARGETS }} + needs: [Config] + runs-on: packages + strategy: + fail-fast: false + max-parallel: 1 + matrix: ${{fromJson(needs.Config.outputs.TARGETS)}} + + steps: + - name: Clean Environment + run: | + sudo umount /dev/loop*p1 || true + sudo losetup -D || true + sudo umount overlay || true + sudo rm -rf workspace || true + + - name: Checkout + uses: actions/checkout@main + + - name: Generate Variables + id: env + run: | + export SOURCE_OWNER=$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}') + echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV + export SOURCE_REPO=$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}') + echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV + export DEVICE_PLATFORM=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $1}') + echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV + export DEVICE_TARGET=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $2}') + echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV + export DEVICE_SUBTARGET=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $3}') + echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV + export TARGET_INFO="$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" + echo "TARGET_INFO=$TARGET_INFO" >> $GITHUB_ENV + + - name: Prepare Toolchain Image + run: | + mkdir -p workspace + cd workspace + for i in {0..9} + do + curl -fsL https://github.com/$GITHUB_REPOSITORY/releases/download/$TOOLCHAIN_TAG/toolchain-${TARGET_INFO}.img.0$i >> toolchain-${TARGET_INFO}.img || break + done + mkdir -p openwrt-ro openwrt workdir overlay + sudo mount -o loop toolchain-${TARGET_INFO}.img openwrt-ro + sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt + sudo chown runner:runner openwrt + cd openwrt + echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV + git pull + + - name: Import Build Keys + env: + BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} + BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} + if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null + run: | + cd $OPENWRT_ROOT_PATH + echo -e "$BUILD_PRIVATEKEY" > key-build + echo -e "$BUILD_PUBLICKEY" > key-build.pub + wc -c key-build key-build.pub + + - name: Install Feeds + run: | + cd $OPENWRT_ROOT_PATH + ./scripts/feeds update -a + ./scripts/feeds install -a + + - name: Generate Config File + run: | + cd $OPENWRT_ROOT_PATH + echo CONFIG_TARGET_${DEVICE_TARGET}=y > .config + echo CONFIG_TARGET_${DEVICE_TARGET}_${DEVICE_SUBTARGET}=y >> .config + cat $GITHUB_WORKSPACE/config/packages.config >> .config + echo -e "\n---- Original Config Start ----\n" + cat .config + echo -e "\n---- Original Config End ----\n" + make defconfig + echo -e "\n---- Whole Config Start ----\n" + cat .config + echo -e "\n---- Whole Config End ----\n" + + - name: Download Source Packages + run: | + cd $OPENWRT_ROOT_PATH + cp -rf /data/cache/dl . + make download -j64 + + - name: Compile Kmods + run: | + cd $OPENWRT_ROOT_PATH + make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 || \ + yes n | make target/compile -j1 V=s IGNORE_ERRORS=1 + + - name: Compile Packages + timeout-minutes: 240 + run: | + cd $OPENWRT_ROOT_PATH + make package/compile -j$(nproc) IGNORE_ERRORS="y m n" BUILD_LOG=1 + + - name: Generate Packages Index + run: | + cd $OPENWRT_ROOT_PATH + make package/index V=s + + - name: Collect Failed Logs + if: always() + run: | + cd $OPENWRT_ROOT_PATH + echo 'Build Failed Packages:' + cat logs/package/error.txt | awk '{print $2}' + cat logs/package/error.txt | awk '{print $2}' | sed 's/$/&\//g' > failed-packages.txt + mkdir -p faillogs + rsync -aq --files-from=failed-packages.txt logs/ faillogs/ + cp -f logs/package/error.txt faillogs + + - name: Upload Failed Logs To Artifact + if: always() + uses: actions/upload-artifact@main + with: + name: Logs-${{ env.DEVICE_PLATFORM }} + path: ${{ env.OPENWRT_ROOT_PATH }}/faillogs + if-no-files-found: ignore + + - name: Deploy Files To Backblaze + continue-on-error: true + env: + B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}" + B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}" + SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" + DEST_PACKAGES: "b2://${{ secrets.B2_BUCKETNAME }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" + if: env.B2_APPLICATION_KEY != null && env.B2_APPLICATION_KEY_ID != null + run: | + b2 authorize-account $B2_APPLICATION_KEY_ID $B2_APPLICATION_KEY + b2 sync --noProgress --threads 32 --keepDays 7 --replaceNewer $SOURCE_PACKAGES $DEST_PACKAGES + + - name: Deploy FailLogs To Backblaze + continue-on-error: true + env: + B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}" + B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}" + SOURCE_FAILLOGS: "${{ env.OPENWRT_ROOT_PATH }}/faillogs/" + DEST_FAILLOGS: "b2://${{ secrets.B2_BUCKETNAME }}/snapshots/faillogs/packages/${{ env.DEVICE_PLATFORM }}/" + if: env.B2_APPLICATION_KEY != null && env.B2_APPLICATION_KEY_ID != null + run: | + b2 authorize-account $B2_APPLICATION_KEY_ID $B2_APPLICATION_KEY + b2 sync --noProgress --threads 32 --keepDays 7 --replaceNewer $SOURCE_FAILLOGS $DEST_FAILLOGS + + - name: Deploy Files To Server + continue-on-error: true + env: + HOST: "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" + SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" + DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" + SERVER_PRIVATEKEY: "${{ secrets.SERVER_PRIVATEKEY }}" + if: env.SERVER_PRIVATEKEY != null + run: | + mkdir -p ~/.ssh/ + install -m 600 /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SERVER_PRIVATEKEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ + bash -c "'mkdir -p $DEST_PACKAGES'" + rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES + + - name: Deploy FailLogs To Server + continue-on-error: true + env: + HOST: "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" + SOURCE_FAILLOGS: "${{ env.OPENWRT_ROOT_PATH }}/faillogs/" + DEST_FAILLOGS: "${{ env.WEB_ROOT_PATH }}/snapshots/faillogs/packages/${{ env.DEVICE_PLATFORM }}/" + SERVER_PRIVATEKEY: "${{ secrets.SERVER_PRIVATEKEY }}" + if: env.SERVER_PRIVATEKEY != null && always() + run: | + mkdir -p ~/.ssh/ + install -m 600 /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SERVER_PRIVATEKEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST bash -c "'mkdir -p $DEST_FAILLOGS'" + rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_FAILLOGS $HOST:$DEST_FAILLOGS + + - name: Clean Process + if: always() + run: | + sync + ps -ef | grep OpenWrt-Buildbot | awk '{print $2}' | xargs sudo kill -9 || true + sleep 30 + sudo umount $OPENWRT_ROOT_PATH || true + sudo umount workspace/openwrt-ro || true + mkdir -p empty + sudo rsync --delete-before --force -r empty/ workspace/ + rm -rf empty workspace diff --git a/.github/workflows/rockchip-armv8.yml b/.github/workflows/rockchip-armv8.yml deleted file mode 100644 index a57adda0..00000000 --- a/.github/workflows/rockchip-armv8.yml +++ /dev/null @@ -1,505 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build rockchip/armv8 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 4 * * 2,4,6 - # watch: - # types: started - -env: - CONFIG_FILE: config/rockchip/armv8.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv8 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-r2s - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-r2s - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-r2s - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/sunxi-cortexa53.yml b/.github/workflows/sunxi-cortexa53.yml deleted file mode 100644 index fd404482..00000000 --- a/.github/workflows/sunxi-cortexa53.yml +++ /dev/null @@ -1,390 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build sunxi/cortexa53 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 10 * * 2,4,6 - # watch: - # types: started - -env: - CONFIG_FILE: config/sunxi/cortexa53.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: armv8 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-sunxi-a53 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-sunxi-a53 - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml new file mode 100644 index 00000000..2113c6df --- /dev/null +++ b/.github/workflows/targets.yml @@ -0,0 +1,487 @@ +#================================================= +# https://github.com/P3TERX/Actions-OpenWrt +# Description: Build OpenWrt using GitHub Actions +# Lisence: MIT +# Author: P3TERX +# Blog: https://p3terx.com +#================================================= + +name: Build Targets + +on: + repository_dispatch: + types: [targets] + workflow_dispatch: + inputs: + INPUT_TARGET: + description: "Target to build (platform/target/subtarget)" + required: false + default: "all" + schedule: + - cron: 0 2 * * * + +env: + SOURCE_URL: https://github.com/immortalwrt/immortalwrt + SOURCE_BRANCH: openwrt-18.06-k5.4 + CURRENT_BRANCH: main + WEB_ROOT_PATH: /data/www/openwrt.cc + TOOLCHAIN_TAG: toolchain + TZ: Asia/Shanghai + +jobs: + Config: + name: Generate Config + runs-on: ubuntu-20.04 + outputs: + TARGETS: ${{ steps.find-targets.outputs.TARGETS }} + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Clone Source Code + run: | + git clone --depth=1 $SOURCE_URL -b $SOURCE_BRANCH openwrt + + - name: Find Targets + id: find-targets + env: + INPUT_TARGET: ${{ github.event.inputs.INPUT_TARGET }} + run: | + if [ "$INPUT_TARGET" = "all" ] || [ "$INPUT_TARGET" = "" ]; then + export TARGETS="$(cat $GITHUB_WORKSPACE/data/support/targets.config)" + else + export TARGETS="$INPUT_TARGET" + fi + JSON='{"config": ["default"], "targets":[' + FIRST=1 + for TARGET in $TARGETS; do + [[ $FIRST -ne 1 ]] && JSON="$JSON"',' + JSON="$JSON"'"'"${TARGET}"'"' + FIRST=0 + done + JSON="$JSON"']}' + echo $JSON + echo "::set-output name=TARGETS::$JSON" + + Targets: + name: Targets ${{ matrix.TARGETS }} + needs: [Config] + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.Config.outputs.TARGETS)}} + + steps: + - name: Initialization Environment + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo -E rm -rf /etc/apt/sources.list.d/* + sudo -E apt-get -qq update + sudo -E apt-get -qq install squashfs-tools $(curl -fsSL git.io/depends-ubuntu-2004) + sudo -E apt-get -qq autoremove --purge + sudo -E apt-get -y purge azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu* powershell* msodbc* + sudo -E apt-get -qq clean + sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /etc/mysql /etc/php /usr/local/share/boost + sudo -E snap set system refresh.retain=2 + sudo -E docker image prune -a -f + sudo -E ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + + - name: Combine Disks + run: | + sudo swapoff -a + sudo rm -f /mnt/swapfile + export ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1) + export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576) + export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024) + sudo fallocate -l $ROOT_LOOP_BYTES /root.img + export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img) + sudo pvcreate -f $ROOT_LOOP_DEVNAME + export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1) + export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400) + export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024) + sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img + export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img) + sudo pvcreate -f $MNT_LOOP_DEVNAME + sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME + sudo lvcreate -n lvstorage -l 100%FREE vgstorage + export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}') + sudo mkfs.btrfs -L combinedisk $LV_DEVNAME + sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE + sudo chown -R runner:runner $GITHUB_WORKSPACE + mkdir -p $GITHUB_WORKSPACE/tmp + chmod 777 $GITHUB_WORKSPACE/tmp + sudo cp -rp /tmp/* $GITHUB_WORKSPACE/tmp + sudo mount -B $GITHUB_WORKSPACE/tmp /tmp + + - name: Print Disk Usage Information + run: | + sudo btrfs filesystem usage $GITHUB_WORKSPACE + + - name: Checkout + run: | + cd $GITHUB_WORKSPACE + git init + git remote add origin https://github.com/$GITHUB_REPOSITORY + git fetch + git checkout -t origin/$CURRENT_BRANCH + + - name: Generate Variables + id: env + run: | + export SOURCE_OWNER=$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}') + echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV + export SOURCE_REPO=$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}') + echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV + export DEVICE_PLATFORM=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $1}') + echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV + export DEVICE_TARGET=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $2}') + echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV + export DEVICE_SUBTARGET=$(echo ${{ matrix.TARGETS }} | awk -F '/' '{print $3}') + echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV + export TARGET_INFO="$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" + echo "TARGET_INFO=$TARGET_INFO" >> $GITHUB_ENV + mkdir -p workspace/openwrt + cd workspace/openwrt + echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV + + - name: Compare Toolchain Hash + id: hash + run: | + export TOOLS_HASH=$(curl -fsSL \ + https://api.github.com/repos/$SOURCE_OWNER/$SOURCE_REPO/commits\?sha\=$SOURCE_BRANCH\&path\=tools | jq '.[0] | .sha' | sed 's/"//g') + export TOOLCHAIN_HASH=$(curl -fsSL \ + https://api.github.com/repos/$SOURCE_OWNER/$SOURCE_REPO/commits\?sha\=$SOURCE_BRANCH\&path\=toolchain | jq '.[0] | .sha' | sed 's/"//g') + export CURRENT_HASH=$(echo -n "$TOOLS_HASH$TOOLCHAIN_HASH" | md5sum | awk '{print $1}') + echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV + echo "CURRENT_HASH is $CURRENT_HASH" + export CACHE_HASH=$(curl -fSsL https://github.com/$GITHUB_REPOSITORY/releases/download/$TOOLCHAIN_TAG/toolchain-${TARGET_INFO}.hash) + echo "CACHE_HASH is $CACHE_HASH" + if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then + echo "::set-output name=REBUILD_TOOLCHAIN::true" + fi + + - name: Clone Source Code + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + id: clone + run: | + git clone $SOURCE_URL -b $SOURCE_BRANCH $OPENWRT_ROOT_PATH + + - name: Generate Config File + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd $OPENWRT_ROOT_PATH + echo CONFIG_TARGET_${DEVICE_TARGET}=y > .config + echo CONFIG_TARGET_${DEVICE_TARGET}_${DEVICE_SUBTARGET}=y >> .config + cat $GITHUB_WORKSPACE/config/packages.config >> .config + if echo $DEVICE_TARGET | grep -q x86; then + cat $GITHUB_WORKSPACE/config/x86.config >> .config + fi + + - name: Install Feeds + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd $OPENWRT_ROOT_PATH + ./scripts/feeds update -a + ./scripts/feeds install -a + make defconfig + + - name: Compile Tools + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd $OPENWRT_ROOT_PATH + make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s + + - name: Compile Toolchain + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd $OPENWRT_ROOT_PATH + make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s + + - name: Upload Toolchain Logs + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + uses: actions/upload-artifact@main + with: + name: Logs-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} + path: ${{ env.OPENWRT_ROOT_PATH }}/logs + if-no-files-found: ignore + + - name: Clean Process + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd $OPENWRT_ROOT_PATH + ./scripts/feeds clean + make clean + rm -rf .config* bin dl logs tmp + + - name: Generate Toolchain Image + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + cd workspace + mksquashfs openwrt toolchain-${TARGET_INFO}.img -force-gid 1001 -force-uid 1001 -comp zstd + mkdir -p $GITHUB_WORKSPACE/output + split -d -b 1900M toolchain-${TARGET_INFO}.img $GITHUB_WORKSPACE/output/toolchain-${TARGET_INFO}.img. + rm toolchain-${TARGET_INFO}.img + cd $OPENWRT_ROOT_PATH + echo $CURRENT_HASH > $GITHUB_WORKSPACE/output/toolchain-${TARGET_INFO}.hash + ls -lh $GITHUB_WORKSPACE/output + + - name: Delete Old Toolchain Assets + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + uses: mknejp/delete-release-assets@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.TOOLCHAIN_TAG }} + assets: "toolchain-${{ env.TARGET_INFO }}.*" + fail-if-no-assets: false + fail-if-no-release: false + + - name: Upload Toolchain Image To Release + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + uses: ncipollo/release-action@v1.8.0 + with: + name: toolchain-image + allowUpdates: true + replacesArtifacts: true + tag: ${{ env.TOOLCHAIN_TAG }} + commit: ${{ env.CURRENT_BRANCH }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: output/* + + - name: Clean Toolchain Image + if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' + run: | + rm -rf output + + - name: Prepare Toolchain Image + if: steps.hash.outputs.REBUILD_TOOLCHAIN != 'true' + run: | + mkdir -p workspace + cd workspace + for i in {0..9} + do + curl -fsL https://github.com/$GITHUB_REPOSITORY/releases/download/$TOOLCHAIN_TAG/toolchain-${TARGET_INFO}.img.0$i >> toolchain-${TARGET_INFO}.img || break + done + mkdir -p openwrt-ro openwrt workdir overlay + sudo mount -o loop toolchain-${TARGET_INFO}.img openwrt-ro + sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt + sudo chown runner:runner $OPENWRT_ROOT_PATH + cd $OPENWRT_ROOT_PATH + git pull + + - name: Import Build Keys + env: + BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} + BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} + if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null + run: | + cd $OPENWRT_ROOT_PATH + echo -e "$BUILD_PRIVATEKEY" > key-build + echo -e "$BUILD_PUBLICKEY" > key-build.pub + wc -c key-build key-build.pub + git clone https://git.openwrt.org/project/usign.git + cd usign + cmake . + make + export PUBLICKEY_FINGERPRINT=$(./usign -F -p $OPENWRT_ROOT_PATH/key-build.pub) + cd $OPENWRT_ROOT_PATH + mkdir -p files/etc/opkg/keys + cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT + + - name: Install Feeds + run: | + cd $OPENWRT_ROOT_PATH + ./scripts/feeds update -a + ./scripts/feeds install -a + + - name: Generate Config File + run: | + cd $OPENWRT_ROOT_PATH + echo CONFIG_TARGET_${DEVICE_TARGET}=y > .config + echo CONFIG_TARGET_${DEVICE_TARGET}_${DEVICE_SUBTARGET}=y >> .config + cat $GITHUB_WORKSPACE/config/targets.config >> .config + if echo $DEVICE_TARGET | grep -q x86; then + cat $GITHUB_WORKSPACE/config/x86.config >> .config + fi + echo -e "\n---- Original Config Start ----\n" + cat .config + echo -e "\n---- Original Config End ----\n" + make defconfig + echo -e "\n---- Whole Config Start ----\n" + cat .config + echo -e "\n---- Whole Config End ----\n" + + - name: Download Source Packages + run: | + cd $OPENWRT_ROOT_PATH + make download -j64 + + - name: Generate Target Information + run: | + cd $OPENWRT_ROOT_PATH + make diffconfig buildversion feedsversion + cp .config bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/config.orig + + - name: Compile Kmods + run: | + cd $OPENWRT_ROOT_PATH + make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 || \ + yes n | make target/compile -j1 V=s IGNORE_ERRORS=1 + + - name: Compile Packages + run: | + cd $OPENWRT_ROOT_PATH + make package/compile -j$(nproc) IGNORE_ERRORS="y m n" BUILD_LOG=1 || make package/compile -j1 V=s + make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s + + - name: Generate Firmware Tools + run: | + cd $OPENWRT_ROOT_PATH + make target/install -j$(nproc) \ + CONFIG_TARGET_ROOTFS_EXT4FS=n \ + CONFIG_TARGET_ROOTFS_INITRAMFS=n \ + CONFIG_TARGET_ROOTFS_SQUASHFS=n \ + CONFIG_TARGET_ROOTFS_UBIFS=n \ + BUILD_LOG=1 || \ + make target/install -j1 V=s \ + CONFIG_TARGET_ROOTFS_EXT4FS=n \ + CONFIG_TARGET_ROOTFS_INITRAMFS=n \ + CONFIG_TARGET_ROOTFS_SQUASHFS=n \ + CONFIG_TARGET_ROOTFS_UBIFS=n + + - name: Add Kmods Feed + run: | + cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET + if [ "$(ls)" != "$DEVICE_SUBTARGET" ]; then + mv $(ls) $DEVICE_SUBTARGET + fi + cd $OPENWRT_ROOT_PATH + export TOPDIR=$(pwd) + export KERNEL_VERSION="$(make --no-print-directory -C target/linux \ + val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | \ + tr '\n' '-' | head -c -1)" + echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV + mkdir -p bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/kmods/$KERNEL_VERSION + rsync --remove-source-files --include=/kmod-*.ipk --exclude=* -av \ + $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/packages/ \ + $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/kmods/$KERNEL_VERSION/ + cp -f bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/packages/kernel* \ + bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/kmods/$KERNEL_VERSION + + - name: Set Opkg Configuration + run: | + sed -i "s/DEVICE_TARGET/$DEVICE_TARGET/g; \ + s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g; \ + s/KERNEL_VERSION/$KERNEL_VERSION/g; \ + s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" $GITHUB_WORKSPACE/data/opkg/distfeeds.conf + echo -e "\n---- Distfeeds.conf Start----\n" + cat $GITHUB_WORKSPACE/data/opkg/distfeeds.conf + echo -e "\n---- Distfeeds.conf End----\n" + + - name: Generate Packages Index + run: | + cd $OPENWRT_ROOT_PATH + make package/index V=s PACKAGE_SUBDIRS=bin/packages/$DEVICE_PLATFORM/ + make package/index V=s PACKAGE_SUBDIRS=bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/kmods/$KERNEL_VERSION/ + make package/index V=s PACKAGE_SUBDIRS=bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/packages/ + + - name: Generate Firmware + run: | + tar -xf $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/*imagebuilder*.tar.xz -C . + cd $(ls | grep imagebuilder) + sed -i '/luci-app-cpufreq/d' include/target.mk + mkdir -p files/etc/opkg + cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg + export PROFILE_NAMES=$(make val.PROFILE_NAMES | sed 's/DEVICE_//g') + export I18N_PACKAGES=$(cat $GITHUB_WORKSPACE/config/i18n.config) + for PROFILE in `echo $PROFILE_NAMES`; + do + make image PROFILE=$PROFILE FILES="files" PACKAGES="$I18N_PACKAGES" || \ + true; + done + mv -f bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/* $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET/ + + - name: Collect FailLogs + if: always() + continue-on-error: true + run: | + cd $OPENWRT_ROOT_PATH + echo 'Build Failed Packages:' + cat logs/package/error.txt | awk '{print $2}' + cat logs/package/error.txt | awk '{print $2}' | sed 's/$/&\//g' > failed-packages.txt + mkdir -p faillogs + rsync -aq --files-from=failed-packages.txt logs/ faillogs/ + cp -f logs/package/error.txt faillogs + + - name: Upload FailLogs To Artifact + if: failure() + continue-on-error: true + uses: actions/upload-artifact@main + with: + name: Logs-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} + path: ${{ env.OPENWRT_ROOT_PATH }}/faillogs/ + if-no-files-found: ignore + + - name: Deploy Files To Backblaze + continue-on-error: true + env: + B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}" + B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}" + SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + DEST_TARGETS: "b2://${{ secrets.B2_BUCKETNAME }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + if: env.B2_APPLICATION_KEY != null && env.B2_APPLICATION_KEY_ID != null + run: | + sudo wget -q -O /bin/b2 https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux + sudo chmod +x /bin/b2 + b2 authorize-account $B2_APPLICATION_KEY_ID $B2_APPLICATION_KEY + b2 sync --noProgress --threads 32 --keepDays 7 --replaceNewer $SOURCE_TARGETS $DEST_TARGETS + + - name: Deploy FailLogs To Backblaze + continue-on-error: true + env: + B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}" + B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}" + SOURCE_FAILLOGS: "${{ env.OPENWRT_ROOT_PATH }}/faillogs/" + DEST_FAILLOGS: "b2://${{ secrets.B2_BUCKETNAME }}/snapshots/faillogs/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + if: env.B2_APPLICATION_KEY != null && env.B2_APPLICATION_KEY_ID != null + run: | + b2 authorize-account $B2_APPLICATION_KEY_ID $B2_APPLICATION_KEY + b2 sync --noProgress --threads 32 --keepDays 7 --replaceNewer $SOURCE_FAILLOGS $DEST_FAILLOGS + + - name: Deploy Files To Server + continue-on-error: true + env: + HOST: "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" + SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + SERVER_PRIVATEKEY: "${{ secrets.SERVER_PRIVATEKEY }}" + if: env.SERVER_PRIVATEKEY != null + run: | + mkdir -p ~/.ssh/ + install -m 600 /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SERVER_PRIVATEKEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST bash -c "'mkdir -p $DEST_TARGETS $DEST_FAILLOGS'" + rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS + + - name: Deploy FailLogs To Server + continue-on-error: true + env: + HOST: "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" + SOURCE_FAILLOGS: "${{ env.OPENWRT_ROOT_PATH }}/faillogs/" + DEST_FAILLOGS: "${{ env.WEB_ROOT_PATH }}/snapshots/faillogs/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" + SERVER_PRIVATEKEY: "${{ secrets.SERVER_PRIVATEKEY }}" + if: env.SERVER_PRIVATEKEY != null && always() + run: | + mkdir -p ~/.ssh/ + install -m 600 /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SERVER_PRIVATEKEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST bash -c "'mkdir -p $DEST_FAILLOGS'" + rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_FAILLOGS $HOST:$DEST_FAILLOGS + + - name: Print Disk Usage Information + if: always() + run: | + sudo btrfs filesystem usage $GITHUB_WORKSPACE diff --git a/.github/workflows/update-dl.yml b/.github/workflows/update-dl.yml new file mode 100644 index 00000000..1b21ef74 --- /dev/null +++ b/.github/workflows/update-dl.yml @@ -0,0 +1,151 @@ +#================================================= +# https://github.com/P3TERX/Actions-OpenWrt +# Description: Build OpenWrt using GitHub Actions +# Lisence: MIT +# Author: P3TERX +# Blog: https://p3terx.com +#================================================= + +name: Update DL Mirror + +on: + workflow_dispatch: + schedule: + - cron: 0 18 * * * + +env: + WEBROOT: /data/www/openwrt.cc + +jobs: + Download: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + REPO: [openwrt/openwrt, coolsnowwolf/lede, immortalwrt/immortalwrt, lienol/openwrt] + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Initialization Environment + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo -E rm -rf /etc/apt/sources.list.d/* + sudo -E apt-get -qq update + sudo -E apt-get -qq install rdfind $(curl -fsSL git.io/depends-ubuntu-2004) + sudo -E apt-get -qq autoremove --purge + sudo -E apt-get -y purge azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu* powershell* msodbc* + sudo -E apt-get -qq clean + sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /etc/mysql /etc/php /usr/local/share/boost + sudo -E snap set system refresh.retain=2 + sudo -E docker image prune -a -f + sudo -E ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + + - name: Combine Disks + run: | + sudo swapoff -a + sudo rm -f /mnt/swapfile + export ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1) + export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576) + export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024) + sudo fallocate -l $ROOT_LOOP_BYTES /root.img + export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img) + sudo pvcreate -f $ROOT_LOOP_DEVNAME + export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1) + export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400) + export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024) + sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img + export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img) + sudo pvcreate -f $MNT_LOOP_DEVNAME + sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME + sudo lvcreate -n lvstorage -l 100%FREE vgstorage + export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}') + sudo mkfs.btrfs -L combinedisk $LV_DEVNAME + sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE + sudo chown -R runner:runner $GITHUB_WORKSPACE + mkdir -p $GITHUB_WORKSPACE/tmp + chmod 777 $GITHUB_WORKSPACE/tmp + sudo cp -rp /tmp/* $GITHUB_WORKSPACE/tmp + sudo mount -B $GITHUB_WORKSPACE/tmp /tmp + + - name: Print Disk Usage Information + run: | + sudo btrfs filesystem usage $GITHUB_WORKSPACE + + - name: Download All Packages + env: + REPO: ${{ matrix.REPO }} + run: | + export REPO_USER="$(echo $REPO | awk -F '/' '{print $1}')" + echo "REPO_USER=$REPO_USER" >> $GITHUB_ENV + export REPO_NAME="$(echo $REPO | awk -F '/' '{print $2}')" + echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV + + export OPENWRT_BRANCH="master openwrt-18.06 openwrt-19.07 openwrt-21.02 lede-17.01" + export IMMORTALWRT_BRANCH="master openwrt-18.06 openwrt-18.06-dev openwrt-18.06-k5.4 openwrt-21.02" + export COOLSNOWWOLF_BRANCH="master" + export LIENOL_BRANCH="main 19.07" + + if [ $REPO_USER == openwrt ] + then + export BRANCH=$OPENWRT_BRANCH + elif [ $REPO_USER == immortalwrt ] + then + export BRANCH=$IMMORTALWRT_BRANCH + elif [ $REPO_USER == coolsnowwolf ] + then + export BRANCH=$COOLSNOWWOLF_BRANCH + else + export BRANCH=$LIENOL_BRANCH + fi + + for REPO_BRANCH in $BRANCH + do + git clone --depth=1 https://github.com/$REPO_USER/$REPO_NAME -b $REPO_BRANCH $REPO_BRANCH + pushd $REPO_BRANCH + ./scripts/feeds update -a && ./scripts/feeds install -a + echo "CONFIG_ALL=y" >> .config + make defconfig + make download -j32 IGNORE_ERRORS=1 + find dl -size -1024c -exec ls -l {} \; + find dl -size -1024c -exec rm -f {} \; + mkdir -p ../output/$REPO_USER/$REPO_NAME + mv dl ../output/$REPO_USER/$REPO_NAME/$REPO_USER-$REPO_NAME-$REPO_BRANCH + popd + done + + pushd output/$REPO_USER/$REPO_NAME + ls | xargs -i rsync -aqux --remove-source-files {}/ . + rm -rf $REPO_USER-* + popd + sudo rdfind -makehardlinks true output + + - name: Deploy Files To Server + env: + HOST: "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" + SOURCE_DL: "output/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" + DEST_DL: "${{ env.WEBROOT }}/dl/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" + SERVER_PRIVATEKEY: "${{ secrets.SERVER_PRIVATEKEY }}" + run: | + mkdir -p ~/.ssh/ + install -m 600 /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SERVER_PRIVATEKEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ + bash -c "'mkdir -p $DEST_DL'" + rsync -chavHP --delete -e "ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no" $SOURCE_DL $HOST:$DEST_DL + + - name: Deploy Files To Backblaze + env: + B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}" + B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}" + SOURCE_DL: "output/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" + DEST_DL: "b2://${{ secrets.B2_BUCKETNAME }}/dl/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" + if: env.B2_APPLICATION_KEY != null && env.B2_APPLICATION_KEY_ID != null + run: | + sudo wget -q -O /bin/b2 https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux + sudo chmod +x /bin/b2 + b2 authorize-account $B2_APPLICATION_KEY_ID $B2_APPLICATION_KEY + b2 sync --noProgress --threads 32 --compareVersions size --delete --replaceNewer $SOURCE_DL $DEST_DL diff --git a/.github/workflows/update-dlmirror.yml b/.github/workflows/update-dlmirror.yml deleted file mode 100644 index 0f9a24a9..00000000 --- a/.github/workflows/update-dlmirror.yml +++ /dev/null @@ -1,112 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Update OpenWrt.cc DL Mirror - -on: - workflow_dispatch: - schedule: - - cron: 0 18 * * * -# watch: -# types: started - -env: - WEBROOT: /data/dnmp/www/openwrt.cc - DEPLOY: true - -jobs: - Download: - if: always() - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - REPO: [openwrt/openwrt, coolsnowwolf/lede, immortalwrt/immortalwrt, lienol/openwrt] - - steps: - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Download Environment - id: download-init - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) rdfind - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - - - name: Download All Packages - id: download - env: - REPO: ${{ matrix.REPO }} - run: | - df -hT $PWD - export REPO_USER="$(echo $REPO | awk -F '/' '{print $1}')" - echo "REPO_USER=$REPO_USER" >> $GITHUB_ENV - export REPO_NAME="$(echo $REPO | awk -F '/' '{print $2}')" - echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV - - export OPENWRT_BRANCH="master openwrt-18.06 openwrt-19.07 openwrt-21.02 lede-17.01" - export IMMORTALWRT_BRANCH="master openwrt-18.06 openwrt-18.06-dev openwrt-18.06-k5.4 openwrt-21.02" - export COOLSNOWWOLF_BRANCH="master" - export LIENOL_BRANCH="main 19.07" - - if [ $REPO_USER == openwrt ] - then - export BRANCH=$OPENWRT_BRANCH - elif [ $REPO_USER == immortalwrt ] - then - export BRANCH=$IMMORTALWRT_BRANCH - elif [ $REPO_USER == coolsnowwolf ] - then - export BRANCH=$COOLSNOWWOLF_BRANCH - else - export BRANCH=$LIENOL_BRANCH - fi - - for REPO_BRANCH in $BRANCH - do - git clone --depth=1 https://github.com/$REPO_USER/$REPO_NAME -b $REPO_BRANCH $REPO_BRANCH - pushd $REPO_BRANCH - ./scripts/feeds update -a && ./scripts/feeds install -a - echo "CONFIG_ALL=y" >> .config - make defconfig - make download -j32 IGNORE_ERRORS=1 - find dl -size -1024c -exec ls -l {} \; - find dl -size -1024c -exec rm -f {} \; - mkdir -p ../output/$REPO_USER/$REPO_NAME - mv dl ../output/$REPO_USER/$REPO_NAME/$REPO_USER-$REPO_NAME-$REPO_BRANCH - popd - done - - pushd output/$REPO_USER/$REPO_NAME - ls | xargs -i rsync -axvu {}/ . - rm -rf $REPO_USER-* - popd - sudo rdfind -makehardlinks true output - - - name: Deploy Files To Server - id: deploy - if: env.DEPLOY == 'true' - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_DL: "output/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" - DEST_DL: "${{ env.WEBROOT }}/dl/${{ env.REPO_USER }}/${{ env.REPO_NAME }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $DEST_DL'" - rsync -chavHP --delete -e "ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no" $SOURCE_DL $HOST:$DEST_DL diff --git a/.github/workflows/x86-64.yml b/.github/workflows/x86-64.yml deleted file mode 100644 index 547012ab..00000000 --- a/.github/workflows/x86-64.yml +++ /dev/null @@ -1,505 +0,0 @@ -#================================================= -# https://github.com/P3TERX/Actions-OpenWrt -# Description: Build OpenWrt using GitHub Actions -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= - -name: Build x86/64 openwrt - -on: - workflow_dispatch: - schedule: - - cron: 0 0 * * 0,1,3,5 - # watch: - # types: started - -env: - CONFIG_FILE: config/x86/64.config - SOURCE_URL: https://github.com/immortalwrt/immortalwrt - SOURCE_BRANCH: openwrt-18.06-k5.4 - DIY_SH: scripts/custom.sh - WEB_ROOT_PATH: /data/dnmp/www/openwrt.cc - TOOLCHAIN_TAG: toolchain - FIRMWARE_RELEASE_UPLOAD: true - CLASH_BINARY_PLATFORM: amd64 - TZ: Asia/Shanghai - -jobs: - Toolchain: - runs-on: project-x86_64 - - outputs: - OPENWRT_ROOT_PATH: ${{ steps.clone.outputs.OPENWRT_ROOT_PATH }} - CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }} - SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }} - SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }} - DEVICE_PLATFORM: ${{ steps.env.outputs.DEVICE_PLATFORM }} - DEVICE_TARGET: ${{ steps.env.outputs.DEVICE_TARGET }} - DEVICE_SUBTARGET: ${{ steps.env.outputs.DEVICE_SUBTARGET }} - TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }} - - steps: - - name: Clean Environment - run: | - sudo umount /dev/loop*p1 || true - sudo losetup -D || true - sudo umount overlay || true - - - name: Checkout - uses: actions/checkout@main - - - name: Initialization Environment - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo -E apt-get -qq update - sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) - sudo -E apt-get -qq autoremove --purge - sudo -E apt-get -qq clean - mkdir -p workspace - - - name: Clone Source Code - id: clone - run: | - df -hT $PWD - git clone $SOURCE_URL -b $SOURCE_BRANCH workspace/openwrt - cd workspace/openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - echo "::set-output name=OPENWRT_ROOT_PATH::$(echo $PWD)" - - - name: Generate Toolchain Config - run: | - [ -e $CONFIG_FILE ] && cp $CONFIG_FILE $OPENWRT_ROOT_PATH/.config - echo -e "\nCONFIG_ALL=y\nCONFIG_ALL_NONSHARED=y\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y" >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - make defconfig > /dev/null 2>&1 - - - name: Generate Variables - id: env - run: | - export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" - echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)" - cd $OPENWRT_ROOT_PATH - export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')" - echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV - echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)" - export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')" - echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV - echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)" - export DEVICE_TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}') - echo "DEVICE_TARGET=$DEVICE_TARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_TARGET::$(echo $DEVICE_TARGET)" - export DEVICE_SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}') - echo "DEVICE_SUBTARGET=$DEVICE_SUBTARGET" >> $GITHUB_ENV - echo "::set-output name=DEVICE_SUBTARGET::$(echo $DEVICE_SUBTARGET)" - export DEVICE_PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}') - echo "DEVICE_PLATFORM=$DEVICE_PLATFORM" >> $GITHUB_ENV - echo "::set-output name=DEVICE_PLATFORM::$(echo $DEVICE_PLATFORM)" - export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV - echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)" - - - name: Compare Toolchain Hash - id: hash - run: | - cd $OPENWRT_ROOT_PATH - export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain) - echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV - echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)" - echo "CURRENT_HASH is $CURRENT_HASH" - export CACHE_HASH=$(cat /data/toolchain/$TOOLCHAIN_IMAGE.hash) - echo "CACHE_HASH is $CACHE_HASH" - if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then - echo "::set-output name=REBUILD_TOOLCHAIN::true" - fi - - - name: Install Feeds - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds update -a - ./scripts/feeds install -a - make defconfig > /dev/null 2>&1 - - - name: Compile Tools - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make tools/compile -j$(nproc) BUILD_LOG=1 || make tools/compile -j1 V=s - - - name: Compile Toolchain - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make toolchain/compile -j$(nproc) BUILD_LOG=1 || make toolchain/compile -j1 V=s - ./scripts/feeds clean - rm -rf .config* bin dl - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Generate Toolchain Image - if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true' - run: | - mkdir -p /data/toolchain - cd workspace - mksquashfs openwrt /data/toolchain/$TOOLCHAIN_IMAGE.img -force-gid 1000 -force-uid 1000 -comp lz4 - echo $CURRENT_HASH > /data/toolchain/$TOOLCHAIN_IMAGE.hash - - - name: Clean Process - if: always() - run: | - sync - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Firmware: - needs: [Toolchain] - runs-on: project-x86_64 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@main - - - name: Prepare Toolchain Image - run: | - mkdir -p workspace - cd workspace - mkdir -p openwrt openwrt-ro workdir overlay - sudo mount -o loop /data/toolchain/$TOOLCHAIN_IMAGE.img openwrt-ro - sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt - sudo chown suling:suling $OPENWRT_ROOT_PATH - cd $OPENWRT_ROOT_PATH - git pull - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Install Feeds - run: | - cd $OPENWRT_ROOT_PATH - ./scripts/feeds clean - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Load Custom Configuration - run: | - [ -e files ] && mv files $OPENWRT_ROOT_PATH/files - [ -e $CONFIG_FILE ] && cp $GITHUB_WORKSPACE/$CONFIG_FILE $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/firmware-extra.config >> $OPENWRT_ROOT_PATH/.config - cd $OPENWRT_ROOT_PATH - chmod +x $GITHUB_WORKSPACE/scripts/*.sh - $GITHUB_WORKSPACE/$DIY_SH - $GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_BINARY_PLATFORM - $GITHUB_WORKSPACE/scripts/preset-terminal-tools.sh - make defconfig - - - name: Download DL Package - run: | - cd $OPENWRT_ROOT_PATH - rm -rf dl - cp -rf /data/cache/dl . - make download -j64 - - - name: Compile Packages - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$(nproc) thread compile" - make diffconfig buildversion feedsversion - make target/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make target/compile -j1 V=s IGNORE_ERRORS=1 - make package/compile -j$(nproc) 'IGNORE_ERRORS=n m' BUILD_LOG=1 || make package/compile -j1 V=s - make package/index - - - name: Generate Firmware - run: | - cd data/opkg - sed -i "s/DEVICE_SUBTARGET/$DEVICE_SUBTARGET/g" distfeeds.conf - sed -i "s/DEVICE_TARGET\//$DEVICE_TARGET\//g" distfeeds.conf - sed -i "s/DEVICE_PLATFORM/$DEVICE_PLATFORM/g" distfeeds.conf - cd $OPENWRT_ROOT_PATH - echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt - mkdir -p files/etc/uci-defaults/ - cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings - mkdir -p files/www/snapshots - cp -r bin/targets files/www/snapshots - mkdir -p files/etc/opkg - cp $GITHUB_WORKSPACE/data/opkg/distfeeds.conf files/etc/opkg - make package/install -j$(nproc) BUILD_LOG=1 || make package/install -j1 V=s - make target/install -j$(nproc) BUILD_LOG=1 || make target/install -j1 V=s - make json_overview_image_info - make checksum - cp key-build.pub bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - mkdir -p $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - mv bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET $GITHUB_WORKSPACE/output/bin/targets/$DEVICE_TARGET - - - name: Upload Job Logs - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }} - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs - run: | - mkdir -p output/logs - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }} - - - name: Clean Process - if: failure() || cancelled() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Extra-Packages: - needs: [Toolchain, Firmware] - runs-on: project-x86_64 - - steps: - - name: Restore Variables - run: | - echo "OPENWRT_ROOT_PATH=$(echo '${{needs.Toolchain.outputs.OPENWRT_ROOT_PATH}}')" >> $GITHUB_ENV - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Clean Build Cache - run: | - cd $OPENWRT_ROOT_PATH - make clean - - - name: Import Build Keys - env: - BUILD_PRIVATEKEY: ${{ secrets.BUILD_PRIVATEKEY }} - BUILD_PUBLICKEY: ${{ secrets.BUILD_PUBLICKEY }} - if: env.BUILD_PRIVATEKEY != null && env.BUILD_PUBLICKEY != null - run: | - cd $OPENWRT_ROOT_PATH - echo -e "$BUILD_PRIVATEKEY" > key-build - echo -e "$BUILD_PUBLICKEY" > key-build.pub - wc -c key-build key-build.pub - export PUBLICKEY_FINGERPRINT=$(usign -F -p key-build.pub) - mkdir -p files/etc/opkg/keys - cp key-build.pub files/etc/opkg/keys/$PUBLICKEY_FINGERPRINT - - - name: Enable Ccache - run: | - cd $OPENWRT_ROOT_PATH - export CCACHE_FILE_PATH="/data/ccache/ccache-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$DEVICE_TARGET-$DEVICE_SUBTARGET" - echo "CCACHE_FILE_PATH=$CCACHE_FILE_PATH" >> $GITHUB_ENV - mkdir -p $CCACHE_FILE_PATH - grep -sq max_size "$CCACHE_FILE_PATH/ccache.conf" || \ - echo "max_size = 20.0G" >> "$CCACHE_FILE_PATH/ccache.conf" || true - grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ - echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$CCACHE_FILE_PATH/ccache.conf" || true - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - echo -e "\nCONFIG_DEVEL=y\nCONFIG_CCACHE=y\nCONFIG_CCACHE_DIR=\"$CCACHE_FILE_PATH\"" >> $OPENWRT_ROOT_PATH/.config - cat $GITHUB_WORKSPACE/config/packages-extra.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - CCACHE_DIR=$CCACHE_FILE_PATH staging_dir/host/bin/ccache -sv - - - name: Compile Extra Packages With Ccache - run: | - cd $OPENWRT_ROOT_PATH - make target/compile -j$(nproc) IGNORE_ERRORS="m n" BUILD_LOG=1 - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - - - name: Upload Job Logs With Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-Ccache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs With Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - cat $OPENWRT_ROOT_PATH/logs/package/error.txt | awk '{print $2}' | awk -F '/' '{print $(NF)}' | \ - sed 's/^/CONFIG_PACKAGE_&/g' | sed 's/$/&=m/g' > $OPENWRT_ROOT_PATH/failed-packages.config - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/ccache - CCACHE_DIR=$CCACHE_FILE_PATH $OPENWRT_ROOT_PATH/staging_dir/host/bin/ccache -sv - - - name: Compile Failed Packages Without Ccache - run: | - cd $OPENWRT_ROOT_PATH - rm -f .config - cp $GITHUB_WORKSPACE/$CONFIG_FILE .config - cat $OPENWRT_ROOT_PATH/failed-packages.config >> $OPENWRT_ROOT_PATH/.config - make defconfig - make package/cleanup - make package/compile -j$(nproc) BUILD_LOG=1 IGNORE_ERRORS="y m n" - make package/index - mkdir -p $GITHUB_WORKSPACE/output/bin/packages - mv bin/packages/$DEVICE_PLATFORM $GITHUB_WORKSPACE/output/bin/packages - - - name: Upload Job Logs Without Ccache - if: always() - uses: actions/upload-artifact@main - with: - name: Logs-${{ github.job }}-NoCcache - path: ${{ env.OPENWRT_ROOT_PATH }}/logs - if-no-files-found: ignore - - - name: Collect Workflows Logs Without Ccache - run: | - cat $OPENWRT_ROOT_PATH/logs/package/error.txt - mkdir -p output/logs/${{ github.job }} - mv $OPENWRT_ROOT_PATH/logs output/logs/${{ github.job }}/noccache - mv output/logs output/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - - - name: Compress Bin Folder - run: | - cd output - zip -s 1900m -qrm bin-archive.zip bin - - - name: Upload Bin Archive - uses: actions/upload-artifact@main - with: - name: Bin-Archive - path: output - - - name: Clean Process - if: always() - run: | - sync - sudo umount $OPENWRT_ROOT_PATH || true - sudo umount workspace/openwrt-ro || true - mkdir empty - sudo rsync --delete-before --force -r empty/ workspace/ - sudo rm -rf empty workspace - - Upload: - needs: [Toolchain, Firmware, Extra-Packages] - runs-on: ubuntu-20.04 - - steps: - - name: Restore Variables - run: | - sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV - echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV - echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV - echo "DEVICE_PLATFORM=$(echo '${{needs.Toolchain.outputs.DEVICE_PLATFORM}}')" >> $GITHUB_ENV - echo "DEVICE_TARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_TARGET}}')" >> $GITHUB_ENV - echo "DEVICE_SUBTARGET=$(echo '${{needs.Toolchain.outputs.DEVICE_SUBTARGET}}')" >> $GITHUB_ENV - echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV - - - name: Download Bin Archive - uses: actions/download-artifact@v2 - with: - name: Bin-Archive - path: openwrt - - - name: Decompress Bin Archive - run: | - cd openwrt - echo "OPENWRT_ROOT_PATH=$PWD" >> $GITHUB_ENV - zip -qs 0 bin-archive.zip --out $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - unzip $DEVICE_TARGET-$DEVICE_SUBTARGET.zip - - - name: Deploy Files To HostHatch Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.HOSTHATCH_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.HOSTHATCH_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Deploy Files To PacificRack Node - env: - HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}" - SOURCE_TARGETS: "${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - SOURCE_PACKAGES: "${{ env.OPENWRT_ROOT_PATH }}/bin/packages/${{ env.DEVICE_PLATFORM }}/" - DEST_TARGETS: "${{ env.WEB_ROOT_PATH }}/snapshots/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/" - DEST_PACKAGES: "${{ env.WEB_ROOT_PATH }}/snapshots/packages/${{ env.DEVICE_PLATFORM }}/" - REMOTE_PRIVATEKEY: "${{ secrets.PACIFICRACK_PRIVATEKEY }}" - if: env.REMOTE_PRIVATEKEY != null - run: | - mkdir -p ~/.ssh/ - install -m 600 /dev/null ~/.ssh/id_rsa - echo "${{ secrets.PACIFICRACK_PRIVATEKEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \ - bash -c "'mkdir -p $WEB_ROOT_PATH/snapshots/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET \ - $WEB_ROOT_PATH/snapshots/packages/$DEVICE_PLATFORM'" - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS - rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_PACKAGES $HOST:$DEST_PACKAGES - - - name: Organize Files - run: | - cd $OPENWRT_ROOT_PATH/bin/targets/$DEVICE_TARGET/$DEVICE_SUBTARGET - rm -rf packages logs - - - name: Deploy Files To Release - uses: ncipollo/release-action@v1.8.0 - if: env.FIRMWARE_RELEASE_UPLOAD == 'true' - with: - name: openwrt-${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - allowUpdates: true - replacesArtifacts: true - tag: ${{ env.DEVICE_TARGET }}-${{ env.DEVICE_SUBTARGET }} - commit: ${{ env.CURRENT_BRANCH }} - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.OPENWRT_ROOT_PATH }}/bin/targets/${{ env.DEVICE_TARGET }}/${{ env.DEVICE_SUBTARGET }}/* diff --git a/README.md b/README.md index 9723b61a..9905d5ac 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,38 @@ -# OpenWrt-Mini +# [OpenWrt-Buildbot](https://github.com/SuLingGG/OpenWrt-Buildbot) -## 项目特色 +## 项目介绍 +1. 提供绝大多数源码支持的 arm/aarch64/x86 平台设备的 OpenWrt 固件 +2. 除设备默认定义软件包外,固件内未额外集成其他软件包,确保获得纯净体验 +3. 固件每日跟随源码更新自动编译,确保获得最新体验 +4. 软件源每 2 日更新一次,源内可安装软件包达 7000+ 个 +5. 提供各大 OpenWrt 项目 / 分支的源码包 (dl) 镜像 +6. 提供全格式固件 / 文件 (ext4/squashfs/ubi/initramfs/rootfs) +7. 对于高级用户,提供完整的固件/软件包构建工具 (imagebuilder / sdk / toolchain) -- 项目基于 [immortalwrt/immortalwrt](https://github.com/immortalwrt/immortalwrt) openwrt-18.06-k5.4 分支,内核版本为 5.4.x,LuCI 版本为 LuCI 18.06。 -- 项目使用 Self-Hosted Runner 作为 OpenWrt 编译设备,不受 Github Action 提供的 Runner 的硬件和软件限制。 -- 提供 40M 左右的 “纯净固件” 并预配置自建软件源,可使用 `opkg` 命令或前往 “系统 - 软件包” 中安装自己需要的软件包。 -- 固件额外集成常用驱动与常见 USB 无线网卡驱动,固件预置最新版 Clash 核心、预置 oh-my-zsh 以最大程度减少配置成本。 -- 比较全面的 IPV6 支持,固件内置 IPV6 CLI 配置工具 `ipv6-helper`,可快速安装 / 卸载 / 配置 IPV6。 -- 自建软件源提供 7000 余个软件包以及 189 个 LuCI APP (截止 2021-02-22),并保证固件与自建软件源完全兼容。 -- 隔天更新固件与自建源中所有软件包,确保获得最新体验。 -- 本项目适合具有 OpenWrt 丰富使用经验的 **进阶用户** 使用,因为自建软件源及开放软件包安装将导致诸多不确定因素,故在固件使用过程中遇到的问题请首先擅用搜索引擎来解决。对于固件使用中出现的问题本项目仅提供 **极其有限** 的支持。 -- 如果你没有多少使用 OpenWrt 的经验,请移步姊妹项目: [OpenWrt-Rpi](https://github.com/SuLingGG/OpenWrt-Rpi) 。 -- OpenWrt-Rpi 的大多数使用文档也适用于本项目,文档详情请移步 [OpenWrt-Rpi](https://github.com/SuLingGG/OpenWrt-Rpi) 项目的 [README.md](https://github.com/SuLingGG/OpenWrt-Rpi/blob/main/README.md) 页面。 -- 如果你想捐助此项目,请移步: [FUNDING.md](https://github.com/SuLingGG/OpenWrt-Mini/blob/main/FUNDING.md)。 +## 文档 -## 设备/平台支持情况 +固件 下载安装 / 初始设置 / 软件包安装说明 等信息请看文档: -| 支持设备 / 平台 | 下载链接 | Platform | Target | Subtarget | -| :------------------: | :-------------------------------------------------------: | :----------------------: | :------: | :-------: | -| 竞斗云 / Acrh17 | [🔗](http://openwrt.cc/snapshots/targets/ipq40xx/generic/) | arm_cortex-a7_neon-vfpv4 | ipq40xx | generic | -| 树莓派 2B | [🔗](http://openwrt.cc/snapshots/targets/bcm27xx/bcm2709/) | arm_cortex-a7_neon-vfpv4 | bcm27xx | bcm2709 | -| 树莓派 3B/3B+ | [🔗](http://openwrt.cc/snapshots/targets/bcm27xx/bcm2710/) | aarch64_cortex-a53 | bcm27xx | bcm2710 | -| 树莓派 4B | [🔗](http://openwrt.cc/snapshots/targets/bcm27xx/bcm2711/) | aarch64_cortex-a72 | bcm27xx | bcm2711 | -| Rockchip 33xx | [🔗](http://openwrt.cc/snapshots/targets/rockchip/armv8/) | aarch64_generic | rockchip | armv8 | -| Allwinner Cortex-A7 | [🔗](http://openwrt.cc/snapshots/targets/sunxi/cortexa7/) | arm_cortex-a7_neon-vfpv4 | sunxi | cortexa7 | -| Allwinner Cortex-A53 | [🔗](http://openwrt.cc/snapshots/targets/sunxi/cortexa53/) | aarch64_cortex-a53 | sunxi | cortexa53 | -| x86_64 (64位) | [🔗](http://openwrt.cc/snapshots/targets/x86/64/) | x86_64 | x86 | 64 | + -完整的设备支持列表参见: +## 固件预览 - +### 主界面: -## 软件包安装指南 +![主界面](https://ae02.alicdn.com/kf/Hdc79e29a959146c29a53a03742cce90cX.png) -更新软件包索引: +### 内置功能: -``` -opkg update -``` - -列出可安装的所有 LuCI APP : - -``` -opkg list | grep luci-app | grep -v Translation -``` - -安装软件包 (以 luci-app-ssr-plus 为例): - -``` -opkg install luci-app-ssr-plus -``` - -若发现此时新安装软件包界面为英文,则尝试查找该软件包的中文翻译包: - -``` -opkg list | grep luci-app-ssr-plus | grep zh-cn -``` - -此时可以得到该软件包的中文翻译包为 `luci-i18n-ssr-plus-zh-cn`,使用 `opkg install` 命令安装此翻译包即可: - -``` -opkg install luci-i18n-ssr-plus-zh-cn -``` - -可安装的 LuCI APP 列表: - - - -更多 opkg 使用方法请参考 OpenWrt Guide: - - +![内置功能](https://ae05.alicdn.com/kf/Hc47719b39ac04438beb10143c8e99b8cx.png) ## 鸣谢 -特别感谢以下项目: - -Openwrt 官方项目: - -https://github.com/openwrt/openwrt - -Lean 大的 Openwrt 项目: - -https://github.com/coolsnowwolf/lede - -Project ImmortalWrt 的 ImmortalWrt 项目: - -https://github.com/immortalwrt/immortalwrt - -P3TERX 大佬的 Actions-OpenWrt 项目: - -https://github.com/P3TERX/Actions-OpenWrt +感谢以下项目 / 厂商: -除这些项目之外,也特别感谢所有为 OpenWrt 项目及社区作出贡献的朋友们~ \ No newline at end of file +| Github Actions | OpenWrt 源码项目 | OpenWrt 构建项目 | Action 项目 | 云服务厂商 | +| ----------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------------------------------- | +| [Github Actions](https://github.com/features/actions) | [openwrt/openwrt](https://github.com/openwrt/openwrt/) | [openwrt/buildbot](https://git.openwrt.org/?p=buildbot.git;a=summary) | [ncipollo/release-action](https://github.com/ncipollo/release-action) | [Acloud](https://acloud.net/) | +| | [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede) | [P3TERX/Actions-OpenWrt](https://github.com/P3TERX/Actions-OpenWrt) | [mknejp/delete-release-assets](https://github.com/mknejp/delete-release-assets) | [Cloudflare](https://www.cloudflare.com) | +| | [immortalwrt/immortalwrt](https://github.com/immortalwrt/immortalwrt) | [immortalwrt/opde](https://github.com/immortalwrt/opde) | [GitRML/delete-workflow-runs](https://github.com/GitRML/delete-workflow-runs) | [BackBlaze](https://www.backblaze.com/) | +| | | [aparcar/openwrt](https://github.com/aparcar/openwrt) | [easingthemes/ssh-deploy](https://github.com/easingthemes/ssh-deploy) | [HostHatch](https://hosthatch.com/) | +| | | [klever1988/nanopi-openwrt](https://github.com/klever1988/nanopi-openwrt) | [easimon/maximize-build-space](https://github.com/easimon/maximize-build-space) | | diff --git a/config/base-wireless-support.config b/config/base-wireless-support.config deleted file mode 100644 index d948eadc..00000000 --- a/config/base-wireless-support.config +++ /dev/null @@ -1,11 +0,0 @@ - -# This config is NOT for all devices -CONFIG_PACKAGE_kmod-mt76x2u=y -CONFIG_PACKAGE_kmod-rt2500-usb=y -CONFIG_PACKAGE_kmod-rt2800-lib=y -CONFIG_PACKAGE_kmod-rt2800-usb=y -CONFIG_PACKAGE_kmod-rt2x00-lib=y -CONFIG_PACKAGE_kmod-rt2x00-usb=y -CONFIG_PACKAGE_kmod-rtl8812au-ac=y -CONFIG_PACKAGE_kmod-rtl8821cu=y -CONFIG_PACKAGE_kmod-rtl88x2bu=y diff --git a/config/bcm27xx/bcm2708.config b/config/bcm27xx/bcm2708.config deleted file mode 100644 index d1303a50..00000000 --- a/config/bcm27xx/bcm2708.config +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_TARGET_bcm27xx=y -CONFIG_TARGET_bcm27xx_bcm2708=y -CONFIG_TARGET_bcm27xx_bcm2708_DEVICE_rpi=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n diff --git a/config/bcm27xx/bcm2709.config b/config/bcm27xx/bcm2709.config deleted file mode 100644 index 75d58a9f..00000000 --- a/config/bcm27xx/bcm2709.config +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_TARGET_bcm27xx=y -CONFIG_TARGET_bcm27xx_bcm2709=y -CONFIG_TARGET_bcm27xx_bcm2709_DEVICE_rpi-2=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n diff --git a/config/bcm27xx/bcm2710.config b/config/bcm27xx/bcm2710.config deleted file mode 100644 index a557a378..00000000 --- a/config/bcm27xx/bcm2710.config +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_TARGET_bcm27xx=y -CONFIG_TARGET_bcm27xx_bcm2710=y -CONFIG_TARGET_bcm27xx_bcm2710_DEVICE_rpi-3=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n diff --git a/config/bcm27xx/bcm2711.config b/config/bcm27xx/bcm2711.config deleted file mode 100644 index 862d67c6..00000000 --- a/config/bcm27xx/bcm2711.config +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_TARGET_bcm27xx=y -CONFIG_TARGET_bcm27xx_bcm2711=y -CONFIG_TARGET_bcm27xx_bcm2711_DEVICE_rpi-4=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n diff --git a/config/firmware-extra.config b/config/firmware-extra.config deleted file mode 100644 index bb669ee0..00000000 --- a/config/firmware-extra.config +++ /dev/null @@ -1,102 +0,0 @@ -CONFIG_ALL_NONSHARED=y -CONFIG_ALL_KMODS=y -CONFIG_SDK=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_DOCKER_CGROUP_OPTIONS=y -CONFIG_DOCKER_NET_ENCRYPT=y -CONFIG_DOCKER_NET_MACVLAN=y -CONFIG_DOCKER_NET_OVERLAY=y -CONFIG_DOCKER_NET_TFTP=y -CONFIG_DOCKER_OPTIONAL_FEATURES=y -CONFIG_DOCKER_STO_BTRFS=y -CONFIG_DOCKER_STO_EXT4=y -CONFIG_PACKAGE_autocore-arm=y -CONFIG_PACKAGE_automount=y -CONFIG_PACKAGE_autosamba=n -CONFIG_PACKAGE_kmod-fs-ext4=y -CONFIG_PACKAGE_kmod-fs-f2fs=y -CONFIG_PACKAGE_kmod-fs-nfs=y -CONFIG_PACKAGE_kmod-fs-nfs-common=y -CONFIG_PACKAGE_kmod-fs-nfs-common-rpcsec=y -CONFIG_PACKAGE_kmod-fs-nfs-v3=y -CONFIG_PACKAGE_kmod-fs-nfs-v4=y -CONFIG_PACKAGE_kmod-fs-nfsd=y -CONFIG_PACKAGE_kmod-fs-squashfs=y -CONFIG_PACKAGE_kmod-usb2=y -CONFIG_PACKAGE_kmod-usb2-pci=y -CONFIG_PACKAGE_kmod-usb3=y -CONFIG_PACKAGE_kmod-usb-audio=y -CONFIG_PACKAGE_kmod-usb-net=y -CONFIG_PACKAGE_kmod-usb-net-asix=y -CONFIG_PACKAGE_kmod-usb-net-asix-ax88179=y -CONFIG_PACKAGE_kmod-usb-net-rtl8150=y -CONFIG_PACKAGE_kmod-usb-net-rtl8152=y -CONFIG_PACKAGE_kmod-usb-ohci=y -CONFIG_PACKAGE_kmod-usb-ohci-pci=y -CONFIG_PACKAGE_kmod-usb-printer=y -CONFIG_PACKAGE_kmod-usb-storage=y -CONFIG_PACKAGE_kmod-usb-storage-extras=y -CONFIG_PACKAGE_kmod-usb-storage-uas=y -CONFIG_PACKAGE_kmod-usb-uhci=y -CONFIG_PACKAGE_kmod-tun=y -CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common=n -CONFIG_PACKAGE_libcap=y -CONFIG_PACKAGE_libcap-bin=y -CONFIG_PACKAGE_libuhttpd-openssl=n -CONFIG_PACKAGE_luci-app-accesscontrol=n -CONFIG_PACKAGE_luci-app-adbyby-plus=n -CONFIG_PACKAGE_luci-app-commands=y -CONFIG_PACKAGE_luci-app-cpufreq=y -CONFIG_PACKAGE_luci-app-ddns=n -CONFIG_PACKAGE_luci-app-diskman=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_kmod_md_linear=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_kmod_md_raid456=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_mdadm=y -CONFIG_PACKAGE_luci-app-ipsec-vpnd=n -CONFIG_PACKAGE_luci-app-nlbwmon=n -CONFIG_PACKAGE_luci-app-passwall=n -CONFIG_PACKAGE_luci-app-ssr-plus=n -CONFIG_PACKAGE_luci-app-turboacc=y -CONFIG_PACKAGE_TURBOACC_INCLUDE_BBR_CCA=y -CONFIG_PACKAGE_TURBOACC_INCLUDE_DNSFORWARDER=y -CONFIG_PACKAGE_TURBOACC_INCLUDE_DNSPROXY=y -CONFIG_PACKAGE_TURBOACC_INCLUDE_OFFLOADING=y -CONFIG_PACKAGE_TURBOACC_INCLUDE_SHORTCUT_FE=n -CONFIG_PACKAGE_luci-app-ttyd=y -CONFIG_PACKAGE_luci-app-unblockmusic=n -CONFIG_PACKAGE_luci-app-upnp=n -CONFIG_PACKAGE_luci-app-vlmcsd=n -CONFIG_PACKAGE_luci-app-vsftpd=n -CONFIG_PACKAGE_luci-app-vssr=n -CONFIG_PACKAGE_luci-app-webadmin=y -CONFIG_PACKAGE_luci-app-wol=n -CONFIG_PACKAGE_luci-app-xlnetacc=n -CONFIG_PACKAGE_luci-app-zerotier=n -CONFIG_PACKAGE_luci-theme-argonv3=y -CONFIG_PACKAGE_luci-theme-material=y -CONFIG_PACKAGE_apk=y -CONFIG_PACKAGE_alpine-keys=y -CONFIG_PACKAGE_alpine-repositories=y -CONFIG_PACKAGE_bash=y -CONFIG_PACKAGE_bsdtar=y -CONFIG_PACKAGE_bzip2=y -CONFIG_PACKAGE_coremark=y -CONFIG_PACKAGE_cgroupfs-mount=y -CONFIG_PACKAGE_curl=y -CONFIG_PACKAGE_docker=m -CONFIG_PACKAGE_dockerd=m -CONFIG_PACKAGE_fdisk=y -CONFIG_PACKAGE_htop=y -CONFIG_PACKAGE_lsblk=y -CONFIG_PACKAGE_lscpu=y -CONFIG_PACKAGE_nano=y -CONFIG_PACKAGE_openssh-sftp-client=y -CONFIG_PACKAGE_openssh-sftp-server=y -CONFIG_PACKAGE_pciutils=y -CONFIG_PACKAGE_snmpd=y -CONFIG_PACKAGE_unzip=y -CONFIG_PACKAGE_usb-modeswitch=y -CONFIG_PACKAGE_usbutils=y -CONFIG_PACKAGE_vim=y -CONFIG_PACKAGE_zsh=y -CONFIG_PACKAGE_zip=y diff --git a/config/i18n.config b/config/i18n.config new file mode 100644 index 00000000..b0fbe3cf --- /dev/null +++ b/config/i18n.config @@ -0,0 +1 @@ +luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-turboacc-zh-cn luci-i18n-filetransfer-zh-cn \ No newline at end of file diff --git a/config/ipq40xx/generic.config b/config/ipq40xx/generic.config deleted file mode 100644 index 403e42d4..00000000 --- a/config/ipq40xx/generic.config +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG_TARGET_ipq40xx=y -CONFIG_TARGET_ipq40xx_generic=y -CONFIG_TARGET_MULTI_PROFILE=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_asus_rt-ac58u=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_asus_rt-acrh17=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_hiwifi_c526a=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_hiwifi_c526a-128m=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_netgear_ex6100v2=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_netgear_ex6150v2=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_netgear_ex6200v2=y -CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_p2w_r619ac=y -CONFIG_TARGET_PER_DEVICE_ROOTFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-multimedia-input=n -CONFIG_PACKAGE_kmod-qlcnic=n -CONFIG_PACKAGE_kmod-r8125=n -CONFIG_PACKAGE_kmod-r8168=n diff --git a/config/packages-extra.config b/config/packages-extra.config deleted file mode 100644 index 1f3b9d1f..00000000 --- a/config/packages-extra.config +++ /dev/null @@ -1,89 +0,0 @@ - -CONFIG_ALL=y -CONFIG_DOCKER_CGROUP_OPTIONS=y -CONFIG_DOCKER_NET_ENCRYPT=y -CONFIG_DOCKER_NET_MACVLAN=y -CONFIG_DOCKER_NET_OVERLAY=y -CONFIG_DOCKER_NET_TFTP=y -CONFIG_DOCKER_OPTIONAL_FEATURES=y -CONFIG_DOCKER_STO_BTRFS=y -CONFIG_DOCKER_STO_EXT4=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_kmod_md_linear=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_kmod_md_raid456=y -CONFIG_PACKAGE_luci-app-diskman_INCLUDE_mdadm=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Brook=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ChinaDNS_NG=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Kcptun=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy=n -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_PDNSD=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client=n -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server=n -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Server=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_GO=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_NaiveProxy=n -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Redsocks2=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Libev_Client=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Libev_Server=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Rust_Client=n -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Rust_Server=n -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Libev_Client=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Libev_Server=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Simple_Obfs=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Trojan=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_V2ray_Plugin=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray=y -CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Xray=y -CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Trojan=y -CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Kcptun=y -CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Xray_plugin=y -CONFIG_PACKAGE_luci-app-vssr_INCLUDE_ShadowsocksR_Libev_Server=y -CONFIG_PACKAGE_luci-app-bypass_Shadowsocks_Server=y -CONFIG_PACKAGE_luci-app-bypass_Shadowsocks=y -CONFIG_PACKAGE_luci-app-bypass_ShadowsocksR=y -CONFIG_PACKAGE_luci-app-bypass_ShadowsocksR_Server=y -CONFIG_PACKAGE_luci-app-bypass_Simple_obfs=y -CONFIG_PACKAGE_luci-app-bypass_Simple_obfs_server=y -CONFIG_PACKAGE_luci-app-bypass_V2ray_plugin=n -CONFIG_PACKAGE_luci-app-bypass_Xray=y -CONFIG_PACKAGE_luci-app-bypass_Trojan=y -CONFIG_PACKAGE_luci-app-bypass_Trojan-Go=y -CONFIG_PACKAGE_luci-app-bypass_NaiveProxy=y -CONFIG_PACKAGE_luci-app-bypass_Kcptun=y -CONFIG_PACKAGE_luci-app-bypass_Socks5_Proxy=y -CONFIG_PACKAGE_luci-app-bypass_Socks_Server=y -CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_dnsforwarder=y -CONFIG_LUCI_LANG_ca=y -CONFIG_LUCI_LANG_cs=y -CONFIG_LUCI_LANG_de=y -CONFIG_LUCI_LANG_el=y -CONFIG_LUCI_LANG_es=y -CONFIG_LUCI_LANG_fr=y -CONFIG_LUCI_LANG_he=y -CONFIG_LUCI_LANG_hu=y -CONFIG_LUCI_LANG_it=y -CONFIG_LUCI_LANG_ja=y -CONFIG_LUCI_LANG_ko=y -CONFIG_LUCI_LANG_ms=y -CONFIG_LUCI_LANG_no=y -CONFIG_LUCI_LANG_pl=y -CONFIG_LUCI_LANG_pt=y -CONFIG_LUCI_LANG_pt-br=y -CONFIG_LUCI_LANG_ro=y -CONFIG_LUCI_LANG_ru=y -CONFIG_LUCI_LANG_sk=y -CONFIG_LUCI_LANG_sv=y -CONFIG_LUCI_LANG_tr=y -CONFIG_LUCI_LANG_uk=y -CONFIG_LUCI_LANG_vi=y -CONFIG_LUCI_LANG_zh-tw=y diff --git a/config/packages.config b/config/packages.config new file mode 100644 index 00000000..b731656d --- /dev/null +++ b/config/packages.config @@ -0,0 +1,2 @@ +CONFIG_TARGET_MULTI_PROFILE=y +CONFIG_ALL=y diff --git a/config/rockchip/armv8.config b/config/rockchip/armv8.config deleted file mode 100644 index 64d93d84..00000000 --- a/config/rockchip/armv8.config +++ /dev/null @@ -1,16 +0,0 @@ -CONFIG_TARGET_rockchip=y -CONFIG_TARGET_rockchip_armv8=y -CONFIG_TARGET_MULTI_PROFILE=y -CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y -CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y -CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_pine64_rockpro64=y -CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-4=y -CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_xunlong_orangepi-r1-plus=y -CONFIG_TARGET_ALL_PROFILES=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n diff --git a/config/sunxi/cortexa53.config b/config/sunxi/cortexa53.config deleted file mode 100644 index 44fad843..00000000 --- a/config/sunxi/cortexa53.config +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_TARGET_sunxi=y -CONFIG_TARGET_sunxi_cortexa53=y -CONFIG_TARGET_MULTI_PROFILE=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_friendlyarm_nanopi-neo-plus2=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_friendlyarm_nanopi-neo2=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_friendlyarm_nanopi-r1s-h5=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_libretech_all-h3-cc-h5=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_olimex_a64-olinuxino=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_olimex_a64-olinuxino-emmc=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_pine64_pine64-plus=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_pine64_sopine-baseboard=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-one-plus=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-pc2=y -CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero-plus=y -CONFIG_TARGET_ALL_PROFILES=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_PACKAGE_kmod-r8168=n -CONFIG_PACKAGE_kmod-r8125=n -CONFIG_PACKAGE_kmod-sunxi-ir=n diff --git a/config/targets.config b/config/targets.config new file mode 100644 index 00000000..ea1fa2a7 --- /dev/null +++ b/config/targets.config @@ -0,0 +1,37 @@ +# Target Configurations +CONFIG_TARGET_ALL_PROFILES=y +CONFIG_TARGET_MULTI_PROFILE=y +CONFIG_TARGET_PER_DEVICE_ROOTFS=y +CONFIG_TARGET_ROOTFS_TARGZ=y +CONFIG_TARGET_IMAGES_GZIP=y +CONFIG_TARGET_KERNEL_PARTSIZE=64 +CONFIG_TARGET_ROOTFS_PARTSIZE=750 + +# Target Images +CONFIG_ALL_KMODS=y +CONFIG_ALL_NONSHARED=y + +# Build Configurations +CONFIG_IB=y +CONFIG_MAKE_TOOLCHAIN=y +CONFIG_SDK=y + +# Chinese Language Support +CONFIG_LUCI_LANG_zh-cn=y + +# Packages Configurations +CONFIG_DOCKER_CGROUP_OPTIONS=y +CONFIG_DOCKER_NET_ENCRYPT=y +CONFIG_DOCKER_NET_MACVLAN=y +CONFIG_DOCKER_NET_OVERLAY=y +CONFIG_DOCKER_NET_TFTP=y +CONFIG_DOCKER_OPTIONAL_FEATURES=y +CONFIG_DOCKER_STO_BTRFS=y +CONFIG_DOCKER_STO_EXT4=y +CONFIG_PACKAGE_docker=m +CONFIG_PACKAGE_dockerd=m +CONFIG_PACKAGE_libbpf=m +CONFIG_PACKAGE_libelf=m +CONFIG_PACKAGE_qosify=m +CONFIG_PACKAGE_tc-full=m +CONFIG_PACKAGE_tc-mod-iptables=m diff --git a/config/x86.config b/config/x86.config new file mode 100644 index 00000000..33d8b254 --- /dev/null +++ b/config/x86.config @@ -0,0 +1,9 @@ + +CONFIG_TARGET_ROOTFS_EXT4FS=y +CONFIG_GRUB_IMAGES=y +CONFIG_GRUB_EFI_IMAGES=y +CONFIG_ISO_IMAGES=y +CONFIG_QCOW2_IMAGES=y +CONFIG_VHDX_IMAGES=y +CONFIG_VDI_IMAGES=y +CONFIG_VMDK_IMAGES=y \ No newline at end of file diff --git a/config/x86/64.config b/config/x86/64.config deleted file mode 100644 index b7a1877f..00000000 --- a/config/x86/64.config +++ /dev/null @@ -1,15 +0,0 @@ -CONFIG_TARGET_x86=y -CONFIG_TARGET_x86_64=y -CONFIG_TARGET_x86_64_DEVICE_generic=y -CONFIG_TARGET_ROOTFS_SQUASHFS=y -CONFIG_TARGET_ROOTFS_EXT4FS=y -CONFIG_TARGET_ROOTFS_TARGZ=y -CONFIG_TARGET_KERNEL_PARTSIZE=64 -CONFIG_TARGET_ROOTFS_PARTSIZE=960 -CONFIG_GRUB_IMAGES=y -CONFIG_GRUB_EFI_IMAGES=y -CONFIG_ISO_IMAGES=y -CONFIG_QCOW2_IMAGES=y -CONFIG_VHDX_IMAGES=y -CONFIG_VDI_IMAGES=y -CONFIG_VMDK_IMAGES=y diff --git a/data/opkg/distfeeds.conf b/data/opkg/distfeeds.conf index 1b1522da..cfd8fd13 100644 --- a/data/opkg/distfeeds.conf +++ b/data/opkg/distfeeds.conf @@ -1,4 +1,5 @@ -src/gz openwrt_core file:///www/snapshots/targets/DEVICE_TARGET/DEVICE_SUBTARGET/packages +src/gz openwrt_core https://openwrt.cc/snapshots/targets/DEVICE_TARGET/DEVICE_SUBTARGET/packages +src/gz openwrt_kmods https://openwrt.cc/snapshots/targets/DEVICE_TARGET/DEVICE_SUBTARGET/kmods/KERNEL_VERSION src/gz openwrt_base https://openwrt.cc/snapshots/packages/DEVICE_PLATFORM/base src/gz openwrt_luci https://openwrt.cc/snapshots/packages/DEVICE_PLATFORM/luci src/gz openwrt_packages https://openwrt.cc/snapshots/packages/DEVICE_PLATFORM/packages diff --git a/data/support/platform.config b/data/support/platform.config new file mode 100644 index 00000000..4e10cb3b --- /dev/null +++ b/data/support/platform.config @@ -0,0 +1,18 @@ +aarch64_cortex-a53/armvirt/64 +aarch64_cortex-a72/bcm27xx/bcm2711 +aarch64_generic/layerscape/armv8_64b +arm_arm1176jzf-s_vfp/bcm27xx/bcm2708 +arm_arm926ej-s/at91/sam9x +arm_cortex-a15_neon-vfpv4/armvirt/32 +arm_cortex-a5_vfpv4/at91/sama5 +arm_cortex-a7/mediatek/mt7629 +arm_cortex-a7_neon-vfpv4/bcm27xx/bcm2709 +arm_cortex-a8_vfpv3/omap/generic +arm_cortex-a9/bcm53xx/generic +arm_cortex-a9_neon/imx6/generic +arm_cortex-a9_vfpv3-d16/mvebu/cortexa9 +arm_fa526/gemini/generic +arm_mpcore/oxnas/ox820 +arm_xscale/kirkwood/generic +i386_pentium4/x86/generic +x86_64/x86/64 diff --git a/data/support/targets.config b/data/support/targets.config new file mode 100644 index 00000000..fd922d61 --- /dev/null +++ b/data/support/targets.config @@ -0,0 +1,34 @@ +aarch64_cortex-a53/armvirt/64 +aarch64_cortex-a53/bcm27xx/bcm2710 +aarch64_cortex-a53/bcm4908/generic +aarch64_cortex-a53/mediatek/mt7622 +aarch64_cortex-a53/mvebu/cortexa53 +aarch64_cortex-a53/sunxi/cortexa53 +aarch64_cortex-a72/bcm27xx/bcm2711 +aarch64_cortex-a72/mvebu/cortexa72 +aarch64_generic/layerscape/armv8_64b +aarch64_generic/octeontx/generic +aarch64_generic/rockchip/armv8 +arm_arm1176jzf-s_vfp/bcm27xx/bcm2708 +arm_arm926ej-s/at91/sam9x +arm_arm926ej-s/mxs/generic +arm_cortex-a15_neon-vfpv4/armvirt/32 +arm_cortex-a15_neon-vfpv4/ipq806x/generic +arm_cortex-a5_vfpv4/at91/sama5 +arm_cortex-a7/mediatek/mt7629 +arm_cortex-a7_neon-vfpv4/bcm27xx/bcm2709 +arm_cortex-a7_neon-vfpv4/ipq40xx/generic +arm_cortex-a7_neon-vfpv4/layerscape/armv7 +arm_cortex-a7_neon-vfpv4/mediatek/mt7623 +arm_cortex-a7_neon-vfpv4/sunxi/cortexa7 +arm_cortex-a8_vfpv3/omap/generic +arm_cortex-a8_vfpv3/sunxi/cortexa8 +arm_cortex-a9/bcm53xx/generic +arm_cortex-a9_neon/imx6/generic +arm_cortex-a9_vfpv3-d16/mvebu/cortexa9 +arm_cortex-a9_vfpv3-d16/tegra/generic +arm_fa526/gemini/generic +arm_mpcore/oxnas/ox820 +arm_xscale/kirkwood/generic +i386_pentium4/x86/generic +x86_64/x86/64 \ No newline at end of file diff --git a/data/zsh/.zshrc b/data/zsh/.zshrc deleted file mode 100644 index 6793a29b..00000000 --- a/data/zsh/.zshrc +++ /dev/null @@ -1,101 +0,0 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Path to your oh-my-zsh installation. -export ZSH=$HOME/.oh-my-zsh - -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="ys" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to automatically update without prompting. -# DISABLE_UPDATE_PROMPT="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git command-not-found extract z docker zsh-syntax-highlighting zsh-autosuggestions zsh-completions) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -autoload -U compinit && compinit diff --git a/doc/LuCI-App-List.md b/doc/LuCI-App-List.md deleted file mode 100644 index a78030a9..00000000 --- a/doc/LuCI-App-List.md +++ /dev/null @@ -1,179 +0,0 @@ -# LuCI APP 安装说明 - -| LuCI APP | 用途 | -| :-------------------------------- | :----------------------------- | -| luci-app-accesscontrol | 上网时间控制 | -| luci-app-acme | Acme.sh HTTP 证书申请 | -| luci-app-adblock | ADBlock 广告屏蔽工具 | -| luci-app-adbyby-plus | ADBYBY 广告屏蔽大师 | -| luci-app-adguardhome | ADGuardHome 广告屏蔽工具 | -| luci-app-advanced-reboot | 高级重启 | -| luci-app-advancedsetting | 系统高级设置 | -| luci-app-ahcp | AHCP 服务器 | -| luci-app-airplay2 | AirPlay2 音频推送服务器 | -| luci-app-airwhu | 锐捷 802.1X 认证客户端 | -| luci-app-aliddns | 阿里云 DDNS | -| luci-app-amule | aMule P2P 下载工具 | -| luci-app-appfilter | 应用过滤 | -| luci-app-argon-config | Argon 主题配置 | -| luci-app-aria2 | Aria2 下载工具 | -| luci-app-arpbind | IP/Mac 绑定 | -| luci-app-attendedsysupgrade | 参与式系统升级 | -| luci-app-autoipsetadder | IPSET 配置 | -| luci-app-autoreboot | 定时重启 | -| luci-app-baidupcs-web | 百度网盘 Pcs 下载 | -| luci-app-beardropper | SSH 攻击防御 | -| luci-app-bird1-ipv6 | BIRD 路由守护程序 (IPV6) | -| luci-app-bmx6 | BMX6 路由协议 | -| luci-app-brook | Brook 客户端 | -| luci-app-brook-server | Brook 服务器 | -| luci-app-cd8021x | 802.1x 有线认证拨号 | -| luci-app-chinadns | ChinaDNS | -| luci-app-cifs | CIFS 服务器 | -| luci-app-cifs-mount | SMB/CIFS 挂载客户端 | -| luci-app-cjdns | IPV6 加密 | -| luci-app-clamav | 联系人 | -| luci-app-commands | 自定义命令 | -| luci-app-cpufreq | CPU 性能优化调节 | -| luci-app-cpulimit | CPU 使用率限制 | -| luci-app-cshark | CloudShark 抓包工具 | -| luci-app-cupsd | Cups 打印服务器 | -| luci-app-dawn | 分散式 WiFi 控制器 | -| luci-app-ddns | DDNS 客户端 | -| luci-app-diag-core | 网络诊断 | -| luci-app-diskman | 磁盘管理 | -| luci-app-dnscrypt-proxy | DNSCrypt-Proxy | -| luci-app-dnsforwarder | DNSForwarder | -| luci-app-docker | Docker 容器 | -| luci-app-dockerman | Docker 控制面板 | -| luci-app-e2guardian | Web 内容过滤器 | -| luci-app-eqos | 客户端限速 (基于 IP) | -| luci-app-familycloud | 天翼家庭云 / 云盘提速 | -| luci-app-fileassistant | 文件助手 | -| luci-app-filebrowser | FileBrowser文件管理器 | -| luci-app-filetransfer | 文件传输 | -| luci-app-firewall | 防火墙 | -| luci-app-freifunk-policyrouting | Freifunk 策略路由 | -| luci-app-freifunk-widgets | Freifunk 组件 | -| luci-app-frpc | Frp 内网穿透客户端 | -| luci-app-frps | Frp 内网穿透服务器 | -| luci-app-gost | Gost 安全隧道 | -| luci-app-gowebdav | GoWebDav | -| luci-app-guest-wifi | 访客 WiFi | -| luci-app-haproxy-tcp | Haproxy 负载均衡 | -| luci-app-hd-idle | 硬盘休眠 | -| luci-app-hnet | Homenet 控制协议 | -| luci-app-https-dns-proxy | DOH 配置 | -| luci-app-https_dns_proxy | DOH 配置 | -| luci-app-ipsec-vpnd | IPSec VPN 客户端 | -| luci-app-ipsec-vpnserver-manyusers | IPSec VPN 服务器 | -| luci-app-iptvhelper | IPTV 助手 | -| luci-app-jd-dailybonus | 京东签到助手 | -| luci-app-kcptun | Kcptun | -| luci-app-kodexplorer | 可道云文件管理器 | -| luci-app-ksmbd | KSMB 网络共享 | -| luci-app-lxc | LXC 容器 | -| luci-app-mentohust | Mentohust 锐捷拨号客户端 | -| luci-app-meshwizard | Mesh 设置向导 | -| luci-app-minidlna | MiniDLNA | -| luci-app-minieap | Minieap 锐捷拨号客户端 | -| luci-app-mjpg-streamer | UVC 摄像头配置 | -| luci-app-music-remote-center | PCHiFi 数字转盘遥控 | -| luci-app-mwan3 | Mwan3 多线多拨 | -| luci-app-mwan3helper | Mwan3 助手 | -| luci-app-mwol | 网络唤醒 (MQTT 协议) | -| luci-app-n2n_v2 | N2N V2 VPN | -| luci-app-naiveproxy | Naiveproxy 客户端 | -| luci-app-netdata | Netdata 实时监控 | -| luci-app-nfs | NFS 管理 | -| luci-app-nft-qos | Nftables 限速 | -| luci-app-nginx-pingos | PingOS 流媒体服务器 | -| luci-app-ngrokc | Ngrok 内网穿透客户端 | -| luci-app-njitclient | 南京工程学院 802.1X 客户端 | -| luci-app-nlbwmon | 流量监控 | -| luci-app-nps | NPS 内网穿透 | -| luci-app-ntpc | NTP 客户端 | -| luci-app-oled | OLED 配置 | -| luci-app-onliner | 在线客户端 | -| luci-app-openclash | OpenClash | -| luci-app-openvpn | OpenVPN 配置 | -| luci-app-openvpn-server | OpenVPN 服务器 | -| luci-app-p910nd | P910nd 打印服务器 | -| luci-app-pagekitec | PageKite 内网穿透客户端 | -| luci-app-passwall | Passwall | -| luci-app-polipo | Polipo 代理服务器 | -| luci-app-pppoe-relay | PPPoE NAT 穿透 | -| luci-app-pppoe-server | PPPoE 服务器 | -| luci-app-privoxy | Privoxy 代理服务器 | -| luci-app-ps3netsrv | Ps3netsrv | -| luci-app-qbittorrent | qBittorrent | -| luci-app-qos | QoS 配置 | -| luci-app-qosv4 | QoS V4 | -| luci-app-radicale | CalDAV/CardDAV 同步工具 | -| luci-app-ramfree | 释放内存 | -| luci-app-rclone | Rclone | -| luci-app-rp-pppoe-server | RP-PPPoE 服务器 | -| luci-app-samba | Samba 网络共享 | -| luci-app-samba4 | Samba4 网络共享 | -| luci-app-scutclient | 华南理工大学拨号客户端 | -| luci-app-serverchan | Server 酱 | -| luci-app-shadowsocks-libev | Shadowsocks 客户端 | -| luci-app-shairplay | Shairplay 服务器 | -| luci-app-simple-adblock | Simple ADBlock 广告屏蔽 | -| luci-app-smartdns | SmartDNS | -| luci-app-smartinfo | S.M.A.R.T 硬盘监控 | -| luci-app-smstool | 3G 模块短信工具 | -| luci-app-socat | Socat 网络军刀 | -| luci-app-softethervpn | SoftEtherVPN | -| luci-app-softethervpn5 | SoftEtherVPN5 | -| luci-app-speederv2 | UDPspeeder 工具 | -| luci-app-sqm | SQM QoS | -| luci-app-squid | Squid 代理服务器 | -| luci-app-ssocks | sSocks 服务器 | -| luci-app-ssr-libev-server | ShadowsocksR Libev 服务器 | -| luci-app-ssr-mudb-server | ShadowsocksR 多用户服务器 | -| luci-app-ssr-plus | ShadowsocksR Plus + | -| luci-app-ssrserver-python | ShadowsocksR Python 服务器 | -| luci-app-statistics | 实时流量监控 | -| luci-app-syncdial | 负载均衡 | -| luci-app-syncthing | Syncthing | -| luci-app-sysuh3c | 中山大学东校区联网客户端 | -| luci-app-terminal | WEB 终端 | -| luci-app-timecontrol | 时间控制 | -| luci-app-timewol | 局域网唤醒 | -| luci-app-tinyproxy | TinyProxy | -| luci-app-transmission | Transmission | -| luci-app-travelmate | 旅行路由器 | -| luci-app-trojan-server | Trojan 服务器 | -| luci-app-ttyd | TTYD 终端 | -| luci-app-turboacc | Trubo ACC 网络加速 | -| luci-app-udp2raw | udp2raw 配置 | -| luci-app-udpxy | udpxy 配置 | -| luci-app-uhttpd | uhttpd 配置 | -| luci-app-unblockneteasemusic | 解除网易云音乐播放限制 | -| luci-app-unblockneteasemusic-go | 解除网易云音乐播放限制 (Golang) | -| luci-app-unblockneteasemusic-mini | 解除网易云音乐播放限制 (云解锁) | -| luci-app-unbound | Unbound DNS 服务 | -| luci-app-upnp | UPNP | -| luci-app-usb-printer | USB 打印服务器 | -| luci-app-usb3disable | USB3 禁用 | -| luci-app-uugamebooster | 网易 UU 加速器 | -| luci-app-v2ray-server | V2RAY 服务器 | -| luci-app-verysync | 微力同步 | -| luci-app-vlmcsd | KMS 服务器 | -| luci-app-vnstat | VNStat 流量监控 | -| luci-app-vpn-policy-routing | VPN 策略路由 | -| luci-app-vpnbypass | VPN 绕过 | -| luci-app-vsftpd | FTP 服务器 | -| luci-app-vssr | Hello World | -| luci-app-watchcat | WatchCat | -| luci-app-webadmin | Web 管理 | -| luci-app-webrestriction | 访问限制 | -| luci-app-weburl | 管控 | -| luci-app-wifischedule | WiFi 计划 | -| luci-app-wireguard | WireGuard 状态 | -| luci-app-wol | 网络唤醒 | -| luci-app-wrtbwmon | 实时流量监测 | -| luci-app-xlnetacc | 迅雷快鸟 | -| luci-app-zerotier | ZeroTier | - diff --git a/doc/Support-Devices.md b/doc/Support-Devices.md deleted file mode 100644 index 3fd51f54..00000000 --- a/doc/Support-Devices.md +++ /dev/null @@ -1,125 +0,0 @@ -# 已支持的设备列表 - -## bcm27xx/bcm27xx - -rpi-2 - -rpi-3 - -rpi-4 - -> 下载地址: -> -> - -## ipq40xx/generic - -asus_rt-acrh17 - -p2w_r619ac - -> 下载地址: -> -> - -## rockchip/armv8 - -friendlyarm_nanopi-r2s - -friendlyarm_nanopi-r4s - -pine64_rockpro64 - -radxa_rock-pi-4 - -> 下载地址: -> -> https://openwrt.cc/snapshots/targets/rockchip/armv8/ - -## sunxi/cortexa7 - -cubietech_cubieboard2 - -cubietech_cubietruck - -friendlyarm_nanopi-m1-plus - -friendlyarm_nanopi-neo-air - -friendlyarm_nanopi-neo - -friendlyarm_nanopi-r1 - -friendlyarm_zeropi - -lamobo_lamobo-r1 - -lemaker_bananapi - -lemaker_bananapro - -linksprite_pcduino3 - -mele_m9 - -olimex_a20-olinuxino-lime - -olimex_a20-olinuxino-lime2-emmc - -olimex_a20-olinuxino-lime2 - -olimex_a20-olinuxino-micro - -sinovoip_bananapi-m2-plus - -sinovoip_bananapi-m2-ultra - -xunlong_orangepi-2 - -xunlong_orangepi-one - -xunlong_orangepi-pc - -xunlong_orangepi-plus - -xunlong_orangepi-r1 - -xunlong_orangepi-zero - -> 下载地址: -> -> - -## sunxi/cortexa53 - -friendlyarm_nanopi-neo-plus2 - -friendlyarm_nanopi-neo2 - -friendlyarm_nanopi-r1s-h5 - -libretech_all-h3-cc-h5 - -olimex_a64-olinuxino-emmc - -olimex_a64-olinuxino - -pine64_pine64-plus - -pine64_sopine-baseboard - -xunlong_orangepi-pc2 - -xunlong_orangepi-zero-plus - -> 下载地址: -> -> - -# x86/64 - -x86-64 - -> 下载地址: -> -> diff --git a/scripts/custom.sh b/scripts/custom.sh deleted file mode 100644 index d60b1000..00000000 --- a/scripts/custom.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -#================================================= -# Description: DIY script -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= -# Modify default IP -#sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate - -# Mod zzz-default-settings -pushd package/emortal/default-settings/files -sed -i '/http/d' zzz-default-settings -sed -i '/openwrt_luci/d' zzz-default-settings -popd - -# Add date version -export DATE_VERSION=$(date -d "$(rdate -n -4 -p pool.ntp.org)" +'%Y-%m-%d') -sed -i "s/%C/%C (${DATE_VERSION})/g" package/base-files/files/etc/openwrt_release - -# Clone community packages to package/community -mkdir package/community -pushd package/community - -# Add luci-app-bypass -git clone --depth=1 https://github.com/garypang13/luci-app-bypass -git clone --depth=1 https://github.com/garypang13/smartdns-le - -# Add luci-app-godproxy -git clone --depth=1 https://github.com/project-lede/luci-app-godproxy - -# Add luci-app-jd-dailybonus -git clone --depth=1 https://github.com/jerrykuku/luci-app-jd-dailybonus - -# Add luci-app-modeminfo -git clone --depth=1 https://github.com/koshev-msk/luci-app-modeminfo - -# Add luci-app-tcpdump -git clone --depth=1 https://github.com/KFERMercer/luci-app-tcpdump - -# Add luci-app-oaf -git clone --depth=1 https://github.com/destan19/OpenAppFilter -b oaf-3.0.1 - -# Add luci-theme-argon_armygreen -git clone --depth=1 https://github.com/XXKDB/luci-theme-argon_armygreen -popd - -# Fix mt76 wireless driver -pushd package/kernel/mt76 -sed -i '/mt7662u_rom_patch.bin/a\\techo mt76-usb disable_usb_sg=1 > $\(1\)\/etc\/modules.d\/mt76-usb' Makefile -popd - -# Fix luci-app-aria2 -pushd feeds/luci/applications -rm -rf luci-app-aria2 -svn co https://github.com/coolsnowwolf/luci/trunk/applications/luci-app-aria2 -popd - -# Rename hostname to OpenWrt -pushd package/base-files/files/bin -sed -i 's/ImmortalWrt/OpenWrt/g' config_generate -popd - -# Fix SDK -sed -i '/$(SDK_BUILD_DIR)\/$(STAGING_SUBDIR_HOST)\/usr\/bin/d' target/sdk/Makefile - -# Fix Toolchain -sed -i 's/LICENSE/LICENSES/g' target/toolchain/Makefile - -# Change default shell to zsh -sed -i 's/\/bin\/ash/\/usr\/bin\/zsh/g' package/base-files/files/etc/passwd diff --git a/scripts/init-settings.sh b/scripts/init-settings.sh deleted file mode 100644 index ad477267..00000000 --- a/scripts/init-settings.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -#================================================= -# File name: init-settings.sh -# Description: This script will be executed during the first boot -# Author: SuLingGG -# Blog: https://mlapp.cn -#================================================= - -# Set default theme to luci-theme-argon -uci set luci.main.mediaurlbase='/luci-static/argon' - -# Check file system during boot -uci set fstab.@global[0].check_fs=1 -uci commit - -# Disable opkg signature check -sed -i 's/option check_signature/# option check_signature/g' /etc/opkg.conf - -# Add execute permission for ipv6-helper -chmod +x /bin/ipv6-helper - -exit 0 diff --git a/scripts/ipv6-helper.sh b/scripts/ipv6-helper.sh deleted file mode 100644 index 824ee59e..00000000 --- a/scripts/ipv6-helper.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/usr/bin/env ash -#================================================= -# File name: ipv6-helper -# Description: Install IPV6 Modules On OpenWrt -# System Required: OpenWrt -# Version: 1.0 -# Lisence: MIT -# Author: SuLingGG -# Blog: https://mlapp.cn -#================================================= - -Green_font_prefix="\033[32m" -Red_font_prefix="\033[31m" -Green_background_prefix="\033[42;37m" -Red_background_prefix="\033[41;37m" -Font_color_suffix="\033[0m" -INFO="[${Green_font_prefix}INFO${Font_color_suffix}]" -ERROR="[${Red_font_prefix}ERROR${Font_color_suffix}]" - -Welcome(){ - echo -e "${Green_font_prefix}\nThis tool can help you install IPV6 modules on OpenWrt.\n${Font_color_suffix}" - echo -e "Usage:" - echo -e "ipv6-helper sub-command" - echo -e "Example:" - echo -e "\tipv6-helper install: Install ipv6-helper & IPV6 modules" - echo -e "\tipv6-helper remove: Remove ipv6-helper & IPV6 modules\n" - echo -e "Optional Usage:" - echo -e "\tipv6-helper server: Set IPV6 configuration to server mode" - echo -e "\tipv6-helper relay: Set IPV6 configuration to relay mode" - echo -e "\tipv6-helper hybird: Set IPV6 configuration to hybird mode" - echo -e "\tipv6-helper clean: Remove mwan3 modules\n" -} - -RebootConfirm(){ - echo -n -e "${Green_font_prefix}Need reboot, reboot now [y/N] (default N)? ${Font_color_suffix}" - read answer - case $answer in - Y | y) - echo -e "Rebooting...\n" && reboot;; - *) - echo -e "You can reboot later manually.\n";; - esac -} - -CheckInstall(){ - if [ ! -f "/etc/opkg/ipv6-installed" ];then - echo -e "${Green_font_prefix}\nYou shoud execute 'ipv6-helper install' first.\n${Green_font_prefix}" - else - echo -e "${Green_font_prefix}\nConfiguring...\n${Font_color_suffix}" - fi -} - -if [ $# == 0 ];then - Welcome - -elif [[ $1 = "install" ]]; then - echo -e "${Green_font_prefix}\nInstalling IPV6 modules...\n${Font_color_suffix}" - opkg update - opkg install ipv6helper - echo -e "${Green_font_prefix}\nIPV6 modules install successfully.\n${Font_color_suffix}" - echo -e "${Green_font_prefix}Configuring IPV6...\n${Font_color_suffix}" - - # Set server to lan - uci set dhcp.lan.dhcpv6=server - uci set dhcp.lan.ra=server - uci set dhcp.lan.ra_management=1 - uci set dhcp.lan.ra_default=1 - - # Set server to wan6 - uci set dhcp.wan6=dhcp - uci set dhcp.wan6.interface=wan - uci set dhcp.wan6.ra=server - uci set dhcp.wan6.dhcpv6=server - uci set dhcp.wan6.master=1 - - # Disable IPV6 ula prefix - sed -i 's/^[^#].*option ula/#&/' /etc/config/network - - # Enable IPV6 dns resolution - uci delete dhcp.@dnsmasq[0].filter_aaaa - - # Set mwan3 balance strategy to default - uci set mwan3.balanced.last_resort=default - - # Commit changes - uci commit - - # Remove mwan3 ip6tables rules - cp /lib/mwan3/mwan3.sh /lib/mwan3/mwan3.sh.orig - sed -i 's/ip6tables -t manle -w/\/bin\/true/g' /lib/mwan3/mwan3.sh - - touch /etc/opkg/ipv6-installed - - echo -e "${Green_font_prefix}IPV6 configure successfully.\n${Font_color_suffix}" - - RebootConfirm - -elif [[ $1 = "server" ]]; then - CheckInstall - - # Set server to lan - uci set dhcp.lan.dhcpv6=server - uci set dhcp.lan.ra=server - uci set dhcp.lan.ra_management=1 - uci set dhcp.lan.ra_default=1 - uci delete dhcp.lan.ndp - - # Set server to wan6 - uci set dhcp.wan6=dhcp - uci set dhcp.wan6.interface=wan - uci set dhcp.wan6.ra=server - uci set dhcp.wan6.dhcpv6=server - uci set dhcp.wan6.master=1 - uci delete dhcp.wan6.ndp - - # Commit changes - uci commit - - echo -e "${Green_font_prefix}Server mode configure successfully.\n${Font_color_suffix}" - - RebootConfirm - -elif [[ $1 = "relay" ]]; then - CheckInstall - - # Set relay to lan - uci set dhcp.lan.dhcpv6=relay - uci set dhcp.lan.ndp=relay - uci set dhcp.lan.ra=relay - uci delete dhcp.lan.ra_management - - # Set relay to wan6 - uci set dhcp.wan6=dhcp - uci set dhcp.wan6.interface=wan - uci set dhcp.wan6.ra=relay - uci set dhcp.wan6.dhcpv6=relay - uci set dhcp.wan6.ndp=relay - uci set dhcp.wan6.master=1 - - # Commit changes - uci commit - - echo -e "${Green_font_prefix}Relay mode configure successfully.\n${Font_color_suffix}" - - RebootConfirm - -elif [[ $1 = "hybird" ]]; then - CheckInstall - - # Set hybird to lan - uci set dhcp.lan.dhcpv6=hybird - uci set dhcp.lan.ndp=hybird - uci set dhcp.lan.ra=hybird - uci set dhcp.lan.ra_management=1 - uci set dhcp.lan.ra_default=1 - - # Set hybird to wan6 - uci set dhcp.wan6=dhcp - uci set dhcp.wan6.interface=wan - uci set dhcp.wan6.ra=hybird - uci set dhcp.wan6.dhcpv6=hybird - uci set dhcp.wan6.ndp=hybird - uci set dhcp.wan6.master=1 - - # Commit changes - uci commit - - echo -e "${Green_font_prefix}Hybird mode configure successfully.\n${Font_color_suffix}" - - RebootConfirm - -elif [[ $1 = "remove" ]]; then - echo -e "${Green_font_prefix}\nRemove IPV6 modules...\n${Font_color_suffix}" - opkg remove --force-removal-of-dependent-packages ipv6helper kmod-sit odhcp6c luci-proto-ipv6 ip6tables kmod-ipt-nat6 odhcpd-ipv6only kmod-ip6tables-extra - echo -e "${Green_font_prefix}\nIPV6 modules remove successfully.\n${Font_color_suffix}" - echo -e "${Green_font_prefix}Revert IPV6 configurations...\n${Font_color_suffix}" - - # Remove wan6 dhcp configurations - uci delete dhcp.wan6.ra - uci delete dhcp.wan6.dhcpv6 - uci delete dhcp.wan6.ndp - - # Remove lan dhcp configurations - uci delete dhcp.lan.dhcpv6 - uci delete dhcp.lan.ndp - uci delete dhcp.lan.ra - uci delete dhcp.lan.ra_management - uci delete dhcp.lan.ra_default - - # Enable IPV6 ula prefix - sed -i 's/#.*\toption ula/\toption ula/g' /etc/config/network - - # Disable IPV6 dns resolution - uci set dhcp.@dnsmasq[0].filter_aaaa=1 - - # Restore mwan3 balance strategy - uci set mwan3.balanced.last_resort=unreachable - - # Commit changes - uci commit - - # Restore mwan3 ip6tables rules - rm /lib/mwan3/mwan3.sh - cp /lib/mwan3/mwan3.sh.orig /lib/mwan3/mwan3.sh - - rm -f /etc/opkg/ipv6-installed - - echo -e "${Green_font_prefix}IPV6 remove successfully.\n${Font_color_suffix}" - - RebootConfirm - -elif [[ $1 = "clean" ]]; then - echo -e "${Green_font_prefix}\nRemove mwan3 modules...\n${Font_color_suffix}" - opkg remove mwan3 luci-app-mwan3 luci-app-mwan3helper luci-app-syncdial - echo -e "${Green_font_prefix}Mwan3 modules remove successfully.\n${Font_color_suffix}" - - RebootConfirm - -fi - -exit 0 diff --git a/scripts/preset-clash-core.sh b/scripts/preset-clash-core.sh deleted file mode 100644 index a53018db..00000000 --- a/scripts/preset-clash-core.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -#================================================= -# File name: preset-clash-core.sh -# Usage: | example: -# System Required: Linux -# Version: 1.0 -# Lisence: MIT -# Author: SuLingGG -# Blog: https://mlapp.cn -#================================================= - -mkdir -p files/etc/openclash/core - -OPENCLASH_MAIN_URL=$( curl -sL https://api.github.com/repos/vernesong/OpenClash/releases/tags/Clash | grep /clash-linux-armv8 | awk -F '"' '{print $4}') -# OFFICAL_OPENCLASH_MAIN_URL=$(curl -sL https://api.github.com/repos/Dreamacro/clash/releases/tags/v1.3.5 | grep /clash-linux-$1 | awk -F '"' '{print $4}') -CLASH_TUN_URL=$(curl -sL https://api.github.com/repos/vernesong/OpenClash/releases/tags/TUN-Premium | grep /clash-linux-$1 | awk -F '"' '{print $4}') -CLASH_GAME_URL=$(curl -sL https://api.github.com/repos/vernesong/OpenClash/releases/tags/TUN | grep /clash-linux-$1 | awk -F '"' '{print $4}') - -wget -qO- $OPENCLASH_MAIN_URL | tar xOvz > files/etc/openclash/core/clash -# wget -qO- $OFFICAL_OPENCLASH_MAIN_URL | gunzip -c > files/etc/openclash/core/clash -wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun -wget -qO- $CLASH_GAME_URL | tar xOvz > files/etc/openclash/core/clash_game - -chmod +x files/etc/openclash/core/clash* diff --git a/scripts/preset-terminal-tools.sh b/scripts/preset-terminal-tools.sh deleted file mode 100644 index 2dff9a40..00000000 --- a/scripts/preset-terminal-tools.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -#================================================= -# File name: preset-terminal-tools.sh -# System Required: Linux -# Version: 1.0 -# Lisence: MIT -# Author: SuLingGG -# Blog: https://mlapp.cn -#================================================= - -mkdir -p files/root -pushd files/root - -## Install oh-my-zsh -# Clone oh-my-zsh repository -git clone https://github.com/robbyrussell/oh-my-zsh ./.oh-my-zsh - -# Install extra plugins -git clone https://github.com/zsh-users/zsh-autosuggestions ./.oh-my-zsh/custom/plugins/zsh-autosuggestions -git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ./.oh-my-zsh/custom/plugins/zsh-syntax-highlighting -git clone https://github.com/zsh-users/zsh-completions ./.oh-my-zsh/custom/plugins/zsh-completions - -# Get .zshrc dotfile -cp $GITHUB_WORKSPACE/data/zsh/.zshrc . - -popd diff --git a/scripts/project-openwrt.sh b/scripts/project-openwrt.sh deleted file mode 100644 index e7f56243..00000000 --- a/scripts/project-openwrt.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -#================================================= -# Description: DIY script -# Lisence: MIT -# Author: P3TERX -# Blog: https://p3terx.com -#================================================= -# Modify default IP -#sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate - -# Mod zzz-default-settings -pushd package/emortal/default-settings/files -sed -i '/http/d' zzz-default-settings -sed -i '/openwrt_luci/d' zzz-default-settings -export orig_version=$(cat "zzz-default-settings" | grep DISTRIB_REVISION= | awk -F "'" '{print $2}') -export date_version=$(date -d "$(rdate -n -4 -p ntp.aliyun.com)" +'%Y-%m-%d') -sed -i "s/${orig_version}/${orig_version} (${date_version})/g" zzz-default-settings -popd - -# Clone community packages to package/community -mkdir package/community -pushd package/community - -# Add luci-app-dnsfilter -git clone --depth=1 https://github.com/garypang13/luci-app-dnsfilter - -# Add luci-app-bypass -git clone --depth=1 https://github.com/garypang13/luci-app-bypass -git clone --depth=1 https://github.com/garypang13/smartdns-le - -# Add luci-app-godproxy -git clone --depth=1 https://github.com/project-lede/luci-app-godproxy - -# Add luci-app-modeminfo -git clone --depth=1 https://github.com/koshev-msk/luci-app-modeminfo - -# Add luci-app-tcpdump -git clone --depth=1 https://github.com/KFERMercer/luci-app-tcpdump - -# Add luci-app-oaf -git clone --depth=1 https://github.com/destan19/OpenAppFilter -b oaf-3.0.1 - -# Add luci-theme-argon_armygreen -git clone --depth=1 https://github.com/XXKDB/luci-theme-argon_armygreen -popd - -# Fix mt76 wireless driver -pushd package/kernel/mt76 -sed -i '/mt7662u_rom_patch.bin/a\\techo mt76-usb disable_usb_sg=1 > $\(1\)\/etc\/modules.d\/mt76-usb' Makefile -popd - -# Fix luci-app-aria2 -pushd feeds/luci/applications -rm -rf luci-app-aria2 -svn co https://github.com/coolsnowwolf/luci/trunk/applications/luci-app-aria2 -popd - -# Rename hostname to OpenWrt -pushd package/base-files/files/bin -sed -i 's/ImmortalWrt/OpenWrt/g' config_generate -popd - -# Fix SDK -sed -i '/$(SDK_BUILD_DIR)\/$(STAGING_SUBDIR_HOST)\/usr\/bin/d;/LICENSE/d' target/sdk/Makefile - -# Remove some default packages -sed -i 's/luci-app-ddns//g;s/luci-app-upnp//g;s/luci-app-adbyby-plus//g;s/luci-app-vsftpd//g;s/luci-app-ssr-plus//g;s/luci-app-unblockmusic//g;s/luci-app-vlmcsd//g;s/luci-app-wol//g;s/luci-app-nlbwmon//g;s/luci-app-accesscontrol//g' include/target.mk - -# Change default shell to zsh -sed -i 's/\/bin\/ash/\/usr\/bin\/zsh/g' package/base-files/files/etc/passwd