From 71da452dc8309a64c91b71f1be072636fcf23fb4 Mon Sep 17 00:00:00 2001 From: sbwml Date: Fri, 6 Dec 2024 22:52:04 +0800 Subject: [PATCH] openwrt 24.10 releases Signed-off-by: sbwml --- .github/workflows/build-minimal.yml | 204 ++++++++++++++++++ .github/workflows/build-release.yml | 256 +++++++++++++++++++++++ .github/workflows/build-snapshots.yml | 264 ++++++++++++++++++++++++ .github/workflows/openwrt-core.yml | 123 +++++++++++ README.md | 284 ++++++++++++++++++++++++++ 5 files changed, 1131 insertions(+) create mode 100644 .github/workflows/build-minimal.yml create mode 100644 .github/workflows/build-release.yml create mode 100644 .github/workflows/build-snapshots.yml create mode 100644 .github/workflows/openwrt-core.yml create mode 100644 README.md diff --git a/.github/workflows/build-minimal.yml b/.github/workflows/build-minimal.yml new file mode 100644 index 0000000..5f026bd --- /dev/null +++ b/.github/workflows/build-minimal.yml @@ -0,0 +1,204 @@ +name: Build minimal + +on: + workflow_dispatch: + repository_dispatch: + types: [minimal] + +jobs: + build: + name: Build ${{ matrix.model }}-${{ matrix.tag.version }} + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - nanopi-r4s + - nanopi-r5s + - x86_64 + - netgear_r8500 + tag: + - type: rc2 + version: openwrt-24.10 + + steps: + - name: Setup variables + run: | + sudo timedatectl set-timezone 'Asia/Shanghai' + git config --global user.name 'actions' + git config --global user.email 'action@github.com' + echo build_dir="/builder" >> "$GITHUB_ENV" + + - name: Show system + run: | + echo -e "\n\e[1;32mCPU:\e[0m" + echo "$(grep 'model name' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}') ($(grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}')MHz) x $(grep processor /proc/cpuinfo | wc -l)" + echo -e "\n\e[1;32mMemory:\e[0m" + free -h + echo -e "\n\e[1;32mStorage:\e[0m" + df -Th / /mnt + echo -e "\n\e[1;32mSystem:\e[0m" + lsb_release -a + echo -e "\n\e[1;32mKernel:\e[0m" + uname -a + echo + + - name: Free disk space + uses: sbwml/actions@free-disk + with: + build-mount-path: /builder + + - name: Build System Setup + uses: sbwml/actions@openwrt-build-setup + + - name: Install LLVM + uses: sbwml/actions@install-llvm + + - name: Restore Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + uses: actions/cache/restore@v4 + with: + path: /builder/.ccache + key: ${{ matrix.tag.version }}-${{ matrix.model }} + + - name: Restore Cached (releases) + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + run: | + curl -s https://api.github.com/repos/${{ github.repository }}/releases | grep 'browser_download_url' | grep ccache | grep ${{ github.event.inputs.device }} | awk -F '"' '{print $4}' | grep -v '^$' | xargs -n 1 wget -q + cat ${{ matrix.model }}.tar.* | tar -xf - || true + rm -rf ${{ matrix.model }}.tar.* || true + [ -d .ccache ] && cache_size=$(du -sb .ccache | awk '{print $1}') || cache_size=0 + cache_size_mb=$(echo "scale=0; ${cache_size} / (1024 * 1024)" | bc) + echo "Cache Size: ~${cache_size_mb} MB (${cache_size} B)" + echo "Cache restored successfully" + echo "Cache restored from key: ${{ matrix.model }}" + + - name: Compile OpenWrt + id: compile + continue-on-error: true + working-directory: /builder + env: + git_password: ${{ secrets.ftp_password }} + run: | + [ "${{ matrix.model }}" != "netgear_r8500" ] && export KERNEL_CLANG_LTO=y + export BUILD_FAST=y ENABLE_CCACHE=y ENABLE_OTA=y ENABLE_BPF=y ENABLE_LTO=y ENABLE_LRNG=y MINIMAL_BUILD=y USE_GCC15=y ENABLE_MOLD=y + bash <(curl -sS ${{ secrets.script_url_general }}) ${{ matrix.tag.type }} ${{ matrix.model }} + cd openwrt + tags=$(git describe --abbrev=0 --tags) + echo "latest_release=$tags" >>$GITHUB_ENV + + - name: Extensive logs after a failed compilation + if: steps.compile.outcome == 'failure' + working-directory: /builder + run: | + cd openwrt + make V=s IGNORE_ERRORS="n m" + + - name: Prepare Firmware Files + working-directory: /builder + run: | + mkdir -p rom info + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "x86_64" ]; then + cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + cp -a openwrt/bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk rom/ + cp -a openwrt/bin/targets/bcm53xx/generic/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/bcm53xx/generic/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + fi + cd .. + tar zcf rom/buildinfo_${{ matrix.model }}.tar.gz info + + - name: Install aliyunpan & login + working-directory: /builder + timeout-minutes: 1 + run: | + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + device_id=${{ secrets.device_id_r4s_minimal }} + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + device_id=${{ secrets.device_id_r5s_minimal }} + elif [ "${{ matrix.model }}" = "x86_64" ]; then + device_id=${{ secrets.device_id_x86_minimal }} + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + device_id=${{ secrets.device_id_netgear_minimal }} + fi + sudo wget -q ${{ secrets.aliyunpan_go }} -O /bin/aliyunpan + sudo chmod 0755 /bin/aliyunpan + sudo sh -c 'echo "${{ secrets.aliyunpan_us_node }} api.alipan.com auth.alipan.com www.alipan.com" >> /etc/hosts' + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + aliyun_token=`curl -s ${{ secrets.aliyun_token }} | openssl enc -aes-256-cfb -pbkdf2 -a -d -k ${{ secrets.token_dec }}` + aliyunpan config set -device_id=$device_id >/dev/null 2>&1 + echo + echo $aliyun_token | aliyunpan login + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.model }}-${{ matrix.tag.version }} + path: ${{ env.build_dir }}/rom/*.* + + - name: Upload Firmware - Minimal + working-directory: /builder + timeout-minutes: 45 + run: | + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + version=$(cat openwrt/version.txt) + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r4s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/nanopi-r4s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r4s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r4s-ext4-sysupgrade.img.gz openwrt/nanopi-r4s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r4s-squashfs-sysupgrade.img.gz openwrt/nanopi-r4s/minimal/${{ matrix.tag.version }}/$version/ + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5c-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5c-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5s-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5s-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/minimal/${{ matrix.tag.version }}/$version/ + elif [ "${{ matrix.model }}" = "x86_64" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-generic-rootfs.tar.gz openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-ext4-combined-efi.img.gz openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-squashfs-combined-efi.img.gz openwrt/x86_64/minimal/${{ matrix.tag.version }}/$version/ + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/netgear-r8500/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/netgear-r8500/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/netgear-r8500/minimal/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*.chk openwrt/netgear-r8500/minimal/${{ matrix.tag.version }}/$version/ + fi + aliyunpan recycle delete -all + echo y | aliyunpan logout + + - name: Release OTA + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + username: openwrt + server: ${{ secrets.ftp_address }} + password: ${{ secrets.ftp_password }} + server-dir: minimal/${{ matrix.model }}/ + local-dir: ${{ env.build_dir }}/openwrt/ota/ + dangerous-clean-slate: true diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..8555dee --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,256 @@ +name: Build releases + +on: + workflow_dispatch: + repository_dispatch: + types: [release] + +jobs: + build: + name: Build ${{ matrix.model }}-${{ matrix.tag.version }} + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - armv8 + - nanopi-r4s + - nanopi-r5s + - x86_64 + - netgear_r8500 + tag: + - type: rc2 + version: openwrt-24.10 + + steps: + - name: Setup variables + run: | + sudo timedatectl set-timezone 'Asia/Shanghai' + git config --global user.name 'actions' + git config --global user.email 'action@github.com' + echo build_dir="/builder" >> "$GITHUB_ENV" + + - name: Show system + run: | + echo -e "\n\e[1;32mCPU:\e[0m" + echo "$(grep 'model name' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}') ($(grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}')MHz) x $(grep processor /proc/cpuinfo | wc -l)" + echo -e "\n\e[1;32mMemory:\e[0m" + free -h + echo -e "\n\e[1;32mStorage:\e[0m" + df -Th / /mnt + echo -e "\n\e[1;32mSystem:\e[0m" + lsb_release -a + echo -e "\n\e[1;32mKernel:\e[0m" + uname -a + echo + + - name: Free disk space + uses: sbwml/actions@free-disk + with: + build-mount-path: /builder + + - name: Build System Setup + uses: sbwml/actions@openwrt-build-setup + + - name: Install LLVM + uses: sbwml/actions@install-llvm + + - name: Restore Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + uses: actions/cache/restore@v4 + with: + path: /builder/.ccache + key: ${{ matrix.tag.version }}-${{ matrix.model }} + + - name: Restore Cached (releases) + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + run: | + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.00 || true + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.01 || true + cat ${{ matrix.model }}.tar.* | tar -xf - || true + rm -rf ${{ matrix.model }}.tar.* || true + cache_size=$(du -sb .ccache | awk '{print $1}') + cache_size_mb=$(echo "scale=0; ${cache_size} / (1024 * 1024)" | bc) + echo "Cache Size: ~${cache_size_mb} MB (${cache_size} B)" + echo "Cache restored successfully" + echo "Cache restored from key: ${{ matrix.model }}" + + - name: Compile OpenWrt + id: compile + continue-on-error: true + working-directory: /builder + env: + git_password: ${{ secrets.ftp_password }} + private_url: ${{ secrets.private_url }} + run: | + [ "${{ matrix.model }}" != "netgear_r8500" ] && export KERNEL_CLANG_LTO=y + export BUILD_FAST=y ENABLE_CCACHE=y ENABLE_OTA=y ENABLE_BPF=y ENABLE_LTO=y ENABLE_LRNG=y USE_GCC15=y ENABLE_MOLD=y + bash <(curl -sS ${{ secrets.script_url_general }}) ${{ matrix.tag.type }} ${{ matrix.model }} + cd openwrt + tags=$(git describe --abbrev=0 --tags) + echo "latest_release=$tags" >>$GITHUB_ENV + + - name: Extensive logs after a failed compilation + if: steps.compile.outcome == 'failure' + working-directory: /builder + run: | + cd openwrt + make V=s IGNORE_ERRORS="n m" + + - name: Prepare Firmware Files + working-directory: /builder + run: | + mkdir -p rom info + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "x86_64" ]; then + cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + cp -a openwrt/bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk rom/ + cp -a openwrt/bin/targets/bcm53xx/generic/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/bcm53xx/generic/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "armv8" ]; then + tar zcf rom/u-boot-qemu_armv8.tar.gz -C openwrt/bin/targets/armsr/armv8*/ ./u-boot-qemu_armv8 + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-initramfs-kernel.bin rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-kernel.bin rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + fi + cd .. + tar zcf rom/buildinfo_${{ matrix.model }}.tar.gz info + + - name: Create virtual machine images + if: ${{ matrix.model == 'x86_64' }} + working-directory: /builder + run: | + mkdir -p virtual_images + cp -a openwrt/bin/targets/x86/*/*-generic-squashfs-combined-efi.img.gz virtual_images/ + gzip -dq virtual_images/*-generic-squashfs-combined-efi.img.gz || true + cd virtual_images + image_name=$(basename -s .img *.img) + qemu-img convert -f raw -O qcow2 *.img $image_name.qcow2 + qemu-img convert -f raw -O vpc *.img $image_name.vhd + qemu-img convert -f raw -O vmdk *.img $image_name.vmdk + rm -f *.img + sha256sum * > sha256sums.txt + echo "

x86_64 虚拟机平台镜像

" > README.md + + - name: Create release + uses: ncipollo/release-action@v1.14.0 + with: + name: OpenWrt-${{ env.latest_release }} + allowUpdates: true + tag: ${{ env.latest_release }} + commit: main + replacesArtifacts: true + token: ${{ secrets.workflow_token }} + artifacts: | + ${{ env.build_dir }}/rom/* + + - name: Install aliyunpan & login + if: ${{ matrix.model != 'armv8' }} + continue-on-error: true + working-directory: /builder + timeout-minutes: 1 + run: | + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + device_id=${{ secrets.device_id_r4s }} + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + device_id=${{ secrets.device_id_r5s }} + elif [ "${{ matrix.model }}" = "x86_64" ]; then + device_id=${{ secrets.device_id_x86 }} + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + device_id=${{ secrets.device_id_netgear }} + fi + sudo wget -q ${{ secrets.aliyunpan_go }} -O /bin/aliyunpan + sudo chmod 0755 /bin/aliyunpan + sudo sh -c 'echo "${{ secrets.aliyunpan_us_node }} api.alipan.com auth.alipan.com www.alipan.com" >> /etc/hosts' + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + aliyun_token=`curl -s ${{ secrets.aliyun_token }} | openssl enc -aes-256-cfb -pbkdf2 -a -d -k ${{ secrets.token_dec }}` + aliyunpan config set -device_id=$device_id >/dev/null 2>&1 + echo + echo $aliyun_token | aliyunpan login + + - name: Upload Firmware - releases + if: ${{ matrix.model != 'armv8' }} + id: upload + continue-on-error: true + working-directory: /builder + timeout-minutes: 40 + run: | + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + version=$(cat openwrt/version.txt) + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + aliyunpan upload --timeout 20 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r4s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/manifest.txt openwrt/nanopi-r4s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r4s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r4s-ext4-sysupgrade.img.gz openwrt/nanopi-r4s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r4s-squashfs-sysupgrade.img.gz openwrt/nanopi-r4s/releases/${{ matrix.tag.version }}/$version/ + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + aliyunpan upload --timeout 20 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/manifest.txt openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r5c-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r5c-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r5s-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*-r5s-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/releases/${{ matrix.tag.version }}/$version/ + elif [ "${{ matrix.model }}" = "x86_64" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-generic-rootfs.tar.gz openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-ext4-combined-efi.img.gz openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-squashfs-combined-efi.img.gz openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/ + # virtual machine images + aliyunpan upload --timeout 30 --retry 10 --ow virtual_images/README.md openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/virtual_machine_images/ + aliyunpan upload --timeout 30 --retry 10 --ow virtual_images/sha256sums.txt openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/virtual_machine_images/ + aliyunpan upload --timeout 30 --retry 10 --ow virtual_images/*.vmdk openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/virtual_machine_images/ + aliyunpan upload --timeout 30 --retry 10 --ow virtual_images/*.vhd openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/virtual_machine_images/ + aliyunpan upload --timeout 30 --retry 10 --ow virtual_images/*.qcow2 openwrt/x86_64/releases/${{ matrix.tag.version }}/$version/virtual_machine_images/ + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + aliyunpan upload --timeout 20 --retry 10 --ow info/config.buildinfo openwrt/netgear-r8500/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/manifest.txt openwrt/netgear-r8500/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow info/sha256sums.txt openwrt/netgear-r8500/releases/${{ matrix.tag.version }}/$version/ + aliyunpan upload --timeout 20 --retry 10 --ow rom/*.chk openwrt/netgear-r8500/releases/${{ matrix.tag.version }}/$version/ + fi + aliyunpan recycle delete -all + echo y | aliyunpan logout + + - name: Retry Upload Firmware - releases + if: steps.upload.outcome == 'failure' + run: | + sshpass -p ${{ secrets.user_password }} ssh -o StrictHostKeyChecking=no root@${{ secrets.ftp_address }} >/dev/null 2>&1 + sshpass -p ${{ secrets.user_password }} ssh root@${{ secrets.ftp_address }} "/opt/sbin/fw-upload ${{ matrix.model }}" + + - name: Release OTA + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + username: openwrt + server: ${{ secrets.ftp_address }} + password: ${{ secrets.ftp_password }} + server-dir: release/${{ matrix.model }}/ + local-dir: ${{ env.build_dir }}/openwrt/ota/ + dangerous-clean-slate: true diff --git a/.github/workflows/build-snapshots.yml b/.github/workflows/build-snapshots.yml new file mode 100644 index 0000000..69eb082 --- /dev/null +++ b/.github/workflows/build-snapshots.yml @@ -0,0 +1,264 @@ +name: Build SNAPSHOT + +on: + workflow_dispatch: + schedule: + - cron: 0 16 * * * + +jobs: + build: + name: Build ${{ matrix.model }}-${{ matrix.tag.version }} + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - armv8 + - nanopi-r4s + - nanopi-r5s + - x86_64 + - netgear_r8500 + tag: + - type: dev + version: openwrt-24.10 + + steps: + - name: Setup variables + run: | + sudo timedatectl set-timezone 'Asia/Shanghai' + git config --global user.name 'actions' + git config --global user.email 'action@github.com' + echo build_dir="/builder" >> "$GITHUB_ENV" + + - name: Show system + run: | + echo -e "\n\e[1;32mCPU:\e[0m" + echo "$(grep 'model name' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}') ($(grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}')MHz) x $(grep processor /proc/cpuinfo | wc -l)" + echo -e "\n\e[1;32mMemory:\e[0m" + free -h + echo -e "\n\e[1;32mStorage:\e[0m" + df -Th / /mnt + echo -e "\n\e[1;32mSystem:\e[0m" + lsb_release -a + echo -e "\n\e[1;32mKernel:\e[0m" + uname -a + echo + + - name: Free disk space + uses: sbwml/actions@free-disk + with: + build-mount-path: /builder + + - name: Build System Setup + uses: sbwml/actions@openwrt-build-setup + + - name: Install LLVM + uses: sbwml/actions@install-llvm + + - name: Restore Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + uses: actions/cache/restore@v4 + with: + path: /builder/.ccache + key: ${{ matrix.tag.version }}-${{ matrix.model }} + + - name: Restore Cached (releases) + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + run: | + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.00 || true + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.01 || true + cat ${{ matrix.model }}.tar.* | tar -xf - || true + rm -rf ${{ matrix.model }}.tar.* || true + cache_size=$(du -sb .ccache | awk '{print $1}') + cache_size_mb=$(echo "scale=0; ${cache_size} / (1024 * 1024)" | bc) + echo "Cache Size: ~${cache_size_mb} MB (${cache_size} B)" + echo "Cache restored successfully" + echo "Cache restored from key: ${{ matrix.model }}" + + - name: Compile OpenWrt + id: compile + continue-on-error: true + working-directory: /builder + env: + git_password: ${{ secrets.ftp_password }} + private_url: ${{ secrets.private_url }} + run: | + [ "${{ matrix.model }}" != "netgear_r8500" ] && export KERNEL_CLANG_LTO=y + export BUILD_FAST=y ENABLE_CCACHE=y ENABLE_BPF=y ENABLE_LTO=y ENABLE_LRNG=y USE_GCC15=y ENABLE_MOLD=y + bash <(curl -sS ${{ secrets.script_url_general }}) ${{ matrix.tag.type }} ${{ matrix.model }} + build_date=$(date "+%Y-%m-%d") + echo "build_date=$build_date" >> $GITHUB_ENV + + - name: Extensive logs after a failed compilation + if: steps.compile.outcome == 'failure' + working-directory: /builder + run: | + cd openwrt + make V=s IGNORE_ERRORS="n m" + + - name: Delete Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + run: | + gh cache delete ${{ matrix.tag.version }}-${{ matrix.model }} || true + + - name: Save Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + uses: actions/cache/save@v4 + with: + path: /builder/.ccache + key: ${{ matrix.tag.version }}-${{ matrix.model }} + + - name: Create Ccache tar files + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + run: | + mkdir -p ccache + tar cf - .ccache | split -d -b 1800m - ccache/${{ matrix.model }}.tar. + + - name: Save Cached (releases) + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + uses: ncipollo/release-action@v1.14.0 + with: + name: ccache + allowUpdates: true + tag: ccache + commit: main + replacesArtifacts: true + prerelease: true + token: ${{ secrets.workflow_token }} + artifacts: | + ${{ env.build_dir }}/ccache/* + + - name: Assemble Artifact + working-directory: /builder + run: | + mkdir -p rom info + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "x86_64" ]; then + cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + cp -a openwrt/bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk rom/ + cp -a openwrt/bin/targets/bcm53xx/generic/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/bcm53xx/generic/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "armv8" ]; then + tar zcf rom/u-boot-qemu_armv8.tar.gz -C openwrt/bin/targets/armsr/armv8*/ ./u-boot-qemu_armv8 + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-initramfs-kernel.bin rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-kernel.bin rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + fi + echo current_hour="$(date +'%H')" >> "$GITHUB_ENV" + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.build_date }}-${{ matrix.model }}-${{ matrix.tag.version }} + path: ${{ env.build_dir }}/rom/*.* + + - name: Install aliyunpan & login + if: ${{ matrix.model != 'armv8' && env.current_hour >= '0' && env.current_hour <= '10' }} + working-directory: /builder + continue-on-error: true + run: | + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + device_id=${{ secrets.device_id_r4s_dev }} + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + device_id=${{ secrets.device_id_r5s_dev }} + elif [ "${{ matrix.model }}" = "x86_64" ]; then + device_id=${{ secrets.device_id_x86_dev }} + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + device_id=${{ secrets.device_id_netgear_dev }} + fi + sudo wget -q ${{ secrets.aliyunpan_go }} -O /bin/aliyunpan + sudo chmod 0755 /bin/aliyunpan + sudo sh -c 'echo "${{ secrets.aliyunpan_us_node }} api.alipan.com auth.alipan.com www.alipan.com" >> /etc/hosts' + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + aliyun_token=`curl -s ${{ secrets.aliyun_token }} | openssl enc -aes-256-cfb -pbkdf2 -a -d -k ${{ secrets.token_dec }}` + aliyunpan config set -device_id=$device_id >/dev/null 2>&1 + echo + echo $aliyun_token | aliyunpan login + + - name: Upload Firmware - snapshots + if: ${{ matrix.model != 'armv8' && env.current_hour >= '0' && env.current_hour <= '10' }} + working-directory: /builder + timeout-minutes: 20 + continue-on-error: true + run: | + export ALIYUNPAN_CONFIG_DIR="$(pwd)/.aliyunpan" + DATE=$(date "+%Y-%m-%d") + branch=24.10-SNAPSHOT + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r4s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/nanopi-r4s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r4s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r4s-ext4-sysupgrade.img.gz openwrt/nanopi-r4s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r4s-squashfs-sysupgrade.img.gz openwrt/nanopi-r4s/snapshots/$branch/$DATE/ + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5c-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5c-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5s-ext4-sysupgrade.img.gz openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-r5s-squashfs-sysupgrade.img.gz openwrt/nanopi-r5s/snapshots/$branch/$DATE/ + elif [ "${{ matrix.model }}" = "x86_64" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/x86_64/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/x86_64/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/x86_64/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-generic-rootfs.tar.gz openwrt/x86_64/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-ext4-combined-efi.img.gz openwrt/x86_64/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*-squashfs-combined-efi.img.gz openwrt/x86_64/snapshots/$branch/$DATE/ + elif [ "${{ matrix.model }}" = "netgear_r8500" ]; then + aliyunpan upload --timeout 30 --retry 10 --ow info/config.buildinfo openwrt/netgear-r8500/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/manifest.txt openwrt/netgear-r8500/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow info/sha256sums.txt openwrt/netgear-r8500/snapshots/$branch/$DATE/ + aliyunpan upload --timeout 30 --retry 10 --ow rom/*.chk openwrt/netgear-r8500/snapshots/$branch/$DATE/ + fi + aliyunpan recycle delete -all + echo y | aliyunpan logout + + - name: Copy build info + working-directory: /builder + run: | + cp -a info/* rom/ + + - name: Upload Firmware - FTP + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + dangerous-clean-slate: true + username: snapshot + server: ${{ secrets.ftp_address }} + password: ${{ secrets.ftp_password }} + server-dir: ${{ matrix.model }}/ + local-dir: ${{ env.build_dir }}/rom/ diff --git a/.github/workflows/openwrt-core.yml b/.github/workflows/openwrt-core.yml new file mode 100644 index 0000000..8c3cb4f --- /dev/null +++ b/.github/workflows/openwrt-core.yml @@ -0,0 +1,123 @@ +name: Build OpenWrt Core + +on: + workflow_dispatch: + +jobs: + build: + name: Build ${{ matrix.model }} Core + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - armv8 + - nanopi-r5s + - x86_64 + - netgear_r8500 + tag: + - type: rc2 + version: openwrt-24.10 + + steps: + - name: Setup variables + run: | + sudo timedatectl set-timezone 'Asia/Shanghai' + git config --global user.name 'actions' + git config --global user.email 'action@github.com' + echo build_dir="/builder" >> "$GITHUB_ENV" + + - name: Show system + run: | + echo -e "\n\e[1;32mCPU:\e[0m" + echo "$(grep 'model name' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}') ($(grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F ': ' '{print $2}')MHz) x $(grep processor /proc/cpuinfo | wc -l)" + echo -e "\n\e[1;32mMemory:\e[0m" + free -h + echo -e "\n\e[1;32mStorage:\e[0m" + df -Th / /mnt + echo -e "\n\e[1;32mSystem:\e[0m" + lsb_release -a + echo -e "\n\e[1;32mKernel:\e[0m" + uname -a + echo + + - name: Free disk space + uses: sbwml/actions@free-disk + with: + build-mount-path: /builder + + - name: Build System Setup + uses: sbwml/actions@openwrt-build-setup + + - name: Install LLVM + uses: sbwml/actions@install-llvm + + - name: Restore Cached + if: ${{ matrix.model != 'armv8' && matrix.model != 'nanopi-r4s' }} + uses: actions/cache/restore@v4 + with: + path: /builder/.ccache + key: ${{ matrix.tag.version }}-${{ matrix.model }} + + - name: Restore Cached (releases) + if: ${{ matrix.model == 'armv8' || matrix.model == 'nanopi-r4s' }} + continue-on-error: true + working-directory: /builder + run: | + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.00 || true + wget -q https://github.com/${{ github.repository }}/releases/download/ccache/${{ matrix.model }}.tar.01 || true + cat ${{ matrix.model }}.tar.* | tar -xf - || true + rm -rf ${{ matrix.model }}.tar.* || true + cache_size=$(du -sb .ccache | awk '{print $1}') + cache_size_mb=$(echo "scale=0; ${cache_size} / (1024 * 1024)" | bc) + echo "Cache Size: ~${cache_size_mb} MB (${cache_size} B)" + echo "Cache restored successfully" + echo "Cache restored from key: ${{ matrix.model }}" + + - name: Compile OpenWrt + id: compile + continue-on-error: true + working-directory: /builder + env: + git_password: ${{ secrets.ftp_password }} + run: | + [ "${{ matrix.model }}" != "netgear_r8500" ] && export KERNEL_CLANG_LTO=y ENABLE_DPDK=y + export BUILD_FAST=y ENABLE_CCACHE=y ENABLE_OTA=y ENABLE_BPF=y ENABLE_LTO=y ENABLE_LRNG=y USE_GCC15=y ENABLE_MOLD=y MINIMAL_BUILD=y OPENWRT_CORE=y + bash <(curl -sS ${{ secrets.script_url_general }}) ${{ matrix.tag.type }} ${{ matrix.model }} + + - name: Extensive logs after a failed compilation + if: steps.compile.outcome == 'failure' + working-directory: /builder + run: | + cd openwrt + make V=s IGNORE_ERRORS="n m" + + - name: Prepare files + working-directory: /builder + run: | + base_name=$(basename ${{ env.build_dir }}/openwrt/*-*.tar.gz) + kmod_name=$(echo $base_name | sed 's/~/-/g') + mv ${{ env.build_dir }}/openwrt/*-*.tar.gz ${{ env.build_dir }}/openwrt/$kmod_name + + - name: Release kernel modules + uses: ncipollo/release-action@v1.14.0 + with: + name: kmod-snapshot + allowUpdates: true + prerelease: true + tag: snapshot + commit: main + replacesArtifacts: true + token: ${{ secrets.workflow_token }} + artifacts: | + ${{ env.build_dir }}/openwrt/*-*.tar.gz + + - name: Sync kernel modules + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.workflow_token }} + repository: sbwml/openwrt_core + event-type: sync diff --git a/README.md b/README.md new file mode 100644 index 0000000..fe8ca66 --- /dev/null +++ b/README.md @@ -0,0 +1,284 @@ +

+ +

+ +

OpenWrt for FriendlyElec NanoPi R4S / R5S & X86_64 & Netgear R8500

+ +

+ +

+ +

+ 基于原生 OpenWrt 更改与优化的固件,提供高效、稳定的使用体验! +

+ +------- + +## 固件下载 + +**NanoPi R4S: https://r4s.cooluc.com** + +**NanoPi R5S: https://r5s.cooluc.com** + +**X86_64: https://x86.cooluc.com** + +**Netgear R8500: https://r8500.cooluc.com** + +**24.10-SNAPSHOT: https://snapshot.cooluc.com** + +## 版本信息 + +**[Releases](https://r5s.cooluc.com/releases):正式版 - 基于 [OpenWrt](https://github.com/openwrt/openwrt/releases) 最新 Releases 源代码和软件包编译(推荐) - [Linux 6.12 LTS](https://kernel.org/)** + +**[Snapshots](https://r5s.cooluc.com/snapshots):开发版 - 基于 [OpenWrt](https://github.com/openwrt/openwrt/tree/openwrt-24.10) 最新 openwrt-24.10 分支源代码和软件包编译 - [Linux 6.12 LTS](https://kernel.org/)(每夜构建)** + +**[Minimal](https://r5s.cooluc.com/minimal):轻量版 - 基于 [OpenWrt](https://github.com/openwrt/openwrt/releases) 最新 Releases 源代码和软件包编译,无内置插件(不推荐) - [Linux 6.12 LTS](https://kernel.org/)** + +------ + +## 默认信息 + +- **管理地址:[http://10.0.0.1](http://10.0.0.1) 或 [http://openwrt.lan](http://openwrt.lan)** +- **账户:root** +- **密码:无** + +------ + +## 基本状况 + +| 基本 | 状态 | 基本 | 状态 | +|:-------------------------------------------------:|:----:|:----------------------------:|:----:| +| kmod 内核模块安装 | ✅ | 全锥型 NAT(NFT、BCM 双方案)| ✅ | +| SS AES 硬件加速 | ✅ | 构建优化(O3、LTO) | ✅ | +| GPU 硬件加速 | ✅ | 内核/模块 优化(Clang/LLVM full-LTO) | ✅ | +| HDMI 终端输出 | ✅ | 在线 OTA 升级(squashfs) | ✅ | +| RTC 时钟 (HYM8563) | ✅ | 固件重置(squashfs) | ✅ | +| BBRv3 拥塞控制 | ✅ | LLVM-BPF 支持 | ✅ | +| TCP Brutal 拥塞控制 | ✅ | Shortcut-FE(支持 UDP 入站) | ✅ | +| KVM 虚拟化支持 | ✅ | LRNG 随机数(v57) | ✅ | +| NGINX & CURL HTTP3/QUIC 支持 | ✅ | PWM 风扇控制 | ✅ | + + +| 内置插件 | 状态 | 内置插件 | 状态 | +|:------------------------:|:----:|:----------------:|:----:| +| PassWall | ✅ | Docker | ✅ | +| HomeProxy | ✅ | TTY 终端 | ✅ | +| FileBrowser | ✅ | NetData 监控 | ✅ | +| qBittorrent | ✅ | DiskMan 磁盘管理 | ✅ | +| MosDNS | ✅ | CPU 性能调节 | ✅ | +| 动态 DNS | ✅ | SQM 列队管理 | ✅ | +| Watchcat | ✅ | nlbw 宽带监控 | ✅ | +| KMS 服务器 | ✅ | Socat | ✅ | +| FRP 客户端 | ✅ | 应用过滤 | ✅ | +| 网络唤醒 | ✅ | 访问控制 | ✅ | +| 网络共享(Samba) | ✅ | UPnP | ✅ | +| 锐捷认证 | ✅ | IP 限速 | ✅ | +| Aria2 | ✅ | WireGuard | ✅ | +| Alist 文件列表 | ✅ | L2TP | ✅ | +| USB 打印服务器 | ✅ | ZeroTier | ✅ | +| 隔空播放(AirConnect) | ✅ | WebDav | ✅ | +| 自定义命令 | ✅ | AirPlay 2 | ✅ | +| 网速测试 | ✅ | NATMap | ✅ | + +✅ 可用 + +❌ 不可用 + +⏳ 计划中 + +特别说明: + +* *AirPlay 2:一款简单易用的 AirPlay 音频播放器,需要外接 USB 声卡使用。* + +
+LuCI 菜单概览 +
+├── 状态 + ├── 概览
+ ├── 路由
+ ├── 防火墙
+ ├── 系统日志
+ ├── 系统进程
+ ├── 实时信息
+ ├── WireGuard
+ └── 释放内存 +
+
+├── 系统 + ├── 系统
+ ├── 管理权
+ ├── 软件包
+ ├── 启动项
+ ├── 计划任务
+ ├── 挂载点
+ ├── 终端
+ ├── 磁盘管理
+ ├── LED 配置
+ ├── 在线升级
+ ├── 备份/升级
+ ├── 自定义命令
+ ├── 文件管理器
+ ├── 定时重启
+ ├── 主题设置
+ ├── CPU 性能调节
+ └── 重启 +
+
+├── 服务 + ├── PassWall
+ ├── HomeProxy
+ ├── qBittorrent
+ ├── MosDNS
+ ├── 动态 DNS
+ ├── Watchcat
+ ├── KMS 服务器
+ ├── 隔空播放
+ ├── AirPlay 2 播放器
+ ├── Aria2
+ ├── FRP 客户端
+ ├── 锐捷认证
+ ├── NATMap
+ ├── 网络共享
+ ├── 网络唤醒
+ └── ZeroTier +
+
+├── Docker + ├── 概览
+ ├── 容器
+ ├── 镜像
+ ├── 网络
+ ├── 卷标
+ ├── 事件
+ └── 配置 +
+
+├── 网络存储 + ├── Alist 文件列表
+ ├── USB 打印服务器
+ └── WebDav +
+
+├── 网络 + ├── 接口
+ ├── 路由
+ ├── DHCP/DNS
+ ├── 网络诊断
+ ├── 网速测试
+ ├── SQM 队列管理
+ ├── 防火墙
+ ├── UPnP
+ ├── 带宽监控
+ ├── 应用过滤
+ ├── Socat
+ └── 网速控制 +
+ └── 退出 +
+ +------ + +## 固件格式 + +**固件分为两个文件系统,[SquashFS](https://zh.wikipedia.org/wiki/SquashFS) 和 [Ext4](https://zh.wikipedia.org/wiki/Ext4)。** + +**SquashFS(推荐):固件文件名带有 “squashfs”,SquashFS 为只读文件系统,支持系统重置,更能避免 SD 卡文件系统触发写保护,支持在线 OTA 升级,适合绝大部分用户使用。** + +**Ext4:固件文件名带有 “ext4”,Ext4 文件系统具备整个分区可读写性质,更适合熟悉 Linux 系统的用户使用,但意外断电有几率造成分区写入保护。** + + +------ + +## NanoPi R4S/R5S 固件烧写(SD) + +**推荐工具:** + +**SD卡容量:2GB 或更多** + +*固件文件无需解压,直接使用工具写入 microSD 卡* + +------ + +## 固件烧写(NanoPi R5S eMMC) + +### 准备工具 + +- **电脑(Windows),其它操作系统自行搜索相关工具** +- **数据线:USB-A to USB-A 或 Type-C to USB-A** +- **瑞芯微开发工具:**RKDevTool_Release_v2.84.zip + +- **Mask 设备驱动:**DriverAssitant_v5.1.1.zip + +### 准备固件 + +- **下载固件文件,并解压出 .img** + +### 操作过程 + +- **安装 Mask 设备驱动** + +- **Mask 模式连接电脑(R5S 断电状态下,取下 SD 卡,使用数据线连接电脑。长按 “Mask” 按钮,接通 R5S 电源直至电脑发现新设备后释放 “Mask” 按钮)** + + + + + +- **打开 瑞芯微开发工具:正常状态:(发现一个Maskrom设备) 缺少驱动:(没有发现设备)** + + **安装步骤:** + + **① 点击 “system” 路径选择按钮(选择 zip 解压出来的 IMG 文件)** + + + + + + **② 点击 “执行”(固件写入完成后会自动重启进入 OpenWrt 系统)** + + + +- ***注意:通过电脑烧写固件请使用本站下载的 [瑞芯微开发工具](https://media.cooluc.com/%E8%BD%AF%E4%BB%B6/RKDevTool/RKDevTool_Release_v2.84.zip)。*** + +------ + +## 固件烧写(SD to eMMC) + +```shell +# 1、下载最新 Releases 固件并通过 SD 卡启动 +# 2、使用 Xftp 等工具上传一份固件到 /tmp 目录,或通过终端 wget 在线下载固件到 /tmp 目录 + +# 3、使用内建命令写入固件到 eMMC 存储(请根据实际文件名称与路径) + +emmc-install /tmp/openwrt-24.10.0-rockchip-armv8-friendlyarm_nanopi-r5s-squashfs-sysupgrade.img.gz + +``` + +**固件写入完成后,取下 SD 卡,手动断电重启即可完成。** + +------ + +## RTC 硬件时钟(HYM8563) + +**本固件支持 RTC 硬件时钟读取/同步,当设备断电时,重新通电启动系统时间不会错乱** *(注意:设备需要安装 RTC 电池后使用)* + +**首次安装 RTC 电池写入时间命令** + +```shell +hwclock -w -f /dev/rtc1 +``` + +**测试时间读取(返回当前时间表示正常)** + +```shell +hwclock -f /dev/rtc1 +``` + +------ + +## 开源地址 + +**构建脚本:** [https://init2.cooluc.com](https://init2.cooluc.com) + +**构建脚本(存档):** [https://github.com/sbwml/r4s_build_script](https://github.com/sbwml/r4s_build_script) + +**构建来源:** [https://github.com/sbwml/builder](https://github.com/sbwml/builder)