├── .github └── workflows │ ├── build.yml │ ├── dispatch.yml │ └── update-checker.yml ├── LICENSE ├── README-EN.md ├── README.md └── build ├── N1 ├── config │ ├── .config.N1.old │ └── config.buildinfo ├── diy-after.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── ipk.sh │ │ ├── kodexplorer.sh │ │ └── openclash.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── README.md ├── RaspberryPi3 ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── RaspberryPi4 ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── common ├── cache.sh ├── common.buildinfo ├── convert_translation.sh ├── delete.list ├── disable.buildinfo ├── diy.sh ├── docker.buildinfo ├── env.sh ├── fix-feeds.sh ├── imageBuilder-run.sh ├── scripts │ ├── custom.sh │ └── start_set_matrix.sh ├── small.buildinfo ├── upload_docker_img.sh └── zzz-default-settings.sh ├── doornet2 ├── README.md ├── config │ ├── config.buildinfo │ └── disable.buldinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── h68k ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── k2p ├── README.md ├── config │ └── config.buildinfo ├── diy-after-compile.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── k3 ├── README.md ├── config │ └── config.buildinfo ├── diy-after-compile.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── neo3 ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── r1s-h3 ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── r1s-h5 ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── r2s ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── r4s ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── r5s ├── README.md ├── config │ ├── config.buildinfo │ └── last.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts │ ├── files │ │ ├── adh.sh │ │ ├── cpufreq.sh │ │ ├── ipk.sh │ │ ├── openclash.sh │ │ ├── pwmfan.sh │ │ └── udp2raw.sh │ └── uci-defaults │ │ └── zzz-default-settings.sh └── set_matrix.sh ├── scripts └── update.sh ├── sft1200 ├── clone.sh ├── clone.sh.old ├── config │ └── config.buildinfo ├── diy-after-compile.sh ├── diy-part2.sh ├── diy-part2.sh.old ├── env.sh └── set_matrix.sh └── x86_64 ├── config └── config.buildinfo ├── diy-after.sh ├── diy-beforeMakeImage.sh ├── diy-part1.sh ├── diy-part2.sh ├── env.sh ├── scripts ├── files │ ├── adh.sh │ ├── ipk.sh │ ├── kodexplorer.sh │ ├── openclash.sh │ └── udp2raw.sh └── uci-defaults │ └── zzz-default-settings.sh └── set_matrix.sh /.github/workflows/dispatch.yml: -------------------------------------------------------------------------------- 1 | name: Repo Dispatcher 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | target: 6 | description: 'dev1,dev2' 7 | required: false 8 | default: 'x86_64' 9 | 10 | jobs: 11 | set_matrix: 12 | runs-on: ubuntu-latest 13 | outputs: 14 | device: ${{ steps.set_matrix.outputs.matrix }} 15 | #event_inputs_json: ${{ steps.set_matrix.outputs.matrix }} 16 | name: "set matrix for: ${{ github.event.inputs.target }}" 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@main 20 | - name: prinf info 21 | id: set_matrix 22 | run: | 23 | if [ -z "${{ github.event.inputs.target }}" ];then 24 | matrix=$(find build/ -maxdepth 2 -type f -name set_matrix.sh | awk -F/ '{print $2}' | paste -s - -d ',') 25 | else 26 | matrix=${{ github.event.inputs.target }} 27 | fi 28 | echo '::set-output name=matrix::["'${matrix}'"]' 29 | echo 'name=matrix: ["'${matrix}'"]' 30 | build: 31 | runs-on: ubuntu-latest 32 | needs: set_matrix 33 | strategy: 34 | fail-fast: false 35 | matrix: 36 | device: ${{ fromJson(needs.set_matrix.outputs.device) }} 37 | steps: 38 | - name: Trigger Compile 39 | run: | 40 | branch=${GITHUB_REF##*/}; 41 | curl \ 42 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ 43 | -H "Accept: application/vnd.github.everest-preview+json" \ 44 | -H "Authorization: token ${{ secrets.gh_token }}" \ 45 | -d '{ 46 | "event_type":"build ${{ matrix.device }}", 47 | "client_payload":{ 48 | "branch":"'$branch'", 49 | "device":"${{ matrix.device }}" 50 | } 51 | }' 52 | -------------------------------------------------------------------------------- /.github/workflows/update-checker.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2021 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # File: .github/workflows/update-checker.yml 9 | # Description: Source code update checker 10 | # 11 | 12 | name: Update Checker 13 | 14 | env: 15 | REPO_URL: https://github.com/coolsnowwolf/lede 16 | REPO_BRANCH: master 17 | 18 | on: 19 | workflow_dispatch: 20 | # schedule: 21 | # - cron: 0 */18 * * * 22 | 23 | jobs: 24 | check: 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | 29 | - name: Get Commit Hash 30 | id: getHash 31 | run: | 32 | git clone --depth 1 $REPO_URL -b $REPO_BRANCH . 33 | echo "::set-output name=commitHash::$(git rev-parse HEAD)" 34 | 35 | - name: Compare Commit Hash 36 | id: cacheHash 37 | uses: actions/cache@v2 38 | with: 39 | path: .commitHash 40 | key: HEAD-${{ steps.getHash.outputs.commitHash }} 41 | 42 | - name: Save New Commit Hash 43 | if: steps.cacheHash.outputs.cache-hit != 'true' 44 | run: | 45 | echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash 46 | 47 | - name: Trigger build 48 | if: steps.cacheHash.outputs.cache-hit != 'true' 49 | uses: peter-evans/repository-dispatch@v1 50 | with: 51 | token: ${{ secrets.ACTIONS_TRIGGER_PAT }} 52 | event-type: Source Code Update 53 | 54 | - name: Delete workflow runs 55 | uses: GitRML/delete-workflow-runs@main 56 | with: 57 | retain_days: 2 58 | keep_minimum_runs: 2 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2020 P3TERX 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-EN.md: -------------------------------------------------------------------------------- 1 | **English** | [中文](https://p3terx.com/archives/build-openwrt-with-github-actions.html) 2 | 3 | # Actions-OpenWrt 4 | 5 | [![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square&label=LICENSE)](https://github.com/P3TERX/Actions-OpenWrt/blob/master/LICENSE) 6 | ![GitHub Stars](https://img.shields.io/github/stars/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Stars&logo=github) 7 | ![GitHub Forks](https://img.shields.io/github/forks/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Forks&logo=github) 8 | 9 | A template for building OpenWrt with GitHub Actions 10 | 11 | ## Usage 12 | 13 | - Click the [Use this template](https://github.com/P3TERX/Actions-OpenWrt/generate) button to create a new repository. 14 | - Generate `.config` files using [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) source code. ( You can change it through environment variables in the workflow file. ) 15 | - Push `.config` file to the GitHub repository. 16 | - Select `Build OpenWrt` on the Actions page. 17 | - Click the `Run workflow` button. 18 | - When the build is complete, click the `Artifacts` button in the upper right corner of the Actions page to download the binaries. 19 | 20 | ## Tips 21 | 22 | - It may take a long time to create a `.config` file and build the OpenWrt firmware. Thus, before create repository to build your own firmware, you may check out if others have already built it which meet your needs by simply [search `Actions-Openwrt` in GitHub](https://github.com/search?q=Actions-openwrt). 23 | - Add some meta info of your built firmware (such as firmware architecture and installed packages) to your repository introduction, this will save others' time. 24 | 25 | ## Credits 26 | 27 | - [Microsoft Azure](https://azure.microsoft.com) 28 | - [GitHub Actions](https://github.com/features/actions) 29 | - [OpenWrt](https://github.com/openwrt/openwrt) 30 | - [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) 31 | - [tmate](https://github.com/tmate-io/tmate) 32 | - [mxschmitt/action-tmate](https://github.com/mxschmitt/action-tmate) 33 | - [csexton/debugger-action](https://github.com/csexton/debugger-action) 34 | - [Cowtransfer](https://cowtransfer.com) 35 | - [WeTransfer](https://wetransfer.com/) 36 | - [Mikubill/transfer](https://github.com/Mikubill/transfer) 37 | - [softprops/action-gh-release](https://github.com/softprops/action-gh-release) 38 | - [ActionsRML/delete-workflow-runs](https://github.com/ActionsRML/delete-workflow-runs) 39 | - [dev-drprasad/delete-older-releases](https://github.com/dev-drprasad/delete-older-releases) 40 | - [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) 41 | 42 | ## License 43 | 44 | [MIT](https://github.com/P3TERX/Actions-OpenWrt/blob/main/LICENSE) © [**P3TERX**](https://p3terx.com) 45 | -------------------------------------------------------------------------------- /build/N1/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | oldPATH=$(pwd) 4 | 5 | sudo apt-get update && \ 6 | sudo apt-get install -y jq btrfs-progs dosfstools uuid-runtime parted gawk wget patch xz-utils 7 | 8 | git clone --depth 1 https://github.com/unifreq/openwrt_packit /opt/openwrt_packit 9 | 10 | mkdir -p /opt/kernel 11 | 12 | cp bin/targets/*/*/openwrt-armvirt-64-default-rootfs.tar.gz /opt/openwrt_packit/ 13 | 14 | if [ -n "$n1_kernal" ];then 15 | export KERNEL_VERSION=$n1_kernal 16 | fi 17 | 18 | # fix https://github.com/unifreq/openwrt_packit/issues/31 https://github.com/zhangguanzhang/Actions-OpenWrt/issues/1 19 | if [ -z "$KERNEL_VERSION" ];then 20 | grep -Po '^\s*\KKERNEL_VERSION=\S+' /opt/openwrt_packit/make.env > /tmp/make.env 21 | source /tmp/make.env 22 | DOWNLOAD_KERNEL_VERSION=$(curl -s https://api.github.com/repos/breakings/OpenWrt/git/trees/main?recursive=1 | \ 23 | jq -r '.tree[].path' | \ 24 | grep -Pom1 "^opt/kernel/${KERNEL_VERSION%%-*}/boot-\K.+?(?=.tar.gz)") 25 | if [ -n "$DOWNLOAD_KERNEL_VERSION" ];then 26 | export KERNEL_VERSION="$DOWNLOAD_KERNEL_VERSION" 27 | else 28 | kernel_num=${KERNEL_VERSION%%-*} # 5.x.x 29 | kerrnel_major=${kernel_num%.*} #5.18 30 | export KERNEL_VERSION=$(curl -s https://api.github.com/repos/breakings/OpenWrt/git/trees/main?recursive=1 | \ 31 | jq -r '.tree[].path' | \ 32 | grep -Pom1 "^opt/kernel/${kerrnel_major}\.\d+/boot-\K.+?(?=.tar.gz)" ) 33 | fi 34 | fi 35 | # 下面的 mk_s905d_n1.sh 里会执行 source 它 36 | #source /opt/openwrt_packit/make.env 37 | 38 | export kernel_URL=https://raw.githubusercontent.com/breakings/OpenWrt/main/opt/kernel 39 | 40 | export kernel_VER=${KERNEL_VERSION%%-*} # 5.13.13 41 | export KERNEL_VERSION=$KERNEL_VERSION 42 | # KERNEL_VERSION="5.13.13-flippy-63+" 43 | ( 44 | cd /opt/kernel/ 45 | wget ${kernel_URL}/${kernel_VER}/boot-${KERNEL_VERSION}.tar.gz 46 | wget ${kernel_URL}/${kernel_VER}/dtb-allwinner-${KERNEL_VERSION}.tar.gz 47 | wget ${kernel_URL}/${kernel_VER}/dtb-amlogic-${KERNEL_VERSION}.tar.gz 48 | wget ${kernel_URL}/${kernel_VER}/dtb-rockchip-${KERNEL_VERSION}.tar.gz 49 | wget ${kernel_URL}/${kernel_VER}/modules-${KERNEL_VERSION}.tar.gz 50 | cd /opt/openwrt_packit 51 | export ENABLE_WIFI_K510=1 52 | sudo -E ./mk_s905d_n1.sh 53 | find -type f -size +100M -name 'openwrt*.img' -exec mv {} /opt/openwrt_packit/tmp/ \; 54 | ) 55 | 56 | mv bin/targets/*/*/config.buildinfo /opt/openwrt_packit/tmp/ 57 | 58 | rm -f bin/targets/*/*/* 59 | mv /opt/openwrt_packit/tmp/* bin/targets/*/*/ 60 | ls -lh bin/targets/*/*/ 61 | 62 | 63 | # docker run -tid --name test \ 64 | # --device=/dev/loop-control:/dev/loop-control \ 65 | # --device=/dev/loop0:/dev/loop0 \ 66 | # --device=/dev/loop0p1:/dev/loop0p1 \ 67 | # --device=/dev/loop0p2:/dev/loop0p2 \ 68 | # -v $PWD/openwrt_packit:/opt/ --cap-add SYS_ADMIN ubuntu 69 | -------------------------------------------------------------------------------- /build/N1/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | #sed -i 's/192.168.1.1/192.168.100.254/g' package/base-files/files/bin/config_generate 14 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 15 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 16 | 17 | # Uncomment a feed source 18 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 19 | 20 | # Add a feed source 21 | echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 22 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 23 | 24 | 25 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 26 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 27 | 28 | 29 | # Change default shell to bash 30 | sed -i 's/\/bin\/ash/\/bin\/bash/g' package/base-files/files/etc/passwd 31 | 32 | 33 | # package/base-files/files/etc/init.d/boot 34 | # N1 安装到 emcc 打包的启动不执行初始化 35 | # install-to-emmc.sh install.sh 36 | 37 | SED_NUM=$(grep -nw 'for file in $files; do' package/base-files/files/etc/init.d/boot | cut -d: -f1) 38 | 39 | echo '\t\t[ "$file" == 99-default.sh ] && [[ -f install*sh ]] && continue ' > /tmp/sed.file 40 | sed -i "${SED_NUM}r /tmp/sed.file" package/base-files/files/etc/init.d/boot 41 | # 99-default.sh 在有写入 emcc 脚本的时候不执行 -------------------------------------------------------------------------------- /build/N1/diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part2.sh 10 | # Description: OpenWrt DIY script part 2 (After Update feeds) 11 | # 12 | 13 | # Modify default IP 14 | #sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate 15 | 16 | # Modify default theme 17 | # https://github.com/jerrykuku/luci-theme-argon/tree/18.06 18 | # https://github.com/kenzok8/openwrt-packages 19 | sed -ri 's/luci-theme-\S+/luci-theme-argonne/g' feeds/luci/collections/luci/Makefile # feeds/luci/modules/luci-base/root/etc/config/luci 20 | 21 | 22 | if [ "$repo_name" = 'lede' ];then 23 | # https://github.com/coolsnowwolf/lede/issues/10329 24 | depend_line=$(awk '/KernelPackage\/rtw88*$/{flag=1}flag{flag++}flag>0&&flag<=7&&/^\s*DEPENDS/&& $0!~"usb-core"{print NR;exit}' ./package/kernel/mac80211/realtek.mk) 25 | if [ -n "$depend_line" ];then 26 | sed -ri "${depend_line}"'s#$# +kmod-usb-core#' ./package/kernel/mac80211/realtek.mk 27 | fi 28 | fi 29 | 30 | # luci-theme-atmaterial_new 31 | # https://github.com/kenzok8/openwrt-packages 已经添加了,所以这里备用拉取 32 | if [ ! -d feeds/others/luci-theme-atmaterial_new ];then 33 | git clone -b main --depth 1 https://github.com/Chandler-Lu/openwrt-package /tmp/openwrt-package 34 | if [ -d '/tmp/openwrt-package/luci-theme-atmaterial_new' ];then 35 | mv /tmp/openwrt-package/luci-theme-atmaterial_new feeds/others/ 36 | fi 37 | fi 38 | 39 | # Fix https://github.com/coolsnowwolf/lede/issues/7770 40 | 41 | if grep -Eq '^PKG_VERSION:=4.14.6' package/feeds/packages/samba4/Makefile; then 42 | sed -ri -e '/^PKG_VERSION:=/s#4.14.6#4.13.9#' \ 43 | -e '/^PKG_HASH:=/s#:=.+#:=b97a773ed3b4dae6d5ebd3e09337c897ae898b65f38abad550f852b594d4e07f#' package/feeds/packages/samba4/Makefile 44 | fi 45 | 46 | # N1 的安装到 emcc的脚本 47 | git clone --depth 1 https://github.com/tuanqing/install-program package/install-program 48 | echo 'CONFIG_PACKAGE_install-program=y' >> .config 49 | 50 | 51 | # ----------- 提前打包一些文件,防止初次使用去下载 52 | # files下会合并到最终的 rootfs 里 53 | mkdir -p files 54 | 55 | # 初次开机设置脚本 56 | mkdir -p files/etc/uci-defaults/ 57 | cp ${GITHUB_WORKSPACE}/scripts/uci-defaults/* files/etc/uci-defaults/ 58 | chmod a+x files/etc/uci-defaults/* 59 | 60 | # 预处理下载相关文件,保证打包固件不用单独下载 61 | for sh_file in `ls ${GITHUB_WORKSPACE}/scripts/files/*.sh`;do 62 | source $sh_file 63 | done 64 | 65 | 66 | # /tmp/resolv.conf.d/resolv.conf.auto 67 | #echo nameserver 223.5.5.5 >> files/tmp/resolv.conf.d/resolv.conf.auto 68 | 69 | 70 | # ---------- end ----------- 71 | -------------------------------------------------------------------------------- /build/N1/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UdateFeeds=true 4 | InstallFeeds=true 5 | 6 | UseCache=true 7 | 8 | AutoBuildTimeOut=true 9 | 10 | MakeDownload=true 11 | ClearPkg=true 12 | -------------------------------------------------------------------------------- /build/N1/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi -------------------------------------------------------------------------------- /build/N1/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/root/ipks/ 4 | mkdir -p ${dir} 5 | local i=0 6 | while [ "$i" -le 5 ];do 7 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 8 | [ -n "$ipk_name" ] && break 9 | let i++ 10 | done 11 | wget ${mirror_url}${ipk_name} -O ${dir}${ipk_name} 12 | } 13 | 14 | # such as: download_ipk grep 15 | 16 | -------------------------------------------------------------------------------- /build/N1/scripts/files/kodexplorer.sh: -------------------------------------------------------------------------------- 1 | # kodexplorer 提前下载 2 | # 会和 apcupsd 冲突 3 | if grep -Eq '^CONFIG_PACKAGE_luci-app-kodexplorer=y' .config;then 4 | mkdir -p files/opt/kodexplorer 5 | # curl -s https://api.kodcloud.com/?app/version 6 | wget --no-check-certificate https://static.kodcloud.com/update/download/kodbox.$( 7 | curl -s https://api.github.com/repos/kalcaddle/kodbox/releases/latest | jq -r .name | cut -d " " -f 1 8 | 9 | ).zip -O /tmp/kodbox.zip 10 | unzip -q /tmp/kodbox.zip -d files/opt/kodexplorer 11 | rm -f /tmp/kodbox.zip 12 | fi -------------------------------------------------------------------------------- /build/N1/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # game 17 | wget https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 19 | rm -f /tmp/clash* 20 | 21 | chmod a+x ${CLASH_CORE_PATH}/clash* 22 | fi 23 | -------------------------------------------------------------------------------- /build/N1/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /root/ipks/*_*_*.ipk 14 | rm -f /root/ipks/*_*_*.ipk 15 | 16 | uci set aliyundrive-webdav.@server[0].enable=0 17 | uci commit aliyundrive-webdav 18 | 19 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 20 | uci commit luci 21 | # 此文件名注意ls 排序,下面也行 22 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 23 | # uci commit luci 24 | 25 | if [ -f /etc/config/qbittorrent ];then 26 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 27 | uci commit qbittorrent 28 | fi 29 | 30 | # dnsmasq 31 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 32 | uci set dhcp.@dnsmasq[0].localservice='0' 33 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 34 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 35 | uci commit dhcp 36 | 37 | 38 | uci add_list system.ntp.server=120.25.115.20 39 | uci commit system 40 | -------------------------------------------------------------------------------- /build/N1/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 下面日后适配天灵 4 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | ## 一些说明 2 | 3 | 实际上很多架构一样,可以类似 r4s 那样开 multi_profile 编译的,但是我这拆分设备,没有这样做的 4 | 5 | ``` 6 | CONFIG_TARGET_MULTI_PROFILE=y 7 | ``` -------------------------------------------------------------------------------- /build/RaspberryPi3/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://www.raspberrypi.com/products/ 4 | https://zh.m.wikipedia.org/zh/%E6%A0%91%E8%8E%93%E6%B4%BE 5 | 6 | kernel size 看刷入是使用 17M,rootfs size 为 680 时候,2022/07/26为下面情况 7 | 8 | ``` 9 | root@ImmortalWrt:~# lsblk 10 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 11 | loop0 7:0 0 248.3M 0 loop /overlay 12 | mmcblk0 179:0 0 29.7G 0 disk 13 | ├─mmcblk0p1 179:1 0 22M 0 part /boot 14 | └─mmcblk0p2 179:2 0 670M 0 part /rom 15 | root@ImmortalWrt:~# df -h 16 | Filesystem Size Used Avail Use% Mounted on 17 | /dev/root 422M 422M 0 100% /rom 18 | tmpfs 460M 68K 460M 1% /tmp 19 | /dev/loop0 247M 85M 162M 35% /overlay 20 | overlayfs:/overlay 247M 85M 162M 35% / 21 | /dev/mmcblk0p1 22M 18M 4.5M 80% /boot 22 | tmpfs 512K 0 512K 0% /dev 23 | root@ImmortalWrt:~# ls -l /local_feed/*.ipk | wc -l 24 | 1300 25 | root@ImmortalWrt:~# cat /etc/board.json 26 | { 27 | "model": { 28 | "id": "raspberrypi,3-model-b", 29 | "name": "Raspberry Pi 3 Model B Rev 1.2" 30 | }, 31 | "network": { 32 | "lan": { 33 | "ifname": "eth0", 34 | "protocol": "static" 35 | } 36 | } 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /build/RaspberryPi3/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/RaspberryPi3/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exclude_str=factory 4 | 5 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 6 | -------------------------------------------------------------------------------- /build/RaspberryPi3/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+40}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # # fi 13 | 14 | if [ "$suffix" = '-full' ];then 15 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+94}' .config ) 16 | fi 17 | 18 | if [ -n "$rootfs_size" ];then 19 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 20 | fi 21 | -------------------------------------------------------------------------------- /build/RaspberryPi3/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/RaspberryPi3/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=rpi-3 15 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/RaspberryPi3/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | uci add_list system.ntp.server=120.25.115.20 53 | uci commit system 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 90 | uci commit dhcp 91 | -------------------------------------------------------------------------------- /build/RaspberryPi3/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-18.06-k5.4","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 7 | 8 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 11 | 12 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | -------------------------------------------------------------------------------- /build/RaspberryPi4/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://www.raspberrypi.com/products/ 4 | https://zh.m.wikipedia.org/zh/%E6%A0%91%E8%8E%93%E6%B4%BE 5 | 6 | kernel size 看刷入是使用 17M,rootfs size 为 680 时候,2022/07/26为下面情况 7 | 8 | ``` 9 | root@ImmortalWrt:~# lsblk 10 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 11 | loop0 7:0 0 259.6M 0 loop /overlay 12 | mmcblk0 179:0 0 29.7G 0 disk 13 | ├─mmcblk0p1 179:1 0 22M 0 part /boot 14 | └─mmcblk0p2 179:2 0 680M 0 part /rom 15 | root@ImmortalWrt:~# df -h 16 | Filesystem Size Used Avail Use% Mounted on 17 | /dev/root 421M 421M 0 100% /rom 18 | tmpfs 930M 616K 929M 1% /tmp 19 | /dev/loop0 258M 89M 170M 35% /overlay 20 | overlayfs:/overlay 258M 89M 170M 35% / 21 | /dev/mmcblk0p1 22M 17M 5.7M 75% /boot 22 | tmpfs 512K 0 512K 0% /dev 23 | root@ImmortalWrt:~# ls -l /local_feed/*.ipk | wc -l 24 | 1291 25 | root@ImmortalWrt:~# cat /etc/board.json 26 | { 27 | "model": { 28 | "id": "raspberrypi,4-model-b", 29 | "name": "Raspberry Pi4 Model B Rev 1.2" 30 | }, 31 | "network":{ 32 | "lan":{ 33 | "ifname": "eth0", 34 | "protocol": "static" 35 | } 36 | } 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /build/RaspberryPi4/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/RaspberryPi4/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exclude_str=factory 4 | 5 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 6 | -------------------------------------------------------------------------------- /build/RaspberryPi4/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+40}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # # fi 13 | 14 | if [ "$suffix" = '-full' ];then 15 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+94}' .config ) 16 | fi 17 | 18 | if [ -n "$rootfs_size" ];then 19 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 20 | fi 21 | -------------------------------------------------------------------------------- /build/RaspberryPi4/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/RaspberryPi4/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=rpi-4 15 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/RaspberryPi4/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | uci add_list system.ntp.server=120.25.115.20 53 | uci commit system 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 90 | uci commit dhcp 91 | -------------------------------------------------------------------------------- /build/RaspberryPi4/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-18.06-k5.4","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 7 | 8 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 11 | 12 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | -------------------------------------------------------------------------------- /build/common/common.buildinfo: -------------------------------------------------------------------------------- 1 | CONFIG_HAS_FPU=y 2 | 3 | CONFIG_PACKAGE_luci-app-ttyd=y 4 | CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y 5 | 6 | CONFIG_PACKAGE_bash=y 7 | 8 | CONFIG_PACKAGE_luci-app-turboacc=y 9 | CONFIG_PACKAGE_luci-i18n-turboacc-zh-cn=y 10 | 11 | CONFIG_BUSYBOX_CUSTOM=y 12 | 13 | CONFIG_PACKAGE_squashfs-tools-mksquashfs=y 14 | CONFIG_PACKAGE_squashfs-tools-unsquashfs=y 15 | CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT=y 16 | 17 | CONFIG_PACKAGE_acpid=y 18 | 19 | CONFIG_PACKAGE_ip-full=y 20 | CONFIG_PACKAGE_ipset=y 21 | CONFIG_PACKAGE_iptables=y 22 | CONFIG_PACKAGE_iptables-mod-extra=y 23 | CONFIG_PACKAGE_iptables-mod-tproxy=y 24 | CONFIG_PACKAGE_iwinfo=y 25 | CONFIG_PACKAGE_luci-newapi=y 26 | CONFIG_PACKAGE_mkf2fs=y 27 | 28 | CONFIG_PACKAGE_bash=y 29 | CONFIG_PACKAGE_opkg=y 30 | 31 | 32 | CONFIG_PACKAGE_coreutils-cat=y 33 | CONFIG_PACKAGE_coreutils-stat=y 34 | CONFIG_PACKAGE_screen=y 35 | CONFIG_PACKAGE_vim-full=y 36 | CONFIG_PACKAGE_blkid=y 37 | CONFIG_PACKAGE_ntpdate=y 38 | 39 | CONFIG_PACKAGE_losetup=y 40 | CONFIG_PACKAGE_dosfstools=y 41 | CONFIG_PACKAGE_e2fsprogs=y 42 | CONFIG_PACKAGE_fdisk=y 43 | CONFIG_PACKAGE_fstrim=y 44 | CONFIG_PACKAGE_mount-utils=y 45 | CONFIG_PACKAGE_f2fs-tools=y 46 | CONFIG_PACKAGE_f2fsck=y 47 | CONFIG_PACKAGE_exfat-mkfs=y 48 | CONFIG_PACKAGE_resize2fs=y 49 | 50 | CONFIG_PACKAGE_xfs-admin=y 51 | CONFIG_PACKAGE_xfs-fsck=y 52 | CONFIG_PACKAGE_xfs-growfs=y 53 | CONFIG_PACKAGE_xfs-mkfs=y 54 | 55 | CONFIG_PACKAGE_ntfs-3g=y 56 | CONFIG_PACKAGE_ntfs-3g-utils=y 57 | 58 | CONFIG_PACKAGE_hdparm=y 59 | 60 | CONFIG_PACKAGE_unzip=y 61 | CONFIG_PACKAGE_unrar=y 62 | 63 | CONFIG_PACKAGE_file=y 64 | 65 | CONFIG_PACKAGE_lsof=y 66 | 67 | CONFIG_PACKAGE_lm-sensors=y 68 | CONFIG_PACKAGE_usbutils=y 69 | CONFIG_PACKAGE_pciutils=y 70 | CONFIG_PACKAGE_psmisc=y 71 | CONFIG_PACKAGE_procps-ng=y 72 | CONFIG_PACKAGE_procps-ng-ps=y 73 | CONFIG_PACKAGE_procps-ng-free=y 74 | 75 | 76 | CONFIG_PACKAGE_iperf3=y 77 | 78 | CONFIG_PACKAGE_tar=y 79 | CONFIG_PACKAGE_TAR_POSIX_ACL=y 80 | CONFIG_PACKAGE_TAR_XATTR=y 81 | CONFIG_PACKAGE_TAR_BZIP2=y 82 | CONFIG_PACKAGE_TAR_GZIP=y 83 | CONFIG_PACKAGE_TAR_XZ=y 84 | CONFIG_PACKAGE_TAR_ZSTD=y 85 | 86 | CONFIG_PACKAGE_ss=y 87 | CONFIG_PACKAGE_tc-full=y 88 | CONFIG_PACKAGE_tc-mod-iptables=y 89 | # CONFIG_PACKAGE_tc-tiny is not set 90 | 91 | CONFIG_BUSYBOX_DEFAULT_LSPCI=y 92 | CONFIG_BUSYBOX_DEFAULT_LSUSB=y 93 | CONFIG_BUSYBOX_DEFAULT_IPROUTE=y 94 | 95 | # luci 96 | CONFIG_PACKAGE_luci=y 97 | CONFIG_PACKAGE_luci-base=y 98 | CONFIG_PACKAGE_luci-compat=y 99 | CONFIG_PACKAGE_luci-mod-admin-full=y 100 | 101 | # https://github.com/kenzok8/openwrt-packages/issues/298#issuecomment-1184601872 102 | CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray=y 103 | CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_SagerNet_Core=n 104 | CONFIG_MOSDNS_COMPRESS_GOPROXY=y 105 | -------------------------------------------------------------------------------- /build/common/convert_translation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # [CTCGFW]immortalwrt https://raw.githubusercontent.com/immortalwrt/build-scripts/master/convert_translation.sh 3 | # Use it under GPLv3, please. 4 | # -------------------------------------------------------- 5 | # Convert translation files zh-cn to zh_Hans 6 | # The script is still in testing, welcome to report bugs. 7 | 8 | po_file="$({ find |grep -E "[a-z0-9]+\.zh\-cn.+po"; } 2>"/dev/null")" 9 | for a in ${po_file} 10 | do 11 | [ -n "$(grep "Language: zh_CN" "$a")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$a" 12 | po_new_file="$(echo -e "$a"|sed "s/zh-cn/zh_Hans/g")" 13 | mv "$a" "${po_new_file}" 2>"/dev/null" 14 | done 15 | 16 | po_file2="$({ find |grep "/zh-cn/" |grep "\.po"; } 2>"/dev/null")" 17 | for b in ${po_file2} 18 | do 19 | [ -n "$(grep "Language: zh_CN" "$b")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$b" 20 | po_new_file2="$(echo -e "$b"|sed "s/zh-cn/zh_Hans/g")" 21 | mv "$b" "${po_new_file2}" 2>"/dev/null" 22 | done 23 | 24 | lmo_file="$({ find |grep -E "[a-z0-9]+\.zh_Hans.+lmo"; } 2>"/dev/null")" 25 | for c in ${lmo_file} 26 | do 27 | lmo_new_file="$(echo -e "$c"|sed "s/zh_Hans/zh-cn/g")" 28 | mv "$c" "${lmo_new_file}" 2>"/dev/null" 29 | done 30 | 31 | lmo_file2="$({ find |grep "/zh_Hans/" |grep "\.lmo"; } 2>"/dev/null")" 32 | for d in ${lmo_file2} 33 | do 34 | lmo_new_file2="$(echo -e "$d"|sed "s/zh_Hans/zh-cn/g")" 35 | mv "$d" "${lmo_new_file2}" 2>"/dev/null" 36 | done 37 | 38 | po_dir="$({ find |grep "/zh-cn" |sed "/\.po/d" |sed "/\.lmo/d"; } 2>"/dev/null")" 39 | for e in ${po_dir} 40 | do 41 | po_new_dir="$(echo -e "$e"|sed "s/zh-cn/zh_Hans/g")" 42 | mv "$e" "${po_new_dir}" 2>"/dev/null" 43 | done 44 | 45 | makefile_file="$({ find|grep Makefile |sed "/Makefile./d"; } 2>"/dev/null")" 46 | for f in ${makefile_file} 47 | do 48 | [ -n "$(grep "zh-cn" "$f")" ] && sed -i "s/zh-cn/zh_Hans/g" "$f" 49 | [ -n "$(grep "zh_Hans.lmo" "$f")" ] && sed -i "s/zh_Hans.lmo/zh-cn.lmo/g" "$f" 50 | done 51 | exit 0 -------------------------------------------------------------------------------- /build/common/delete.list: -------------------------------------------------------------------------------- 1 | # 老包目录删掉 2 | luci-app-clash -------------------------------------------------------------------------------- /build/common/disable.buildinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangguanzhang/Actions-OpenWrt/5447bebd4926209f97e8f5ce6c82467450cf1ed9/build/common/disable.buildinfo -------------------------------------------------------------------------------- /build/common/docker.buildinfo: -------------------------------------------------------------------------------- 1 | # docker 2 | # https://github.com/coolsnowwolf/packages/issues/352 3 | CONFIG_PACKAGE_luci-app-dockerman=y 4 | CONFIG_PACKAGE_runc=y 5 | CONFIG_PACKAGE_luci-compat=y 6 | CONFIG_PACKAGE_docker-compose=y 7 | CONFIG_PACKAGE_dockerd=y 8 | CONFIG_DOCKER_KERNEL_OPTIONS=y 9 | CONFIG_DOCKER_NET_ENCRYPT=y 10 | CONFIG_DOCKER_NET_MACVLAN=y 11 | CONFIG_DOCKER_NET_OVERLAY=y 12 | CONFIG_DOCKER_NET_TFTP=y 13 | CONFIG_DOCKER_RES_SHAPE=y 14 | CONFIG_DOCKER_SECCOMP=y 15 | CONFIG_DOCKER_STO_BTRFS=y 16 | CONFIG_DOCKER_STO_EXT4=y 17 | -------------------------------------------------------------------------------- /build/common/env.sh: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/cn/actions/using-jobs/defining-outputs-for-jobs 2 | # 设置一些 condition 给后续步骤作为判断条件和执行的值 3 | 4 | 5 | # action 内置 env 6 | # https://docs.github.com/cn/actions/learn-github-actions/environment-variables 7 | 8 | # github action 和本地设置是不同的函数实现 9 | if [ -n "${GITHUB_ENV}" ];then 10 | function SET_ENV(){ 11 | echo "$1=$2" >> $GITHUB_ENV 12 | } 13 | else 14 | function SET_ENV(){ 15 | export $1="$2" 16 | } 17 | fi 18 | 19 | if [ -f env.sh ];then 20 | # 主目录 source 设备的 env.sh 21 | if [ -n "${GITHUB_ENV}" ];then 22 | grep -Ev '^\s*$|^\s*#' env.sh >> $GITHUB_ENV 23 | else 24 | source env.sh 25 | fi 26 | fi 27 | 28 | if [ -n "${envOverride}" ];then 29 | for env_ins in `tr ',' ' ' <<< $envOverride `;do 30 | SET_ENV `tr '=' ' ' <<< $env_ins` 31 | done 32 | fi 33 | 34 | SET_ENV GOPROXY https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,https://goproxy.io,direct 35 | -------------------------------------------------------------------------------- /build/common/scripts/start_set_matrix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /usr/local/bin/yq ];then 4 | #curl -sLo /usr/local/bin/yq https://github.com/$( curl -sL https://github.com/mikefarah/yq/releases/latest | grep -Pom1 'href="/\K.+?yq_linux_amd64' ) 5 | curl -sLo /usr/local/bin/yq $(curl -L https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r '.assets[]|select(.name|match("linux_amd64$"))|.browser_download_url') 6 | sudo chmod a+x /usr/local/bin/yq 7 | fi 8 | 9 | if [ "$1" = set ];then 10 | repository_dispatch_file=$(grep -P '^\s+repository_dispatch:' .github/workflows/*.yml | awk -F: '{print $1}') 11 | tr -cd '\11\12\15\40-\176' < ${repository_dispatch_file} > ${repository_dispatch_file}.new 12 | #yq '.on.workflow_dispatch.inputs' ${repository_dispatch_file}.new > input.yml 13 | yq '.on.workflow_dispatch.inputs|to_entries|.[]|{.key: .value.default}' ${repository_dispatch_file}.new > /tmp/var.yml 14 | 15 | 16 | # 不为空则是 input 触发 17 | if [ -n "$(yq '.event.inputs //""' /tmp/github)" ];then 18 | yq -P '.event.inputs' /tmp/github >> /tmp/var.yml 19 | fi 20 | 21 | # 不为空则是 dispatch 触发 22 | if [ -n "$(yq '.event.client_payload //""' /tmp/github)" ];then 23 | yq -P '.event.client_payload' /tmp/github | sed -r 's#^device:#target:#' >> /tmp/var.yml 24 | fi 25 | 26 | sed -r 's#: #=#' /tmp/var.yml > /tmp/var.sh 27 | 28 | tac /tmp/var.yml | awk '!a[$1]++' | yq -o=json -I=0 > /tmp/var.json 29 | 30 | source /tmp/var.sh 31 | 32 | if [ ! -d "${GITHUB_WORKSPACE}/build/${target}" ];then 33 | echo "no such target: ${target}" 34 | exit 2 35 | fi 36 | 37 | echo config: ${config} 38 | if [ -z "${repo_json}" ] ;then 39 | bash ${GITHUB_WORKSPACE}/build/${target}/set_matrix.sh 40 | else # [{"name":"openwrt","branch":"master","addr":"https://github.com/openwrt/openwrt"}] 41 | echo "::set-output name=matrix::${repo_json}" 42 | fi 43 | 44 | echo "::set-output name=input::$(cat /tmp/var.json)" 45 | 46 | cat /tmp/var.json 47 | fi 48 | 49 | if [ ! -f /tmp/var.sh ];then 50 | yq -P /tmp/github.json | sed -r 's#: #=#' > /tmp/var.sh 51 | cat /tmp/var.sh 52 | source /tmp/var.sh 53 | cat /tmp/var.sh >> $GITHUB_ENV 54 | fi -------------------------------------------------------------------------------- /build/common/small.buildinfo: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_luci-i18n-base-zh-cn=y 2 | CONFIG_LUCI_LANG_zh_Hans=y 3 | 4 | 5 | CONFIG_PACKAGE_luci-i18n-opkg-zh-cn=y 6 | CONFIG_PACKAGE_luci-i18n-firewall-zh-cn=y 7 | 8 | CONFIG_PACKAGE_default-settings=y 9 | 10 | CONFIG_PACKAGE_luci-app-firewall=y 11 | CONFIG_PACKAGE_luci-app-wireguard=y 12 | CONFIG_PACKAGE_luci-i18n-wireguard-zh-cn=y 13 | CONFIG_PACKAGE_luci-proto-wireguard=y 14 | CONFIG_PACKAGE_wireguard-tools=y 15 | 16 | CONFIG_PACKAGE_bind-dig=y 17 | CONFIG_PACKAGE_curl=y 18 | CONFIG_PACKAGE_wget=y 19 | CONFIG_PACKAGE_lscpu=y 20 | CONFIG_PACKAGE_tcpdump=y 21 | CONFIG_PACKAGE_coreutils-timeout=y 22 | 23 | CONFIG_PACKAGE_lsblk=y 24 | CONFIG_PACKAGE_coreutils-df=y 25 | CONFIG_PACKAGE_coreutils-dd=y 26 | CONFIG_PACKAGE_coreutils-truncate=y 27 | CONFIG_PACKAGE_parted=y 28 | 29 | CONFIG_PACKAGE_gzip=y 30 | CONFIG_PACKAGE_grep=y 31 | 32 | 33 | -------------------------------------------------------------------------------- /build/common/upload_docker_img.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | repo_name=$1 4 | target=$2 5 | if [ "$target" = '-full' ];then 6 | target='' 7 | fi 8 | 9 | [ -z "$real_branch" ] && real_branch=${GITHUB_REF##*/} 10 | 11 | function upload_dockerhub(){ 12 | local DEVICE_NAME=$1 13 | local hub_img=zhangguanzhang/${DEVICE_NAME,,} BUILD_DIR=$(mktemp -d) 14 | local BRANCH=${real_branch} 15 | local file=$(basename $2) 16 | local tag=release-$(date +%Y-%m-%d) 17 | local FSTYPE suffix 18 | FSTYPE=$( echo $file | grep -Po '\-\K(ext4|squashfs)(?=-)' ) 19 | # .img .img.gz 啥的后缀 20 | suffix=${file#*.} 21 | 22 | cp $2 ${BUILD_DIR}/openwrt-${DEVICE_NAME}-${FSTYPE}.${suffix} 23 | # cp $(dirname $2)/{sha256sums,config.buildinfo,feeds.buildinfo,version.buildinfo} ${BUILD_DIR}/ 24 | cp $(dirname $2)/sha256sums ${BUILD_DIR}/ 25 | echo 'Dockerfile' > ${BUILD_DIR}/.dockerignore 26 | cat >${BUILD_DIR}/Dockerfile << EOF 27 | FROM alpine 28 | LABEL FILE=$file 29 | LABEL NUM=${GITHUB_RUN_NUMBER} 30 | COPY * / 31 | EOF 32 | [ "${BRANCH}" != main ] && tag=latest 33 | 34 | local build_img=${hub_img}:${tag}-${FSTYPE}${target}-${repo_name} 35 | 36 | ( 37 | cd ${BUILD_DIR} 38 | echo docker build -t ${build_img} . 39 | # 同步到阿里云 40 | docker build -t registry.aliyuncs.com/${build_img} . && docker push registry.aliyuncs.com/${build_img} 41 | docker tag registry.aliyuncs.com/${build_img} ${build_img} && docker push ${build_img} 42 | docker rmi ${build_img} 43 | ) 44 | # docker push ${build_img} 45 | # if [ "${BRANCH}" != main ];then 46 | # docker tag ${build_img} ${hub_img}:release-${FSTYPE} 47 | # docker push ${hub_img}:release-${FSTYPE} 48 | # fi 49 | rm -rf ${BUILD_DIR} 50 | } 51 | 52 | function upload(){ 53 | if [ -z "${NOT_PUSH}" ];then 54 | upload_dockerhub $1 $2 55 | fi 56 | } 57 | 58 | firmware_path=$( dirname $( find $GITHUB_WORKSPACE/openwrt/bin/targets -type f -name sha256sums) ) 59 | 60 | [ -n "$exclude_str" ] && exclude_str="|${exclude_str#|}" 61 | # 有些 build_target 没设置 exclude_str 62 | if echo $multi_target | grep -Pq ,;then 63 | for target_ins in `echo $multi_target| sed -e 's/,/ /' -e "s/'//g"`;do 64 | for file in $(ls ${firmware_path}/*-${target_ins}-* | grep -Pv "kernel|rootfs|manifest${exclude_str}" | grep -P 'squashfs|ext4' );do 65 | upload $target_ins $file 66 | done 67 | done 68 | else 69 | for file in $(ls ${firmware_path}/*-*-* | grep -Pv "kernel|rootfs|manifest${exclude_str}" | grep -P 'squashfs|ext4' );do 70 | upload ${DEVICE_NAME} $file 71 | done 72 | fi 73 | -------------------------------------------------------------------------------- /build/common/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | 16 | # slim 固件本地 opkg 配置 17 | if ls -l /local_feed/*.ipk &>/dev/null;then 18 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 19 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 20 | # 取消签名,暂时解决不了 21 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 22 | fi 23 | 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | # dns有问题的时候 ip ntp 保障 52 | uci add_list system.ntp.server=120.25.115.20 53 | uci commit system 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 90 | uci commit dhcp 91 | -------------------------------------------------------------------------------- /build/doornet2/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangguanzhang/Actions-OpenWrt/5447bebd4926209f97e8f5ce6c82467450cf1ed9/build/doornet2/README.md -------------------------------------------------------------------------------- /build/doornet2/config/disable.buldinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangguanzhang/Actions-OpenWrt/5447bebd4926209f97e8f5ce6c82467450cf1ed9/build/doornet2/config/disable.buldinfo -------------------------------------------------------------------------------- /build/doornet2/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/doornet2/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+10}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # fi 13 | 14 | 15 | if [ "$suffix" = '-full' ];then 16 | [ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+8}' .config ) 17 | [[ "$repo_name" =~ 'DHDAXCW' ]] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+56}' .config ) 18 | #[ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+80}' .config ) 19 | fi 20 | 21 | if [ -n "$rootfs_size" ];then 22 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 23 | fi 24 | -------------------------------------------------------------------------------- /build/doornet2/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/doornet2/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=doornet2 15 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/doornet2/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/doornet2/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | 16 | # slim 固件本地 opkg 配置 17 | if ls -l /local_feed/*.ipk &>/dev/null;then 18 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 19 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 20 | # 取消签名,暂时解决不了 21 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 22 | fi 23 | 24 | 25 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 26 | uci set aliyundrive-webdav.@server[0].enable=0 27 | uci commit aliyundrive-webdav 28 | fi 29 | 30 | # 默认主题 31 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 32 | uci set luci.main.mediaurlbase='/luci-static/argonne' 33 | fi 34 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 35 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 36 | fi 37 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 38 | uci set luci.main.mediaurlbase='/luci-static/argon' 39 | fi 40 | uci commit luci 41 | # 此文件名注意ls 排序,下面也行 42 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 43 | # uci commit luci 44 | 45 | if [ -f /etc/config/qbittorrent ];then 46 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 47 | uci commit qbittorrent 48 | fi 49 | 50 | 51 | uci add_list system.ntp.server=120.25.115.20 52 | uci commit system 53 | 54 | touch /etc/crontabs/root 55 | chmod 0600 /etc/crontabs/root 56 | 57 | # 允许 wan 访问 openwrt web 58 | # uci set uhttpd.main.rfc1918_filter='0' 59 | # uci commit uhttpd 60 | 61 | # 允许 wan ssh 62 | uci delete dropbear.@dropbear[0].Interface 63 | uci commit dropbear 64 | # 配合下面的单个端口,或者放行整个段 65 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 66 | # 二级路由的话放行上层的 CIDR 即可 67 | 68 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 69 | cat >> /etc/firewall.user << EOF 70 | # 允许wan口指定网段访问,一般二级路由下需要 71 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 72 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 73 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 74 | EOF 75 | fi 76 | 77 | # 使用上面的 iptables 规则理论上也行 78 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 79 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 80 | # if [ -n "$line" ];then 81 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 82 | # fi 83 | 84 | # dnsmasq 85 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 86 | uci set dhcp.@dnsmasq[0].localservice='0' 87 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 88 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 89 | uci commit dhcp 90 | -------------------------------------------------------------------------------- /build/doornet2/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 3 | # 下面日后适配天灵 4 | 5 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 6 | 7 | 8 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 11 | 12 | # echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | 14 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 15 | -------------------------------------------------------------------------------- /build/h68k/README.md: -------------------------------------------------------------------------------- 1 | ## 关于 2 | 3 | 8531 8125 网卡 4 | -------------------------------------------------------------------------------- /build/h68k/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/h68k/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/h68k/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+10}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # fi 13 | 14 | 15 | if [ "$suffix" = '-full' ];then 16 | [ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+32}' .config ) 17 | [[ "$repo_name" =~ 'DHDAXCW' ]] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+24}' .config ) 18 | fi 19 | 20 | if [ -n "$rootfs_size" ];then 21 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 22 | fi 23 | -------------------------------------------------------------------------------- /build/h68k/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/h68k/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=h68k-a,h68k-c 15 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/h68k/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/h68k/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | uci add_list system.ntp.server=120.25.115.20 53 | uci commit system 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 90 | uci commit dhcp 91 | -------------------------------------------------------------------------------- /build/h68k/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"DHDAXCW_lede","branch":"h68k","addr":"https://github.com/DHDAXCW/lede"}]' 7 | 8 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"DHDAXCW_lede","branch":"master","addr":"https://github.com/DHDAXCW/lede"}]' 11 | 12 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | -------------------------------------------------------------------------------- /build/k2p/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 说明 3 | 4 | files 目录没被打包,以后再看 5 | 6 | ### target 选择 7 | 8 | ``` 9 | Target System 选择 MediaTek Ralink MIPS 10 | Subtarget选择MT7621 based boards 11 | Target Profile选择Phicomm K2P 12 | ``` 13 | 14 | ### 闭源驱动 15 | 16 | https://github.com/coolsnowwolf/lede/issues/9384#issuecomment-1125375453 17 | 18 | 默认即可,不需要开 `luci-app-mtwifi` 19 | 20 | 酸酸乳开启 xray 之类的就会容量爆了无法编译出 `openwrt-ramips-mt7621-phicomm_k2p-squashfs-sysupgrade.bin` 21 | 22 | ### 刷机 23 | 24 | 刷好 breeed 后,恢复出厂设置,和固件备份,eeprom 和编程器固件都备份。然后固件更新 点击固件选 `openwrt-ramips-mt7621-phicomm_k2p-squashfs-sysupgrade.bin` 后,内存布局选斐讯,然后刷完等待 25 | 26 | ## 固件信息 27 | 28 | ``` 29 | root@OpenWrt:~# df -h 30 | Filesystem Size Used Avail Use% Mounted on 31 | /dev/root 10M 10M 0 100% /rom 32 | tmpfs 60M 560K 59M 1% /tmp 33 | tmpfs 60M 1.2M 59M 2% /tmp/root 34 | tmpfs 512K 0 512K 0% /dev 35 | /dev/mtdblock7 3.3M 536K 2.8M 17% /overlay 36 | overlayfs:/overlay 3.3M 536K 2.8M 17% / 37 | root@OpenWrt:~# lsblk 38 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 39 | mtdblock0 31:0 0 192K 1 disk 40 | mtdblock1 31:1 0 64K 1 disk 41 | mtdblock2 31:2 0 64K 1 disk 42 | mtdblock3 31:3 0 320K 1 disk 43 | mtdblock4 31:4 0 15.4M 0 disk 44 | mtdblock5 31:5 0 2.4M 1 disk 45 | mtdblock6 31:6 0 12.9M 1 disk /rom 46 | mtdblock7 31:7 0 3.3M 0 disk /overlay 47 | root@OpenWrt:~# free -h 48 | total used free shared buff/cache available 49 | Mem: 118Mi 55Mi 27Mi 1.0Mi 35Mi 20Mi 50 | Swap: 0B 0B 0B 51 | root@OpenWrt:~# lscpu 52 | Architecture: mips 53 | Byte Order: Little Endian 54 | CPU(s): 4 55 | On-line CPU(s) list: 0-3 56 | Model name: - 57 | Model: MIPS 1004Kc V2.15 58 | Thread(s) per core: 2 59 | Core(s) per socket: 2 60 | Socket(s): 1 61 | BogoMIPS: 598.01 62 | Flags: mips16 dsp mt 63 | Caches (sum of all): 64 | L1d: 64 KiB (2 instances) 65 | L1i: 64 KiB (2 instances) 66 | L2: 256 KiB (1 instance) 67 | root@OpenWrt:~# iperf3 -s 68 | ----------------------------------------------------------- 69 | Server listening on 5201 (test #1) 70 | ----------------------------------------------------------- 71 | Accepted connection from 192.168.1.137, port 10149 72 | [ 5] local 192.168.1.1 port 5201 connected to 192.168.1.137 port 10150 73 | [ ID] Interval Transfer Bitrate 74 | [ 5] 0.00-1.00 sec 100 MBytes 838 Mbits/sec 75 | [ 5] 1.00-2.00 sec 108 MBytes 907 Mbits/sec 76 | [ 5] 2.00-3.00 sec 99.4 MBytes 833 Mbits/sec 77 | [ 5] 3.00-4.00 sec 66.8 MBytes 560 Mbits/sec 78 | [ 5] 4.00-5.00 sec 65.6 MBytes 550 Mbits/sec 79 | [ 5] 5.00-6.00 sec 106 MBytes 886 Mbits/sec 80 | [ 5] 6.00-7.00 sec 106 MBytes 888 Mbits/sec 81 | [ 5] 7.00-8.00 sec 106 MBytes 892 Mbits/sec 82 | [ 5] 8.00-9.00 sec 69.2 MBytes 580 Mbits/sec 83 | [ 5] 9.00-10.00 sec 89.2 MBytes 751 Mbits/sec 84 | [ 5] 10.00-10.00 sec 256 KBytes 790 Mbits/sec 85 | - - - - - - - - - - - - - - - - - - - - - - - - - 86 | [ ID] Interval Transfer Bitrate 87 | [ 5] 0.00-10.00 sec 916 MBytes 768 Mbits/sec receiver 88 | ``` 89 | -------------------------------------------------------------------------------- /build/k2p/diy-after-compile.sh: -------------------------------------------------------------------------------- 1 | rm -f $(dirname $(find openwrt/bin/targets/ -type f -name sha256sums ))/openwrt-*-root.squashfs 2 | 3 | true 4 | -------------------------------------------------------------------------------- /build/k2p/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | # sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | 19 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 20 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 21 | -------------------------------------------------------------------------------- /build/k2p/diy-part2.sh: -------------------------------------------------------------------------------- 1 | rm -rf package/community 2 | mkdir package/community 3 | 4 | if [ -d feeds/others/luci-app-adguardhome ];then 5 | pushd feeds/others/ 6 | sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' luci-app-adguardhome/root/etc/config/AdGuardHome 7 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 8 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' luci-app-adguardhome/root/etc/init.d/AdGuardHome) 9 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' luci-app-adguardhome/root/etc/init.d/AdGuardHome 10 | # 依赖问题,固件自带了 wget ca-bundle ca-certificates 11 | sed -ri '/^LUCI_DEPENDS:=/s#\+(ca-certs|wget-ssl)##g' luci-app-adguardhome/Makefile 12 | popd 13 | fi 14 | 15 | 16 | # udp2raw 17 | if [ 1 -eq 1 ];then 18 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/community/luci-app-udp2raw 19 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 20 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 21 | if [ -n "$url" ];then 22 | wget $url -O - | \ 23 | tar -zxvf - -C . udp2raw_mips24kc_le 24 | upx -9 udp2raw_mips24kc_le 25 | mkdir -p package/community/luci-app-udp2raw/files/root/usr/bin/ 26 | sed -ri 's#\s隧道##' package/community/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 27 | mv udp2raw_mips24kc_le package/community/luci-app-udp2raw/files/root/usr/bin/udp2raw 28 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/community/luci-app-udp2raw/Makefile;then 29 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 30 | cat <<'EOF' | sed -r 's#^\s+#\t#' 31 | $(INSTALL_DIR) $(1)/usr/bin 32 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 33 | chmod 0755 $(1)/usr/bin/udp2raw 34 | EOF 35 | ) package/community/luci-app-udp2raw/Makefile 36 | fi 37 | fi 38 | fi 39 | 40 | chmod a+x ${GITHUB_WORKSPACE}/build/scripts/*.sh 41 | \cp -a ${GITHUB_WORKSPACE}/build/scripts/update.sh files/ 42 | -------------------------------------------------------------------------------- /build/k2p/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UdateFeeds=true 4 | InstallFeeds=true 5 | 6 | UseCache=true 7 | 8 | AutoBuildTimeOut=false 9 | 10 | MakeDownload=true 11 | ClearPkg=false 12 | 13 | EnableCommonBuildInfo=false 14 | -------------------------------------------------------------------------------- /build/k2p/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | 13 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 14 | uci set aliyundrive-webdav.@server[0].enable=0 15 | uci commit aliyundrive-webdav 16 | fi 17 | 18 | # 默认主题 19 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 20 | uci set luci.main.mediaurlbase='/luci-static/argonne' 21 | fi 22 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 23 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 24 | fi 25 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 26 | uci set luci.main.mediaurlbase='/luci-static/argon' 27 | fi 28 | uci commit luci 29 | # 此文件名注意ls 排序,下面也行 30 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 31 | # uci commit luci 32 | 33 | if [ -f /etc/config/qbittorrent ];then 34 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 35 | uci commit qbittorrent 36 | fi 37 | 38 | 39 | uci add_list system.ntp.server=120.25.115.20 40 | uci commit system 41 | 42 | # 允许 wan 访问 openwrt web 43 | # uci set uhttpd.main.rfc1918_filter='0' 44 | # uci commit uhttpd 45 | 46 | # 允许 wan ssh 47 | uci delete dropbear.@dropbear[0].Interface 48 | uci commit dropbear 49 | # 配合下面的单个端口,或者放行整个段 50 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 51 | # 二级路由的话放行上层的 CIDR 即可 52 | 53 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 54 | cat >> /etc/firewall.user << EOF 55 | # 允许wan口指定网段访问,一般二级路由下需要 56 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 57 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 58 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 59 | EOF 60 | fi 61 | 62 | # 使用上面的 iptables 规则理论上也行 63 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 64 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 65 | # if [ -n "$line" ];then 66 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 67 | # fi 68 | 69 | # dnsmasq 70 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 71 | uci set dhcp.@dnsmasq[0].localservice='0' 72 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 73 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 74 | uci commit dhcp 75 | -------------------------------------------------------------------------------- /build/k2p/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 此步不重要,主要是 custom_pull.sh 4 | -------------------------------------------------------------------------------- /build/k3/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 说明 3 | 4 | files 目录没被打包,以后再看 5 | 6 | ### target 选择 7 | 8 | ``` 9 | Target System 选择 MediaTek Ralink MIPS 10 | Subtarget选择MT7621 based boards 11 | Target Profile选择Phicomm K2P 12 | ``` 13 | 14 | ### 闭源驱动 15 | 16 | https://github.com/coolsnowwolf/lede/issues/9384#issuecomment-1125375453 17 | 18 | 默认即可,不需要开 `luci-app-mtwifi` 19 | 20 | 酸酸乳开启 xray 之类的就会容量爆了无法编译出 `openwrt-ramips-mt7621-phicomm_k2p-squashfs-sysupgrade.bin` 21 | 22 | ### 刷机 23 | 24 | 刷好 breeed 后,恢复出厂设置,和固件备份,eeprom 和编程器固件都备份。然后固件更新 点击固件选 `openwrt-ramips-mt7621-phicomm_k2p-squashfs-sysupgrade.bin` 后,内存布局选斐讯,然后刷完等待 25 | 26 | ## 固件信息 27 | 28 | ``` 29 | root@OpenWrt:~# df -h 30 | Filesystem Size Used Avail Use% Mounted on 31 | /dev/root 10M 10M 0 100% /rom 32 | tmpfs 60M 560K 59M 1% /tmp 33 | tmpfs 60M 1.2M 59M 2% /tmp/root 34 | tmpfs 512K 0 512K 0% /dev 35 | /dev/mtdblock7 3.3M 536K 2.8M 17% /overlay 36 | overlayfs:/overlay 3.3M 536K 2.8M 17% / 37 | root@OpenWrt:~# lsblk 38 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 39 | mtdblock0 31:0 0 192K 1 disk 40 | mtdblock1 31:1 0 64K 1 disk 41 | mtdblock2 31:2 0 64K 1 disk 42 | mtdblock3 31:3 0 320K 1 disk 43 | mtdblock4 31:4 0 15.4M 0 disk 44 | mtdblock5 31:5 0 2.4M 1 disk 45 | mtdblock6 31:6 0 12.9M 1 disk /rom 46 | mtdblock7 31:7 0 3.3M 0 disk /overlay 47 | root@OpenWrt:~# free -h 48 | total used free shared buff/cache available 49 | Mem: 118Mi 55Mi 27Mi 1.0Mi 35Mi 20Mi 50 | Swap: 0B 0B 0B 51 | root@OpenWrt:~# lscpu 52 | Architecture: mips 53 | Byte Order: Little Endian 54 | CPU(s): 4 55 | On-line CPU(s) list: 0-3 56 | Model name: - 57 | Model: MIPS 1004Kc V2.15 58 | Thread(s) per core: 2 59 | Core(s) per socket: 2 60 | Socket(s): 1 61 | BogoMIPS: 598.01 62 | Flags: mips16 dsp mt 63 | Caches (sum of all): 64 | L1d: 64 KiB (2 instances) 65 | L1i: 64 KiB (2 instances) 66 | L2: 256 KiB (1 instance) 67 | root@OpenWrt:~# iperf3 -s 68 | ----------------------------------------------------------- 69 | Server listening on 5201 (test #1) 70 | ----------------------------------------------------------- 71 | Accepted connection from 192.168.1.137, port 10149 72 | [ 5] local 192.168.1.1 port 5201 connected to 192.168.1.137 port 10150 73 | [ ID] Interval Transfer Bitrate 74 | [ 5] 0.00-1.00 sec 100 MBytes 838 Mbits/sec 75 | [ 5] 1.00-2.00 sec 108 MBytes 907 Mbits/sec 76 | [ 5] 2.00-3.00 sec 99.4 MBytes 833 Mbits/sec 77 | [ 5] 3.00-4.00 sec 66.8 MBytes 560 Mbits/sec 78 | [ 5] 4.00-5.00 sec 65.6 MBytes 550 Mbits/sec 79 | [ 5] 5.00-6.00 sec 106 MBytes 886 Mbits/sec 80 | [ 5] 6.00-7.00 sec 106 MBytes 888 Mbits/sec 81 | [ 5] 7.00-8.00 sec 106 MBytes 892 Mbits/sec 82 | [ 5] 8.00-9.00 sec 69.2 MBytes 580 Mbits/sec 83 | [ 5] 9.00-10.00 sec 89.2 MBytes 751 Mbits/sec 84 | [ 5] 10.00-10.00 sec 256 KBytes 790 Mbits/sec 85 | - - - - - - - - - - - - - - - - - - - - - - - - - 86 | [ ID] Interval Transfer Bitrate 87 | [ 5] 0.00-10.00 sec 916 MBytes 768 Mbits/sec receiver 88 | ``` 89 | -------------------------------------------------------------------------------- /build/k3/diy-after-compile.sh: -------------------------------------------------------------------------------- 1 | rm -f $(dirname $(find openwrt/bin/targets/ -type f -name sha256sums ))/openwrt-*-root.squashfs 2 | 3 | true 4 | -------------------------------------------------------------------------------- /build/k3/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | # sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | 19 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 20 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 21 | -------------------------------------------------------------------------------- /build/k3/diy-part2.sh: -------------------------------------------------------------------------------- 1 | 2 | rm -rf package/community 3 | mkdir package/community 4 | 5 | if [ -d feeds/others/luci-app-adguardhome ];then 6 | pushd feeds/others/ 7 | sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' luci-app-adguardhome/root/etc/config/AdGuardHome 8 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 9 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' luci-app-adguardhome/root/etc/init.d/AdGuardHome) 10 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' luci-app-adguardhome/root/etc/init.d/AdGuardHome 11 | # 依赖问题,固件自带了 wget ca-bundle ca-certificates 12 | sed -ri '/^LUCI_DEPENDS:=/s#\+(ca-certs|wget-ssl)##g' luci-app-adguardhome/Makefile 13 | popd 14 | fi 15 | 16 | 17 | # udp2raw 18 | if [ 1 -eq 1 ];then 19 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/community/luci-app-udp2raw 20 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 21 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 22 | if [ -n "$url" ];then 23 | wget $url -O - | \ 24 | tar -zxvf - -C . udp2raw_mips24kc_le 25 | upx -9 udp2raw_mips24kc_le 26 | mkdir -p package/community/luci-app-udp2raw/files/root/usr/bin/ 27 | sed -ri 's#\s隧道##' package/community/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 28 | mv udp2raw_mips24kc_le package/community/luci-app-udp2raw/files/root/usr/bin/udp2raw 29 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/community/luci-app-udp2raw/Makefile;then 30 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 31 | cat <<'EOF' | sed -r 's#^\s+#\t#' 32 | $(INSTALL_DIR) $(1)/usr/bin 33 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 34 | chmod 0755 $(1)/usr/bin/udp2raw 35 | EOF 36 | ) package/community/luci-app-udp2raw/Makefile 37 | fi 38 | fi 39 | fi 40 | 41 | # sed -i 's|kmod-brcmfmac brcmfmac-firmware-4366c0-pcie|kmod-brcmfmac k3wifi k3screenctrl|g' target/linux/bcm53xx/image/Makefile 42 | # # k3 proprietary wifi driver 43 | # svn export -q https://github.com/coolsnowwolf/lede/trunk/package/lean/k3-brcmfmac4366c-firmware package/k3/k3wifi 44 | 45 | git clone --depth=1 https://github.com/lwz322/luci-app-k3screenctrl.git package/community/luci-app-k3screenctrl 46 | git clone --depth=1 https://github.com/lwz322/k3screenctrl_build.git package/community/k3screenctrl_build 47 | echo 'CONFIG_PACKAGE_luci-app-k3screenctrl=y'>> .config 48 | 49 | 50 | chmod a+x ${GITHUB_WORKSPACE}/build/scripts/*.sh 51 | \cp -a ${GITHUB_WORKSPACE}/build/scripts/update.sh files/ 52 | -------------------------------------------------------------------------------- /build/k3/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UdateFeeds=true 4 | InstallFeeds=true 5 | 6 | UseCache=true 7 | 8 | AutoBuildTimeOut=false 9 | 10 | MakeDownload=true 11 | ClearPkg=false 12 | 13 | EnableCommonBuildInfo=false 14 | -------------------------------------------------------------------------------- /build/k3/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | 13 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 14 | uci set aliyundrive-webdav.@server[0].enable=0 15 | uci commit aliyundrive-webdav 16 | fi 17 | 18 | # 默认主题 19 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 20 | uci set luci.main.mediaurlbase='/luci-static/argonne' 21 | fi 22 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 23 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 24 | fi 25 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 26 | uci set luci.main.mediaurlbase='/luci-static/argon' 27 | fi 28 | uci commit luci 29 | # 此文件名注意ls 排序,下面也行 30 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 31 | # uci commit luci 32 | 33 | if [ -f /etc/config/qbittorrent ];then 34 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 35 | uci commit qbittorrent 36 | fi 37 | 38 | 39 | uci add_list system.ntp.server=120.25.115.20 40 | uci commit system 41 | 42 | # 允许 wan 访问 openwrt web 43 | # uci set uhttpd.main.rfc1918_filter='0' 44 | # uci commit uhttpd 45 | 46 | # 允许 wan ssh 47 | uci delete dropbear.@dropbear[0].Interface 48 | uci commit dropbear 49 | # 配合下面的单个端口,或者放行整个段 50 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 51 | # 二级路由的话放行上层的 CIDR 即可 52 | 53 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 54 | cat >> /etc/firewall.user << EOF 55 | # 允许wan口指定网段访问,一般二级路由下需要 56 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 57 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 58 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 59 | EOF 60 | fi 61 | 62 | # 使用上面的 iptables 规则理论上也行 63 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 64 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 65 | # if [ -n "$line" ];then 66 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 67 | # fi 68 | 69 | # dnsmasq 70 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 71 | uci set dhcp.@dnsmasq[0].localservice='0' 72 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 73 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 74 | uci commit dhcp 75 | -------------------------------------------------------------------------------- /build/k3/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 此步不重要,主要是 custom_pull.sh 4 | -------------------------------------------------------------------------------- /build/neo3/README.md: -------------------------------------------------------------------------------- 1 | 2 | https://github.com/coolsnowwolf/lede/issues/5681 3 | 4 | ``` 5 | root@OpenWrt:~# lsblk 6 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 7 | loop0 7:0 0 280.3M 0 loop /overlay 8 | mmcblk0 179:0 0 29.7G 0 disk 9 | ├─mmcblk0p1 179:1 0 18M 0 part /mnt/mmcblk0p1 10 | └─mmcblk0p2 179:2 0 656M 0 part /rom 11 | root@OpenWrt:~# df -h 12 | Filesystem Size Used Avail Use% Mounted on 13 | /dev/root 376M 376M 0 100% /rom 14 | tmpfs 998M 780K 997M 1% /tmp 15 | /dev/loop0 279M 89M 190M 32% /overlay 16 | overlayfs:/overlay 279M 89M 190M 32% / 17 | tmpfs 512K 0 512K 0% /dev 18 | /dev/mmcblk0p1 18M 13M 5.0M 72% /mnt/mmcblk0p1 19 | root@OpenWrt:~# ls -l /local_feed/*.ipk | wc -l 20 | 1202 21 | root@OpenWrt:~# cat /etc/board.json 22 | { 23 | "model": { 24 | "id": "friendlyarm,nanopi-neo3", 25 | "name": "FriendlyElec NanoPi NEO3" 26 | }, 27 | "network": { 28 | "lan": { 29 | "ifname": "eth0", 30 | "protocol": "static" 31 | } 32 | } 33 | } 34 | ``` -------------------------------------------------------------------------------- /build/neo3/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/neo3/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/neo3/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+10}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # fi 13 | 14 | 15 | if [ "$suffix" = '-full' ];then 16 | #[ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+12}' .config ) 17 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+80}' .config ) 18 | fi 19 | 20 | if [ -n "$rootfs_size" ];then 21 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 22 | fi 23 | -------------------------------------------------------------------------------- /build/neo3/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/neo3/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=neo3 15 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/neo3/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/neo3/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | uci add_list system.ntp.server=120.25.115.20 53 | uci commit system 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 90 | uci commit dhcp 91 | -------------------------------------------------------------------------------- /build/neo3/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | 5 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 6 | 7 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 8 | 9 | echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 10 | 11 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 12 | -------------------------------------------------------------------------------- /build/r1s-h3/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangguanzhang/Actions-OpenWrt/5447bebd4926209f97e8f5ce6c82467450cf1ed9/build/r1s-h3/README.md -------------------------------------------------------------------------------- /build/r1s-h3/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # emmc 支持 https://www.right.com.cn/forum/thread-4004377-1-1.html 2 | CONFIG_PACKAGE_kmod-mmc=y 3 | CONFIG_PACKAGE_kmod-usb-serial=y 4 | CONFIG_PACKAGE_kmod-mmc-spi=y 5 | CONFIG_PACKAGE_kmod-sdhci=y 6 | 7 | # https://github.com/immortalwrt/immortalwrt/discussions/718 8 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 9 | -------------------------------------------------------------------------------- /build/r1s-h3/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/r1s-h3/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | if [ "$suffix" = '-full' ];then 7 | # full 版本加大一些容量 8 | # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 9 | [ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+8}' .config ) 10 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+12}' .config ) 11 | fi 12 | 13 | if [ -n "$rootfs_size" ];then 14 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 15 | fi 16 | -------------------------------------------------------------------------------- /build/r1s-h3/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/r1s-h3/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=r1 15 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv7.tar.gz -O /tmp/clash-linux-armv7.tar.gz 9 | tar zxvf /tmp/clash-linux-armv7.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv7.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv7-${TUN_VERSION}.gz -O /tmp/clash-linux-armv7-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv7-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv7.tar.gz -O /tmp/clash-linux-armv7.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv7.tar.gz -O /tmp/clash-linux-armv7.tar.gz 19 | tar zxvf /tmp/clash-linux-armv7.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/r1s-h3/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | 16 | # slim 固件本地 opkg 配置 17 | if ls -l /local_feed/*.ipk &>/dev/null;then 18 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 19 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 20 | # 取消签名,暂时解决不了 21 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 22 | fi 23 | 24 | 25 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 26 | uci set aliyundrive-webdav.@server[0].enable=0 27 | uci commit aliyundrive-webdav 28 | fi 29 | 30 | # 默认主题 31 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 32 | uci set luci.main.mediaurlbase='/luci-static/argonne' 33 | fi 34 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 35 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 36 | fi 37 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 38 | uci set luci.main.mediaurlbase='/luci-static/argon' 39 | fi 40 | uci commit luci 41 | # 此文件名注意ls 排序,下面也行 42 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 43 | # uci commit luci 44 | 45 | if [ -f /etc/config/qbittorrent ];then 46 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 47 | uci commit qbittorrent 48 | fi 49 | 50 | 51 | uci add_list system.ntp.server=120.25.115.20 52 | uci commit system 53 | 54 | touch /etc/crontabs/root 55 | chmod 0600 /etc/crontabs/root 56 | 57 | # 允许 wan 访问 openwrt web 58 | # uci set uhttpd.main.rfc1918_filter='0' 59 | # uci commit uhttpd 60 | 61 | # 允许 wan ssh 62 | uci delete dropbear.@dropbear[0].Interface 63 | uci commit dropbear 64 | # 配合下面的单个端口,或者放行整个段 65 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 66 | # 二级路由的话放行上层的 CIDR 即可 67 | 68 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 69 | cat >> /etc/firewall.user << EOF 70 | # 允许wan口指定网段访问,一般二级路由下需要 71 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 72 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 73 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 74 | EOF 75 | fi 76 | 77 | # 使用上面的 iptables 规则理论上也行 78 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 79 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 80 | # if [ -n "$line" ];then 81 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 82 | # fi 83 | 84 | # dnsmasq 85 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 86 | uci set dhcp.@dnsmasq[0].localservice='0' 87 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 88 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 89 | uci commit dhcp 90 | -------------------------------------------------------------------------------- /build/r1s-h3/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 下面日后适配天灵 4 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 7 | 8 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 11 | 12 | #echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | -------------------------------------------------------------------------------- /build/r1s-h5/README.md: -------------------------------------------------------------------------------- 1 | ## about 2 | 3 | 内核分区使用了 11M 的样子,设备的 ram 大小是 512M ,固件解压了是 699M 大小,远大于内存大小,所以无法在线升级扩容 4 | 5 | ``` 6 | CONFIG_TARGET_KERNEL_PARTSIZE=16 7 | CONFIG_TARGET_ROOTFS_PARTSIZE=645 8 | ``` 9 | 10 | 上述情况下出来的固件 11 | 12 | ``` 13 | root@ImmortalWrt:~# df -h 14 | Filesystem Size Used Avail Use% Mounted on 15 | /dev/root 419M 419M 0 100% /rom 16 | tmpfs 242M 776K 241M 1% /tmp 17 | /dev/loop0 225M 154M 72M 69% /overlay 18 | overlayfs:/overlay 225M 154M 72M 69% / 19 | tmpfs 512K 0 512K 0% /dev 20 | /dev/mmcblk0p1 20M 11M 9.0M 56% /mnt/mmcblk0p1 21 | root@ImmortalWrt:~# lsblk 22 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 23 | loop0 7:0 0 226.8M 0 loop /overlay 24 | mmcblk0 179:0 0 974.5M 0 disk 25 | ├─mmcblk0p1 179:1 0 20M 0 part /mnt/mmcblk0p1 26 | └─mmcblk0p2 179:2 0 645M 0 part /rom 27 | root@ImmortalWrt:~# 28 | ``` 29 | -------------------------------------------------------------------------------- /build/r1s-h5/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # emmc 支持 https://www.right.com.cn/forum/thread-4004377-1-1.html 2 | CONFIG_PACKAGE_kmod-mmc=y 3 | CONFIG_PACKAGE_kmod-usb-serial=y 4 | CONFIG_PACKAGE_kmod-mmc-spi=y 5 | CONFIG_PACKAGE_kmod-sdhci=y 6 | 7 | # https://github.com/immortalwrt/immortalwrt/discussions/718 8 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 9 | -------------------------------------------------------------------------------- /build/r1s-h5/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/r1s-h5/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | if [ "$suffix" = '-full' ];then 7 | # full 版本加大一些容量 8 | # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 9 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+117}' .config ) 10 | fi 11 | 12 | if [ -n "$rootfs_size" ];then 13 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 14 | fi 15 | -------------------------------------------------------------------------------- /build/r1s-h5/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/r1s-h5/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=r1s-h5 15 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/r1s-h5/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | 16 | # slim 固件本地 opkg 配置 17 | if ls -l /local_feed/*.ipk &>/dev/null;then 18 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 19 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 20 | # 取消签名,暂时解决不了 21 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 22 | fi 23 | 24 | 25 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 26 | uci set aliyundrive-webdav.@server[0].enable=0 27 | uci commit aliyundrive-webdav 28 | fi 29 | 30 | # 默认主题 31 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 32 | uci set luci.main.mediaurlbase='/luci-static/argonne' 33 | fi 34 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 35 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 36 | fi 37 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 38 | uci set luci.main.mediaurlbase='/luci-static/argon' 39 | fi 40 | uci commit luci 41 | # 此文件名注意ls 排序,下面也行 42 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 43 | # uci commit luci 44 | 45 | if [ -f /etc/config/qbittorrent ];then 46 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 47 | uci commit qbittorrent 48 | fi 49 | 50 | 51 | uci add_list system.ntp.server=120.25.115.20 52 | uci commit system 53 | 54 | touch /etc/crontabs/root 55 | chmod 0600 /etc/crontabs/root 56 | 57 | # 允许 wan 访问 openwrt web 58 | # uci set uhttpd.main.rfc1918_filter='0' 59 | # uci commit uhttpd 60 | 61 | # 允许 wan ssh 62 | uci delete dropbear.@dropbear[0].Interface 63 | uci commit dropbear 64 | # 配合下面的单个端口,或者放行整个段 65 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 66 | # 二级路由的话放行上层的 CIDR 即可 67 | 68 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 69 | cat >> /etc/firewall.user << EOF 70 | # 允许wan口指定网段访问,一般二级路由下需要 71 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 72 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 73 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 74 | EOF 75 | fi 76 | 77 | # 使用上面的 iptables 规则理论上也行 78 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 79 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 80 | # if [ -n "$line" ];then 81 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 82 | # fi 83 | 84 | # dnsmasq 85 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 86 | uci set dhcp.@dnsmasq[0].localservice='0' 87 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 88 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 89 | uci commit dhcp 90 | -------------------------------------------------------------------------------- /build/r1s-h5/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | 3 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 4 | 5 | echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-18.06-k5.4","addr":"https://github.com/immortalwrt/immortalwrt"}]' 6 | 7 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 8 | 9 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 10 | 11 | #echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 12 | -------------------------------------------------------------------------------- /build/r2s/README.md: -------------------------------------------------------------------------------- 1 | 2 | https://github.com/coolsnowwolf/lede/issues/5681 -------------------------------------------------------------------------------- /build/r2s/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/r2s/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/r2s/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+10}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # fi 13 | 14 | 15 | if [ "$suffix" = '-full' ];then 16 | [ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+42}' .config ) 17 | [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+88}' .config ) 18 | [[ "$repo_name" =~ 'DHDAXCW' ]] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+50}' .config ) 19 | fi 20 | 21 | if [ -n "$rootfs_size" ];then 22 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 23 | fi 24 | -------------------------------------------------------------------------------- /build/r2s/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/r2s/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=r2s 15 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/r2s/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/r2s/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | if ! grep -Eq '120.25.115.20' /etc/config/system;then 53 | uci add_list system.ntp.server=120.25.115.20 54 | uci commit system 55 | fi 56 | 57 | touch /etc/crontabs/root 58 | chmod 0600 /etc/crontabs/root 59 | 60 | # 允许 wan 访问 openwrt web 61 | # uci set uhttpd.main.rfc1918_filter='0' 62 | # uci commit uhttpd 63 | 64 | # 允许 wan ssh 65 | uci delete dropbear.@dropbear[0].Interface 66 | uci commit dropbear 67 | # 配合下面的单个端口,或者放行整个段 68 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 69 | # 二级路由的话放行上层的 CIDR 即可 70 | 71 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 72 | cat >> /etc/firewall.user << EOF 73 | # 允许wan口指定网段访问,一般二级路由下需要 74 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 76 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 77 | EOF 78 | fi 79 | 80 | # 使用上面的 iptables 规则理论上也行 81 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 82 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 83 | # if [ -n "$line" ];then 84 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 85 | # fi 86 | 87 | # dnsmasq 88 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 89 | uci set dhcp.@dnsmasq[0].localservice='0' 90 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 91 | if ! grep -Eq '223.5.5.5' /etc/config/dhcp;then 92 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 93 | fi 94 | uci commit dhcp 95 | -------------------------------------------------------------------------------- /build/r2s/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 7 | 8 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 11 | 12 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 13 | -------------------------------------------------------------------------------- /build/r4s/README.md: -------------------------------------------------------------------------------- 1 | 2 | https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4S/zh 3 | 4 | R4S【企业版】内置一颗具有全球唯一MAC地址的EEPROM芯片(型号:24AA025E48T),该MAC地址永久存在,且无法被修改。 5 | R4S【标准版】不带此芯片,但会根据其他硬件ID由软件自动生成一个MAC地址。除此之外,其他完全相同。 6 | 【标准版】不带全球唯一MAC地址芯片,【企业版】带全球唯一MAC地址芯片,【标准版】和【企业版】均使用同样的网卡芯片(RealTek RTL8211E 和R8111H),详细信息请查看下方硬件配置说明。个人用户可选择【标准版】,企业用户推荐选择【企业版】 7 | 8 | 9 | 先安装i2c工具, 用如下命令: 10 | ``` 11 | opkg install i2c-tools 12 | 13 | # 然后通过如下命令可以读取 EEPROM 中的 Mac Address, 仅适用于有 EEPROM 芯片的型号: 14 | 15 | i2ctransfer -y 2 w1@0x51 0xfa r6 16 | 17 | #会输出类拟如下格式的Mac Address: 18 | 19 | 0x68 0x27 0x19 0xa5 0x2d 0xdf 20 | 如果命令出错, 则表示没有内建EEPROM芯片. 21 | ``` 22 | 23 | 网卡驱动必须要 r8168 或者 8169 ,不要抄 https://github.com/SuLingGG/OpenWrt-Rpi/blob/31c574d043d65328d6c8d7fb9cab388941336445/config/rockchip/armv8.config#L36 24 | -------------------------------------------------------------------------------- /build/r4s/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/r4s/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/r4s/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | if [ "$suffix" = '-full' ];then 6 | if [ "$repo_name" == 'lede' ];then 7 | rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+74}' .config ) 8 | fi 9 | if [ "$repo_name" == 'immortalwrt' ] && [ "$repo_branch" == 'openwrt-18.06-k5.4' ];then 10 | # full 版本加大一些容量 11 | # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 12 | rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+118}' .config ) # 95 failed 13 | fi 14 | if [ "$repo_name" == 'DHDAXCW' ];then 15 | rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+94}' .config ) 16 | fi 17 | if [ -n "$rootfs_size" ];then 18 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 19 | fi 20 | fi -------------------------------------------------------------------------------- /build/r4s/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/r4s/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=r4s 15 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/r4s/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/r4s/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | # ipk 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | 16 | # slim 固件本地 opkg 配置 17 | if ls -l /local_feed/*.ipk &>/dev/null;then 18 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 19 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 20 | # 取消签名,暂时解决不了 21 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 22 | fi 23 | 24 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 25 | uci set aliyundrive-webdav.@server[0].enable=0 26 | uci commit aliyundrive-webdav 27 | fi 28 | 29 | # 默认主题 30 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 31 | uci set luci.main.mediaurlbase='/luci-static/argonne' 32 | fi 33 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 34 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 35 | fi 36 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 37 | uci set luci.main.mediaurlbase='/luci-static/argon' 38 | fi 39 | uci commit luci 40 | # 此文件名注意ls 排序,下面也行 41 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 42 | # uci commit luci 43 | 44 | if [ -f /etc/config/qbittorrent ];then 45 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 46 | uci commit qbittorrent 47 | fi 48 | 49 | 50 | if ! grep -Eq '120.25.115.20' /etc/config/system;then 51 | uci add_list system.ntp.server=120.25.115.20 52 | uci commit system 53 | fi 54 | 55 | touch /etc/crontabs/root 56 | chmod 0600 /etc/crontabs/root 57 | 58 | # 允许 wan 访问 openwrt web 59 | # uci set uhttpd.main.rfc1918_filter='0' 60 | # uci commit uhttpd 61 | 62 | # 允许 wan ssh 63 | uci delete dropbear.@dropbear[0].Interface 64 | uci commit dropbear 65 | # 配合下面的单个端口,或者放行整个段 66 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 67 | # 二级路由的话放行上层的 CIDR 即可 68 | 69 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 70 | cat >> /etc/firewall.user << EOF 71 | # 允许wan口指定网段访问,一般二级路由下需要 72 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 73 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 74 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | EOF 76 | fi 77 | 78 | # 使用上面的 iptables 规则理论上也行 79 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 80 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 81 | # if [ -n "$line" ];then 82 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 83 | # fi 84 | 85 | # dnsmasq 86 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 87 | uci set dhcp.@dnsmasq[0].localservice='0' 88 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 89 | if ! grep -Eq '223.5.5.5' /etc/config/dhcp;then 90 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 91 | fi 92 | uci commit dhcp 93 | -------------------------------------------------------------------------------- /build/r4s/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 下面日后适配天灵 4 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 7 | 8 | 9 | # echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 10 | 11 | # echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-18.06-k5.4","addr":"https://github.com/immortalwrt/immortalwrt"}]' 12 | 13 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"openwrt-18.06-k5.4","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 14 | 15 | #op21.02 target会变成r2s -------------------------------------------------------------------------------- /build/r5s/README.md: -------------------------------------------------------------------------------- 1 | ## 关于 2 | 3 | 刷机特殊,开机长按 mask 按键可以断掉 emmc 从 sd 卡启动,启动后会看不到 emmc 的块设备 4 | 刷机类似 doornet2,[教程](https://github.com/DHDAXCW/DoorNet2/blob/main/emmc.md) 5 | -------------------------------------------------------------------------------- /build/r5s/config/last.buildinfo: -------------------------------------------------------------------------------- 1 | # https://github.com/DHDAXCW/lede-rockchip/issues/1#issuecomment-1158375059 2 | # 凌动的网卡估计没人用 3 | # CONFIG_PACKAGE_kmod-rt2500-usb is not set 4 | # CONFIG_PACKAGE_kmod-rt2800-lib is not set 5 | # CONFIG_PACKAGE_kmod-rt2800-usb is not set 6 | # CONFIG_PACKAGE_kmod-rt2x00-lib is not set 7 | # CONFIG_PACKAGE_kmod-rt2x00-usb is not set 8 | # CONFIG_PACKAGE_kmod-rt73-usb is not set 9 | 10 | # https://github.com/immortalwrt/immortalwrt/discussions/718 11 | CONFIG_LIBMBEDTLS_HAVE_ARMV8CE_AES=n 12 | -------------------------------------------------------------------------------- /build/r5s/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | -------------------------------------------------------------------------------- /build/r5s/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 6 | # # full 版本加大一些容量 7 | # # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 8 | # rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+10}' .config ) 9 | # if [ -n "$rootfs_size" ];then 10 | # sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 11 | # fi 12 | # fi 13 | 14 | 15 | if [ "$suffix" = '-full' ];then 16 | [ "$repo_name" == 'lede' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+36}' .config ) 17 | # [ "$repo_name" == 'immortalwrt' ] && rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+8}' .config ) 18 | fi 19 | 20 | if [ -n "$rootfs_size" ];then 21 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 22 | fi 23 | -------------------------------------------------------------------------------- /build/r5s/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate 14 | 15 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 16 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 17 | 18 | # Uncomment a feed source 19 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 20 | 21 | # Add a feed source 22 | #echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 23 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 24 | 25 | 26 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 27 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 28 | -------------------------------------------------------------------------------- /build/r5s/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | 4 | UdateFeeds=true 5 | InstallFeeds=true 6 | 7 | UseCache=true 8 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 9 | AutoBuildTimeOut=true 10 | 11 | MakeDownload=true 12 | ClearPkg=false 13 | 14 | firmware_wildcard=r5s 15 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/cpufreq.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/coolsnowwolf/lede/issues/7844#issuecomment-966829782 2 | 3 | # change the voltage value for over-clock stablization 4 | config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'` 5 | if [ -n "$config_file_cpufreq" ];then 6 | truncate -s-1 $config_file_cpufreq 7 | sed -ri '/option (governor|minfreq|maxfreq)/d' $config_file_cpufreq 8 | echo -e "\toption governor 'schedutil'" >> $config_file_cpufreq 9 | echo -e "\toption minfreq '816000'" >> $config_file_cpufreq 10 | echo -e "\toption maxfreq '1512000'\n" >> $config_file_cpufreq 11 | fi 12 | 13 | 14 | # # luci-app-freq 15 | # svn export https://github.com/immortalwrt/luci/trunk/applications/luci-app-cpufreq feeds/luci/applications/luci-app-cpufreq 16 | # sed -i 's,600000 1608000,600000 1800000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 17 | # sed -i 's,600000 2016000,600000 2208000,g' feeds/luci/applications/luci-app-cpufreq/root/etc/uci-defaults/10-cpufreq 18 | # ln -sf ../../../feeds/luci/applications/luci-app-cpufreq package/feeds/luci/luci-app-cpufreq 19 | # pushd feeds/luci 20 | # git add applications/luci-app-cpufreq 21 | # git commit -am "add luci-app-cpufreq" 22 | # popd 23 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/aarch64_cortex-a53/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O $dir/${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget -q https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 9 | tar zxvf /tmp/clash-linux-armv8.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp/clash-linux-armv8.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/premium/clash-linux-armv8-${TUN_VERSION}.gz -O /tmp/clash-linux-armv8-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-armv8-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # meta 17 | #wget -q https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 18 | wget -q https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-armv8.tar.gz -O /tmp/clash-linux-armv8.tar.gz 19 | tar zxvf /tmp/clash-linux-armv8.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 20 | rm -f /tmp/clash* 21 | 22 | chmod a+x ${CLASH_CORE_PATH}/clash* 23 | fi 24 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/pwmfan.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/fanck0605/openwrt-nanopi-r2s/issues/9#issuecomment-767224902 2 | 3 | mkdir -p files/usr/bin/ files/etc/init.d/ files/etc/rc.d/ 4 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh \ 5 | -O files/usr/bin/start-rk3328-pwm-fan.sh 6 | 7 | wget https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan \ 8 | -O files/etc/init.d/fa-rk3328-pwmfan 9 | 10 | chmod 0755 files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan 11 | 12 | # 相对路径处理,符合规范 13 | ( 14 | cd files/etc/rc.d/ 15 | ln -sf ../init.d/fa-rk3328-pwmfan S96fa-rk3328-pwmfan 16 | ) 17 | -------------------------------------------------------------------------------- /build/r5s/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_arm 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/r5s/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | if ls -l /*_*_*.ipk 1>/dev/null;then 13 | opkg install /*_*_*.ipk 14 | rm -f /*_*_*.ipk 15 | fi 16 | 17 | # slim 固件本地 opkg 配置 18 | if ls -l /local_feed/*.ipk 1>/dev/null;then 19 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 20 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 21 | # 取消签名,暂时解决不了 22 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 23 | fi 24 | 25 | 26 | if [ -f /etc/uci-defaults/luci-aliyundrive-webdav ];then 27 | uci set aliyundrive-webdav.@server[0].enable=0 28 | uci commit aliyundrive-webdav 29 | fi 30 | 31 | # 默认主题 32 | if [ -d /usr/lib/lua/luci/view/themes/argonne/ ];then 33 | uci set luci.main.mediaurlbase='/luci-static/argonne' 34 | fi 35 | if [ -d /usr/lib/lua/luci/view/themes/argon_blue/ ];then 36 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 37 | fi 38 | if [ -d /usr/lib/lua/luci/view/themes/argon/ ];then 39 | uci set luci.main.mediaurlbase='/luci-static/argon' 40 | fi 41 | uci commit luci 42 | # 此文件名注意ls 排序,下面也行 43 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 44 | # uci commit luci 45 | 46 | if [ -f /etc/config/qbittorrent ];then 47 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 48 | uci commit qbittorrent 49 | fi 50 | 51 | 52 | if ! grep -Eq '120.25.115.20' /etc/config/system;then 53 | uci add_list system.ntp.server=120.25.115.20 54 | uci commit system 55 | fi 56 | 57 | touch /etc/crontabs/root 58 | chmod 0600 /etc/crontabs/root 59 | 60 | # 允许 wan 访问 openwrt web 61 | # uci set uhttpd.main.rfc1918_filter='0' 62 | # uci commit uhttpd 63 | 64 | # 允许 wan ssh 65 | uci delete dropbear.@dropbear[0].Interface 66 | uci commit dropbear 67 | # 配合下面的单个端口,或者放行整个段 68 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 69 | # 二级路由的话放行上层的 CIDR 即可 70 | 71 | if ! grep -Eq 'iptables -I input_wan_rule -s \S+\s+-j ACCEPT' /etc/firewall.user;then 72 | cat >> /etc/firewall.user << EOF 73 | # 允许wan口指定网段访问,一般二级路由下需要 74 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 75 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 76 | iptables -I forwarding_wan_rule -s 192.168.0.0/16 -j ACCEPT 77 | EOF 78 | fi 79 | 80 | # 使用上面的 iptables 规则理论上也行 81 | # r2s 只插 wan 下做旁路由时候,wan 的 zone 需要开 forward accept 82 | # line=`awk '/config zone/,/^\s*$/{if($2=="name" && $3~"wan"){a=1};if(a==1 && $2=="forward"){print NR}}' /etc/config/firewall` 83 | # if [ -n "$line" ];then 84 | # sed -ri "$line"'s#REJECT#ACCEPT#' /etc/config/firewall 85 | # fi 86 | 87 | # dnsmasq 88 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 89 | uci set dhcp.@dnsmasq[0].localservice='0' 90 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 91 | if ! grep -Eq '223.5.5.5' /etc/config/dhcp;then 92 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 93 | fi 94 | uci commit dhcp 95 | -------------------------------------------------------------------------------- /build/r5s/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | 4 | #echo '::set-output name=matrix::[{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | # https://github.com/DHDAXCW/NanoPi-R5S/issues/10#issuecomment-1227204518 7 | # 只用 lede 8 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 9 | 10 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"},{"name":"immortalwrt","branch":"openwrt-21.02","addr":"https://github.com/immortalwrt/immortalwrt"},{"name":"DHDAXCW","branch":"stable","addr":"https://github.com/DHDAXCW/lede-rockchip"}]' 11 | -------------------------------------------------------------------------------- /build/sft1200/clone.sh: -------------------------------------------------------------------------------- 1 | # 手动步骤参 clone.sh.old 2 | # 但是要适配我的缓存步骤,所以改造成下面的 3 | 4 | # wget https://raw.githubusercontent.com/gl-inet/gl-infra-builder/main/config-siflower-18.x.yml 5 | # revision=$(grep -Po 'revision:\s*\K\S+' config-siflower-18.x.yml ) 6 | # branch=$(grep -Po 'branch:\s*\K\S+' config-siflower-18.x.yml) 7 | # reset_commit=$revision 8 | 9 | # yml_file_path=$(readlink -f config-siflower-18.x.yml) 10 | 11 | # if [ "$CACHE" = false ];then 12 | # git clone https://github.com/Siflower/1806_SDK.git 13 | # ( 14 | # cd 1806_SDK 15 | # git checkout $branch 16 | # # 有 revision 就用 revision ,没就用 branch 17 | # [ -z "revision" ] && reset_commit=$branch 18 | # git fetch && git reset --hard origin/${reset_commit} && git clean -df 19 | # rm -rf profiles 20 | # ) 21 | 22 | # rm -rf 1806_SDK/openwrt-18.06/profiles/* 23 | # # 只有一个文件 gen_config.py 内容还是一样的,不过跟着 setup.py 走吧 24 | # svn export --force https://github.com/gl-inet/gl-infra-builder/trunk/scripts/ scripts 25 | 26 | # if grep -Pq 'files_folders' $yml_file_path;then 27 | # # 脚本里有 files_folders 拷贝,如果未来加上了这里没更新就报错 28 | # echo "需要更新此处逻辑" 29 | # exit 2 30 | # fi 31 | # # 打补丁 32 | # # 创建软链 33 | 34 | # fi 35 | 36 | 37 | if [ -d 'openwrt/.git' ]; then 38 | cd openwrt && rm -f zerospace && git config --local user.email "action@github.com" && git config --local user.name "GitHub Action" 39 | git fetch && git reset --hard origin/main && git clean -df 40 | else 41 | sudo chown $USER:$(id -gn) openwrt && git clone -b main --single-branch https://github.com/gl-inet/gl-infra-builder openwrt 42 | cd openwrt 43 | fi 44 | 45 | 46 | python3 setup.py -c config-siflower-18.x.yml 47 | cd openwrt-18.06/siflower/openwrt-18.06/ 48 | ./scripts/gen_config.py target_siflower_gl-sft1200 49 | 50 | 51 | ln -sf $PWD $GITHUB_WORKSPACE/openwrt 52 | 53 | 54 | echo "BaseDir=${PWD}" >> $GITHUB_ENV 55 | -------------------------------------------------------------------------------- /build/sft1200/clone.sh.old: -------------------------------------------------------------------------------- 1 | git clone https://github.com/gl-inet/gl-infra-builder.git 2 | cd gl-infra-builder 3 | 4 | 5 | # git config --global user.email "action@github.com" 6 | # git config --global user.name "GitHub Action" 7 | 8 | python3 setup.py -c config-siflower-18.x.yml 9 | cd openwrt-18.06/siflower/openwrt-18.06/ 10 | ./scripts/gen_config.py target_siflower_gl-sft1200 11 | 12 | 13 | ln -sf $PWD $GITHUB_WORKSPACE/openwrt 14 | 15 | 16 | echo "BaseDir=${PWD}" >> $GITHUB_ENV 17 | -------------------------------------------------------------------------------- /build/sft1200/diy-after-compile.sh: -------------------------------------------------------------------------------- 1 | # sft1200 不考虑做 slim 和 full,默认会生成 imagebuilder,这里干掉 2 | if [ -n "${GITHUB_RUN_NUMBER}" ];then 3 | rm -f $(dirname $(find openwrt/bin/targets/ -type f -name sha256sums ))/openwrt-*-root.squashfs 4 | #rm -f $(dirname $(find openwrt/bin/targets/ -type f -name sha256sums ))/*-imagebuilder-* 5 | fi 6 | true 7 | -------------------------------------------------------------------------------- /build/sft1200/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UdateFeeds=false 4 | InstallFeeds=false 5 | 6 | UseCache=true 7 | #=自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 8 | AutoBuildTimeOut=true 9 | 10 | MakeDownload=false 11 | ClearPkg=false 12 | -------------------------------------------------------------------------------- /build/sft1200/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | echo '::set-output name=matrix::[{"name":"glnet-openwrt", "branch":"18.06", "addr":"https://github.com/gl-inet/openwrt.git"}]' 3 | # 此步不重要,主要是 custom_pull.sh 4 | 5 | # 这个name避免走进公共的 diy.sh里 6 | -------------------------------------------------------------------------------- /build/x86_64/diy-after.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exclude_str=vmdk 3 | source $GITHUB_WORKSPACE/common/upload_docker_img.sh 4 | 5 | # cd openwrt-imagebuilder-*/bin/targets/*/* 6 | cd $FIRMWARE 7 | rm -f *-rootfs* 8 | rm -f *kernel.bin 9 | -------------------------------------------------------------------------------- /build/x86_64/diy-beforeMakeImage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -z "$suffix" ] && source $GITHUB_ENV 4 | 5 | # lede 的没开 ext4 的 img 文件生成,所以不需要这里增加容量 6 | 7 | if [ "$repo_name" == 'openwrt' ] && [ "$repo_branch" == 'openwrt-21.02' ] && [ "$suffix" = '-full' ];then 8 | # full 版本加大一些容量 9 | # 参考 https://forum.openwrt.org/t/how-to-set-root-filesystem-partition-size-on-x86-imabebuilder/4765/4?u=zhangguanzhang 10 | # 其实 670 + 60 多 squashfs 的就可以,但是 ext4 的 blocksize 是 4096 ,这俩格式又是一起打包的,这里测了下要 800 多M 11 | rootfs_size=$( awk -F= '/^CONFIG_TARGET_ROOTFS_PARTSIZE/{print $2+138}' .config ) 12 | if [ -n "$rootfs_size" ];then 13 | sed -ri '/^CONFIG_TARGET_ROOTFS_PARTSIZE=/s#=[0-9]+$#='"${rootfs_size}"'#' .config 14 | fi 15 | fi 16 | -------------------------------------------------------------------------------- /build/x86_64/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | #sed -i 's/192.168.1.1/192.168.100.254/g' package/base-files/files/bin/config_generate 14 | sed -i "s/timezone='UTC'/timezone='CST-8'/" package/base-files/files/bin/config_generate 15 | sed -i "/timezone='CST-8'/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set system.@system[-1].zonename='Asia/Shanghai'" package/base-files/files/bin/config_generate 16 | 17 | # Uncomment a feed source 18 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 19 | 20 | # Add a feed source 21 | echo 'src-git helloworld https://github.com/fw876/helloworld' >>feeds.conf.default 22 | #echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >>feeds.conf.default 23 | 24 | 25 | echo "src-git small https://github.com/kenzok8/small" >> feeds.conf.default 26 | echo "src-git others https://github.com/kenzok8/openwrt-packages" >> feeds.conf.default 27 | 28 | -------------------------------------------------------------------------------- /build/x86_64/diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part2.sh 10 | # Description: OpenWrt DIY script part 2 (After Update feeds) 11 | # 12 | 13 | # Modify default IP 14 | #sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate 15 | 16 | kernel_ver=$(grep -Po '^KERNEL_PATCHVER=\K\S+' target/linux/x86/Makefile) 17 | # 519 问题很多,回退到 515 18 | if [ "$build_target" = x86_64 ] && echo "$kernel_ver" | grep -Pq '5.1[89]';then 19 | sed -ri '/^KERNEL_PATCHVER=/s#'"${kernel_ver}"'#5.15#' target/linux/x86/Makefile 20 | fi 21 | 22 | # rtl8812bu 貌似无法工作 23 | # rm -rf package/kernel/rtl88x2bu 24 | # git clone --depth=1 -b openwrt-21.02 https://github.com/erintera/openwrt-rtl8812bu-package.git package/kernel/rtl88x2bu 25 | # echo 'CONFIG_PACKAGE_kmod-rtl88x2bu=y' >> .config 26 | 27 | 28 | 29 | # ----------- 提前打包一些文件,防止初次使用去下载 30 | # files下会合并到最终的 rootfs 里 31 | mkdir -p files 32 | # 初次开机设置脚本 33 | mkdir -p files/etc/uci-defaults/ 34 | cp ${GITHUB_WORKSPACE}/scripts/uci-defaults/* files/etc/uci-defaults/ 35 | chmod a+x files/etc/uci-defaults/* 36 | 37 | # 预处理下载相关文件,保证打包固件不用单独下载 38 | for sh_file in `ls ${GITHUB_WORKSPACE}/scripts/files/*.sh`;do 39 | source $sh_file 40 | done 41 | 42 | chmod a+x ${GITHUB_WORKSPACE}/build/scripts/*.sh 43 | # 放入升级脚本 44 | \cp -a ${GITHUB_WORKSPACE}/build/scripts/update.sh files/ 45 | 46 | 47 | # ---------- end ----------- 48 | 49 | # https://github.com/coolsnowwolf/lede/issues/8423 50 | # https://github.com/coolsnowwolf/packages/pull/315 回退后删掉这三行 51 | sed -i 's/^\s*$[(]call\sEnsureVendoredVersion/#&/' feeds/packages/utils/dockerd/Makefile 52 | -------------------------------------------------------------------------------- /build/x86_64/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | EnableDocker=true 3 | UdateFeeds=true 4 | InstallFeeds=true 5 | 6 | UseCache=true 7 | # 自动获取时间差,在缓存开启下,action的剩余6小时的最后半小时失败,保证后续上传缓存步骤运行 8 | AutoBuildTimeOut=true 9 | 10 | MakeDownload=true 11 | ClearPkg=true 12 | 13 | firmware_wildcard=x86-64 14 | 15 | # x86_64 还是使用 github release 的方式暂存缓存吧,其余的后面看看优化 16 | #cache_func=ghcr 17 | 18 | cache_release_name=cache-x86_64 19 | cache_repo=action_cache 20 | -------------------------------------------------------------------------------- /build/x86_64/scripts/files/adh.sh: -------------------------------------------------------------------------------- 1 | # adh 提前下载 2 | if grep -Eq '^CONFIG_PACKAGE_luci-app-adguardhome=y' .config;then 3 | 4 | # adgh_config=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/config/AdGuardHome') 5 | # if [ -n "${adgh_config}" ];then 6 | # sed -i '/configpath/s#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' ${adgh_config} 7 | # fi 8 | adh_initd_file=$(find feeds -type f -name AdGuardHome -path '*/luci-app-adguardhome/root/etc/init.d/AdGuardHome') 9 | if [ -n "$adh_initd_file" ];then 10 | # https://github.com/rufengsuixing/luci-app-adguardhome/issues/130 11 | SED_NUM=$(awk '/^start_service/,/configpath/{a=NR}END{print a}' feeds/others/luci-app-adguardhome/root/etc/init.d/AdGuardHome) 12 | sed -i "$SED_NUM"'a [ ! -f "${configpath}" ] && cp /usr/share/AdGuardHome/AdGuardHome_template.yaml ${configpath}' \ 13 | $adh_initd_file 14 | fi 15 | 16 | # 替换有问题 17 | # adg_makefile=$( find feeds -type f -name Makefile -path '*/luci-app-adguardhome/Makefile' ) 18 | # sed -i 's#/etc/AdGuardHome.yaml#/etc/config/AdGuardHome.yaml#' $adg_makefile 19 | fi 20 | -------------------------------------------------------------------------------- /build/x86_64/scripts/files/ipk.sh: -------------------------------------------------------------------------------- 1 | function download_ipk(){ 2 | local mirror_url=https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/packages/ 3 | local ipk_name=$1 dir=files/ 4 | local i=0 5 | while [ "$i" -le 5 ];do 6 | ipk_name=$(curl -s ${mirror_url} | grep -Po 'href="\K'$ipk_name'_\d[^"]+') 7 | [ -n "$ipk_name" ] && break 8 | let i++ 9 | done 10 | wget ${mirror_url}${ipk_name} -O ${dir}${ipk_name} 11 | } 12 | 13 | # such as: download_ipk grep 14 | -------------------------------------------------------------------------------- /build/x86_64/scripts/files/kodexplorer.sh: -------------------------------------------------------------------------------- 1 | # kodexplorer 提前下载 2 | # 会和 apcupsd 冲突 3 | # if grep -Eq '^CONFIG_PACKAGE_luci-app-kodexplorer=y' .config;then 4 | # mkdir -p files/opt/kodexplorer 5 | # # curl -s https://api.kodcloud.com/?app/version 6 | # wget --no-check-certificate https://static.kodcloud.com/update/download/kodbox.$( 7 | # curl -s https://api.github.com/repos/kalcaddle/kodbox/releases/latest | jq -r .name | cut -d " " -f 1 8 | 9 | # ).zip -O /tmp/kodbox.zip 10 | # unzip -q /tmp/kodbox.zip -d files/opt/kodexplorer 11 | # rm -f /tmp/kodbox.zip 12 | # fi 13 | -------------------------------------------------------------------------------- /build/x86_64/scripts/files/openclash.sh: -------------------------------------------------------------------------------- 1 | # /usr/share/openclash/clash_version.sh 2 | 3 | CLASH_CORE_PATH=files/etc/openclash/core/ 4 | 5 | if grep -Eq '^CONFIG_PACKAGE_luci-app-openclash=y' .config; then 6 | mkdir -p ${CLASH_CORE_PATH} 7 | # core 8 | wget https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-amd64.tar.gz -O /tmp/clash-linux-amd64.tar.gz 9 | tar zxvf /tmp/clash-linux-amd64.tar.gz -C ${CLASH_CORE_PATH} 10 | rm -f /tmp//tmp/clash-linux-amd64.tar.gz 11 | # tun 12 | TUN_VERSION=$(curl -sL --connect-timeout 10 --retry 2 \ 13 | https://raw.githubusercontent.com/vernesong/OpenClash/master/core_version -o - | sed -n '2p') 14 | wget https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-linux-amd64-${TUN_VERSION}.gz -O /tmp/clash-linux-amd64-${TUN_VERSION}.gz 15 | gzip -d /tmp/clash-linux-amd64-${TUN_VERSION}.gz --stdout > ${CLASH_CORE_PATH}/clash_tun 16 | # game 17 | wget https://github.com/vernesong/OpenClash/releases/download/TUN/clash-linux-amd64.tar.gz -O /tmp/clash-linux-amd64.tar.gz 18 | tar zxvf /tmp/clash-linux-amd64.tar.gz -O > ${CLASH_CORE_PATH}/clash_game 19 | rm -f /tmp/clash* 20 | 21 | chmod a+x ${CLASH_CORE_PATH}/clash* 22 | fi 23 | -------------------------------------------------------------------------------- /build/x86_64/scripts/files/udp2raw.sh: -------------------------------------------------------------------------------- 1 | if [ 1 -eq 1 ];then 2 | udp_raw_file=udp2raw_amd64_hw_aes 3 | svn export https://github.com/sensec/luci-app-udp2raw/trunk package/custom/luci-app-udp2raw 4 | VERSION=latest url=$( curl -sL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/${VERSION} | \ 5 | jq -r '.assets[]| select(.name=="udp2raw_binaries.tar.gz") | .browser_download_url' ) 6 | if [ -n "$url" ];then 7 | wget $url -O - | \ 8 | tar -zxvf - -C . ${udp_raw_file} 9 | upx -9 ${udp_raw_file} 10 | mkdir -p package/custom/luci-app-udp2raw/files/root/usr/bin/ 11 | sed -ri 's#\s隧道##' package/custom/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po 12 | mv ${udp_raw_file} package/custom/luci-app-udp2raw/files/root/usr/bin/udp2raw 13 | if ! grep -qw 'files/root/usr/bin/udp2raw' package/custom/luci-app-udp2raw/Makefile;then 14 | sed -i "/\/root\/etc\/init.d\/udp2raw/r "<( 15 | cat <<'EOF' | sed -r 's#^\s+#\t#' 16 | $(INSTALL_DIR) $(1)/usr/bin 17 | $(INSTALL_DATA) ./files/root/usr/bin/udp2raw $(1)/usr/bin/udp2raw 18 | chmod 0755 $(1)/usr/bin/udp2raw 19 | EOF 20 | ) package/custom/luci-app-udp2raw/Makefile 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /build/x86_64/scripts/uci-defaults/zzz-default-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change default shell to bash 4 | if [ -f /bin/bash ];then 5 | sed -i '/^root:/s#/bin/ash#/bin/bash#' /etc/passwd 6 | fi 7 | # 同时开 bash 和 zsh 的话有上面优先 8 | if [ -f /bin/zsh ];then 9 | sed -i '/^root:/s#/bin/ash#/bin/zsh#' /etc/passwd 10 | fi 11 | 12 | opkg install /*_*_*.ipk 13 | rm -f /*_*_*.ipk 14 | 15 | # slim 固件本地 opkg 配置 16 | if ls -l /local_feed/*.ipk &>/dev/null;then 17 | sed -ri 's@^[^#]@#&@' /etc/opkg/distfeeds.conf 18 | grep -E '/local_feed' /etc/opkg/customfeeds.conf || echo 'src/gz local file:///local_feed' >> /etc/opkg/customfeeds.conf 19 | # 取消签名,暂时解决不了 20 | sed -ri '/check_signature/s@^[^#]@#&@' /etc/opkg.conf 21 | fi 22 | 23 | uci set aliyundrive-webdav.@server[0].enable=0 24 | uci commit aliyundrive-webdav 25 | 26 | if ! grep -Eq '120.25.115.20' /etc/config/system;then 27 | uci add_list system.ntp.server=120.25.115.20 28 | uci commit system 29 | fi 30 | 31 | uci set luci.main.mediaurlbase='/luci-static/argon_blue' 32 | uci commit luci 33 | # 此文件名注意ls 排序,下面也行 34 | # sed -ri "/option mediaurlbase/s#(/luci-static/)[^']+#\1argon_blue#" /etc/config/luci 35 | # uci commit luci 36 | 37 | if [ -f /etc/config/qbittorrent ];then 38 | uci set qbittorrent.main.AnnounceToAllTrackers='true' 39 | uci commit qbittorrent 40 | fi 41 | 42 | touch /etc/crontabs/root 43 | chmod 0600 /etc/crontabs/root 44 | 45 | # 允许 wan ssh 46 | uci delete dropbear.@dropbear[0].Interface 47 | uci commit dropbear 48 | # 配合下面的单个端口,或者放行整个段 49 | # iptables -I input_wan_rule -p tcp -m tcp --dport 22 -j ACCEPT 50 | # 二级路由的话放行上层的 CIDR 即可 51 | cat >> /etc/firewall.user << EOF 52 | # 允许wan口指定网段访问,一般二级路由下需要 53 | iptables -I input_wan_rule -s 192.168.0.0/16 -j ACCEPT 54 | EOF 55 | 56 | # dnsmasq 57 | uci set dhcp.@dnsmasq[0].rebind_protection='0' 58 | uci set dhcp.@dnsmasq[0].localservice='0' 59 | uci set dhcp.@dnsmasq[0].nonwildcard='0' 60 | if ! grep -Eq '223.5.5.5' /etc/config/dhcp;then 61 | uci add_list dhcp.@dnsmasq[0].server='223.5.5.5#53' 62 | fi 63 | uci commit dhcp 64 | -------------------------------------------------------------------------------- /build/x86_64/set_matrix.sh: -------------------------------------------------------------------------------- 1 | # 要 json raw 字符串 2 | #echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"}]' 3 | # 下面日后适配天灵 4 | # echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"immortalwrt","branch":"master","addr":"https://github.com/immortalwrt/immortalwrt"}]' 5 | 6 | echo '::set-output name=matrix::[{"name":"lede","branch":"master","addr":"https://github.com/coolsnowwolf/lede"},{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 7 | #echo '::set-output name=matrix::[{"name":"openwrt","branch":"openwrt-21.02","addr":"https://github.com/openwrt/openwrt"}]' 8 | --------------------------------------------------------------------------------