diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 311f92e50..96a47a25f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,19 +1,8 @@ -name: Build releases +name: Build OpenWrt on: workflow_dispatch: inputs: - device: - description: 'Select the build device' - required: true - default: 'x86_64' - type: choice - options: - - 'armv8' - - 'nanopi-r4s' - - 'nanopi-r5s' - - 'netgear_r8500' - - 'x86_64' version: description: 'Select the build version' required: true @@ -25,11 +14,11 @@ on: ccache: description: 'Enable ccache (Use Cache to speed up next build)' type: boolean - default: false + default: true lan_addr: description: 'Setting default LAN address' required: true - default: '10.0.0.1' + default: '172.16.1.1' type: string build_options: description: 'Build options (separate multiple options with spaces)' @@ -39,8 +28,14 @@ on: jobs: build: - name: Build ${{ github.event.inputs.device }} + name: Build ${{ matrix.device }} runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + device: + - x86_64 + - nanopi-r5s defaults: run: shell: bash @@ -50,7 +45,7 @@ jobs: continue-on-error: true uses: actions/checkout@main with: - path: r4s_build_script + path: opwrt_build_script - name: Setup variables run: | @@ -58,6 +53,7 @@ jobs: git config --global user.name 'actions' git config --global user.email 'action@github.com' echo build_dir="/builder" >> "$GITHUB_ENV" + [ "${{ matrix.device }}" = x86_64 ] && echo arch="x86_64" >> "$GITHUB_ENV" || echo arch="aarch64_generic" >> "$GITHUB_ENV" [ "${{ github.event.inputs.version }}" = release ] && echo build_version="rc2" >> "$GITHUB_ENV" || echo build_version="dev" >> "$GITHUB_ENV" - name: Show system @@ -79,7 +75,7 @@ jobs: sudo curl -sL -o /usr/bin/caddy https://github.com/sbwml/r4s_build_script/releases/download/caddy/caddy sudo chmod 755 /usr/bin/caddy echo ":8080 {" > caddyfile - echo " root * $(pwd)/r4s_build_script" >> caddyfile + echo " root * $(pwd)/opwrt_build_script" >> caddyfile echo " file_server browse" >> caddyfile echo "}" >> caddyfile sudo /usr/bin/caddy start --config caddyfile --adapter caddyfile @@ -96,25 +92,25 @@ jobs: uses: sbwml/actions@install-llvm - name: Restore Cached - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device != 'armv8' && github.event.inputs.device != 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device != 'armv8' && matrix.device != 'nanopi-r4s' }} uses: actions/cache/restore@v4 with: path: /builder/.ccache - key: openwrt-24.10-${{ github.event.inputs.device }}-ccache + key: openwrt-24.10-${{ matrix.device }}-ccache - name: Restore Cached (releases) - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device == 'armv8' || github.event.inputs.device == 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device == 'armv8' || matrix.device == 'nanopi-r4s' }} continue-on-error: true working-directory: /builder run: | - curl -s https://api.github.com/repos/${{ github.repository }}/releases | grep 'browser_download_url' | grep ccache | grep ${{ github.event.inputs.device }} | awk -F '"' '{print $4}' | grep -v '^$' | xargs -n 1 wget -q - cat ${{ github.event.inputs.device }}.tar.* | tar -xf - || true - rm -rf ${{ github.event.inputs.device }}.tar.* || true + curl -s https://api.github.com/repos/${{ github.repository }}/releases | grep 'browser_download_url' | grep ccache | grep ${{ matrix.device }} | awk -F '"' '{print $4}' | grep -v '^$' | xargs -n 1 wget -q + cat ${{ matrix.device }}.tar.* | tar -xf - || true + rm -rf ${{ matrix.device }}.tar.* || true [ -d .ccache ] && cache_size=$(du -sb .ccache | awk '{print $1}') || cache_size=0 cache_size_mb=$(echo "scale=0; ${cache_size} / (1024 * 1024)" | bc) echo "Cache Size: ~${cache_size_mb} MB (${cache_size} B)" echo "Cache restored successfully" - echo "Cache restored from key: ${{ github.event.inputs.device }}" + echo "Cache restored from key: ${{ matrix.device }}" - name: Compile OpenWrt working-directory: /builder @@ -123,14 +119,15 @@ jobs: run: | export ${{ github.event.inputs.build_options }} LAN=${{ github.event.inputs.lan_addr }} USE_GCC15=y [ ${{ github.event.inputs.ccache }} = 'true' ] && export ENABLE_CCACHE=y - bash <(curl -sS http://127.0.0.1:8080/build.sh) ${{ env.build_version }} ${{ github.event.inputs.device }} + bash <(curl -sS http://127.0.0.1:8080/build.sh) ${{ env.build_version }} ${{ matrix.device }} cd openwrt if [ "${{ github.event.inputs.version }}" = release ]; then tags=OpenWrt-$(git describe --abbrev=0 --tags) else tags=snapshot-24.10-$(git log -n 1 --date=format:"%Y%m%d" --format="%cd")-$(git log --pretty=format:"%h" -1) fi - echo "latest_release=$tags" >>$GITHUB_ENV + kernel=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/master/tags/kernel-6.12" | awk -F"LINUX_KERNEL_HASH-| =" '/LINUX_KERNEL_HASH/{print $2}') + echo "latest_release=$tags-k$kernel" >>$GITHUB_ENV - name: Extensive logs after a failed compilation working-directory: /builder @@ -140,33 +137,33 @@ jobs: make V=s - name: Delete Cached - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device != 'armv8' && github.event.inputs.device != 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device != 'armv8' && matrix.device != 'nanopi-r4s' }} continue-on-error: true working-directory: /builder env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} run: | - gh cache delete openwrt-24.10-${{ github.event.inputs.device }}-ccache || true + gh cache delete openwrt-24.10-${{ matrix.device }}-ccache || true - name: Save Cached - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device != 'armv8' && github.event.inputs.device != 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device != 'armv8' && matrix.device != 'nanopi-r4s' }} continue-on-error: true uses: actions/cache/save@v4 with: path: /builder/.ccache - key: openwrt-24.10-${{ github.event.inputs.device }}-ccache + key: openwrt-24.10-${{ matrix.device }}-ccache - name: Create ccache tar files - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device == 'armv8' || github.event.inputs.device == 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device == 'armv8' || matrix.device == 'nanopi-r4s' }} continue-on-error: true working-directory: /builder run: | mkdir -p ccache - tar cf - .ccache | split -d -b 1800m - ccache/${{ github.event.inputs.device }}.tar. + tar cf - .ccache | split -d -b 1800m - ccache/${{ matrix.device }}.tar. - name: Upload Cached (releases - ccache) - if: ${{ github.event.inputs.ccache == 'true' && github.event.inputs.device == 'armv8' || github.event.inputs.device == 'nanopi-r4s' }} + if: ${{ github.event.inputs.ccache == 'true' && matrix.device == 'armv8' || matrix.device == 'nanopi-r4s' }} continue-on-error: true uses: ncipollo/release-action@v1.14.0 with: @@ -184,49 +181,28 @@ jobs: working-directory: /builder run: | mkdir -p rom info - if [ "${{ github.event.inputs.device }}" = "nanopi-r4s" ]; then - cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ - cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt - cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo - cd rom && sha256sum *gz > ../info/sha256sums.txt - elif [ "${{ github.event.inputs.device }}" = "nanopi-r5s" ]; then - cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ - cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt - cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo - cd rom && sha256sum *gz > ../info/sha256sums.txt - elif [ "${{ github.event.inputs.device }}" = "x86_64" ]; then - cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + if [ "${{ matrix.device }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*-r5s-squashfs-sysupgrade.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest-r5s.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config-r5s.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums-r5s.txt + elif [ "${{ matrix.device }}" = "x86_64" ]; then cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ - cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/ - cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt - cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo - cd rom && sha256sum *gz > ../info/sha256sums.txt - elif [ "${{ github.event.inputs.device }}" = "netgear_r8500" ]; then - cp -a openwrt/bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk rom/ - cp -a openwrt/bin/targets/bcm53xx/generic/*.manifest info/manifest.txt - cp -a openwrt/bin/targets/bcm53xx/generic/config.buildinfo info/config.buildinfo - cd rom && sha256sum * > ../info/sha256sums.txt - elif [ "${{ github.event.inputs.device }}" = "armv8" ]; then - tar zcf rom/u-boot-qemu_armv8.tar.gz -C openwrt/bin/targets/armsr/armv8*/ ./u-boot-qemu_armv8 - cp -a openwrt/bin/targets/armsr/armv8*/*-generic-initramfs-kernel.bin rom/ - cp -a openwrt/bin/targets/armsr/armv8*/*-generic-kernel.bin rom/ - cp -a openwrt/bin/targets/armsr/armv8*/*-generic-ext4-combined-efi.img.gz rom/ - cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz rom/ - cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/ - cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt - cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo - cd rom && sha256sum * > ../info/sha256sums.txt + cp -a openwrt/bin/targets/x86/*/*-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest-x86.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config-x86.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums-x86.txt fi - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: ${{ github.event.inputs.device }}-openwrt-${{ env.latest_release }} + name: ${{ matrix.device }}-openwrt-${{ env.latest_release }} path: ${{ env.build_dir }}/rom/* - name: Create release continue-on-error: true - uses: ncipollo/release-action@v1 + uses: ncipollo/release-action@v1.14.0 with: name: ${{ env.latest_release }} allowUpdates: true @@ -234,4 +210,12 @@ jobs: commit: master replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ env.build_dir }}/rom/* + artifacts: "${{ env.build_dir }}/rom/*,${{ env.build_dir }}/info/*" + + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 2 diff --git a/README.md b/README.md index bfc40f0f3..1b7afdd9b 100644 --- a/README.md +++ b/README.md @@ -1,247 +1,75 @@ -# NanoPi R4S/R5S/R5C & X86_64 OpenWrt 简易构建脚本存档 +# opwrt_build_script -### 存档来自:https://init2.cooluc.com +### 基于 Linux 6.12 固件下载: ---------------- - -## 基于 Linux 6.6/6.12 LTS 固件下载: - -#### NanoPi R4S: https://r4s.cooluc.com - -#### NanoPi R5S/R5C: https://r5s.cooluc.com - -#### X86_64: https://x86.cooluc.com - -#### Snapshot 24.10: https://snapshot.cooluc.com - -#### 构建来源: https://github.com/sbwml/builder - ---------------- - -## 本地编译环境安装(根据 debian 11 / ubuntu 22) -```shell -sudo apt-get update -sudo apt-get install -y build-essential flex bison g++ gawk gcc-multilib g++-multilib gettext git libfuse-dev libncurses5-dev libssl-dev python3 python3-pip python3-ply python3-distutils python3-pyelftools rsync unzip zlib1g-dev file wget subversion patch upx-ucl autoconf automake curl asciidoc binutils bzip2 lib32gcc-s1 libc6-dev-i386 uglifyjs msmtp texinfo libreadline-dev libglib2.0-dev xmlto libelf-dev libtool autopoint antlr3 gperf ccache swig coreutils haveged scons libpython3-dev jq -``` - ---------------- - -### 启用 [Clang/LLVM](https://docs.kernel.org/kbuild/llvm.html) 构建内核 -##### 脚本支持使用 Clang/LLVM 构建内核,NanoPi & X86_64 设备将同时启用 LLVM LTO 链接时优化,这会增加编译的时间,但会获得更优的性能 -##### 只需在构建固件前执行以下命令即可启用 Clang/LLVM 构建内核与内核模块 - -``` -export KERNEL_CLANG_LTO=y -``` - -### 启用 [GCC13](https://gcc.gnu.org/gcc-13/)/[GCC14](https://gcc.gnu.org/gcc-14/)/[GCC15](https://gcc.gnu.org/gcc-15/) 工具链编译 -##### 只需在构建固件前执行以下命令即可启用 GCC13/GCC14/GCC15 交叉工具链 - -``` -# GCC13 -export USE_GCC13=y -``` - -``` -# GCC14 -export USE_GCC14=y -``` - -``` -# GCC15 -export USE_GCC15=y -``` - -### 启用 [LTO](https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html) 优化 -##### 只需在构建固件前执行以下命令即可启用编译器 LTO 优化 - -``` -export ENABLE_LTO=y -``` - -### 启用 [MOLD](https://github.com/rui314/mold) 现代链接器(需要启用 `USE_GCC13=y` 或 `USE_GCC14=y` 或 `USE_GCC15=y`) -##### 只需在构建固件前执行以下命令即可启用 MOLD 链接,如果使用它建议同时启用 LTO 优化 - -``` -export ENABLE_MOLD=y -``` - -### 启用 [eBPF](https://docs.kernel.org/bpf/) 支持 -##### 只需在构建固件前执行以下命令即可启用 eBPF 支持 - -``` -export ENABLE_BPF=y -``` - -### 启用 [LRNG](https://github.com/smuellerDD/lrng) -##### 只需在构建固件前执行以下命令即可启用 LRNG 内核随机数支持 - -``` -export ENABLE_LRNG=y -``` - -### 启用 [Glibc](https://www.gnu.org/software/libc/) 库构建 (实验性) -##### 启用 glibc 库进行构建时,构建的固件将会同时兼容 musl/glibc 的预构建二进制程序,但缺失 `opkg install` 安装源支持 -##### 只需在构建固件前执行以下命令即可启用 glibc 构建 - -``` -export ENABLE_GLIBC=y -``` - -### 启用本地 Kernel Modules 安装源 (For developers) -##### 启用该标志时,将会拷贝全部 target packages 到 rootfs 并替换 openwrt_core 源为本地方式,以供离线 `opkg install kmod-xxx` 安装操作 -##### 这会增加固件文件大小(大约 70MB),对项目内核版本、模块、补丁 有修改的需求时,该功能可能会有用 -##### 只需在构建固件前执行以下命令即可启用本地 Kernel Modules 安装源 - -``` -export ENABLE_LOCAL_KMOD=y -``` +x86_64 & R5S: +[Github](https://github.com/JohnsonRan/opwrt_build_script/releases) -### 启用 [DPDK](https://www.dpdk.org/) 支持 -##### DPDK(Data Plane Development Kit)是一个开源工具集,专为加速数据包处理而设计,通过优化的数据平面技术,实现高性能、低延迟的网络应用 -##### 只需在构建固件前执行以下命令即可启用 DPDK 工具集支持 - -``` -export ENABLE_DPDK=y ``` +【首次登陆】 +地址:172.16.1.1(默认) +用户:root +密码:空 -### 快速构建(仅限 Github Actions) -##### 脚本会使用 [toolchain](https://github.com/sbwml/toolchain-cache) 缓存代替源码构建,与常规构建相比能节省大约 60 分钟的编译耗时,仅适用于 Github Actions `ubuntu-24.04` 环境 -##### 只需在构建固件前执行以下命令即可启用快速构建 - -``` -export BUILD_FAST=y -``` - -### 构建 Minimal 版本 -##### 不包含第三方插件,接近官方 OpenWrt 固件 -##### 只需在构建固件前执行以下命令即可构建 Minimal 版本 - -``` -export MINIMAL_BUILD=y -``` - -### 更改 LAN IP 地址 -##### 自定义默认 LAN IP 地址 -##### 只需在构建固件前执行以下命令即可覆盖默认 LAN 地址(默认:10.0.0.1) - -``` -export LAN=10.0.0.1 -``` - -### 使用 uhttpd 轻量 web 引擎 -##### 固件默认使用 Nginx(quic) 作为页面引擎,只需在构建固件前执行以下命令即可使用 uhttpd 取代 nginx -##### Nginx 在具备公网的环境下可以提供更丰富的功能支持 - -``` -export ENABLE_UHTTPD=y -``` - -### 禁用全模块编译(For developers) -##### 启用该标志时,固件仅编译 config 指定的软件包和内核模块,但固件不再支持安装内核模块(opkg install kmod-xxx),强制安装模块将会导致内核崩溃 -##### 最大的可能性降低 OpenWrt 的编译耗时,适用于开发者调试构建 - -``` -export NO_KMOD=y +【分区挂载】 +系统 -> 磁盘管理 -> 磁盘 -> 编辑 +系统 -> 挂载点 ``` --------------- -## 构建 OpenWrt 24.10 最新 Releases - -### nanopi-r4s -```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r4s -``` +- 优化系统内核 + - [x] Full Cone NAT + - [x] TCP BBRv3 + - [x] TCP Brutal + - [x] eBPF + - [x] Shortcut-FE + - [x] RTC 时钟 + - [x] O3、LTO、MOLD、LRNG -### nanopi-r5s/r5c -```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r5s -``` +|⚙️ 系统 | ⚓ 服务 | 🐳 Docker | 🩺 网络 | +| :---- | :---- | :---- | :---- | +| TTYd | Tailscale | DockerMan | 网速测试 | +| DiskMan | Watchcat | Docker Compose | WireGuard | +| Argon 设置 | MihomoTProxy ||| -### x86_64 -```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 x86_64 -``` +------ +### DDNS +固件内置 [kkkgo/UE-DDNS](https://github.com/kkkgo/UE-DDNS) +- 只需要在终端输入 `ue-ddns` 即可快速配置DDNS脚本,并支持hotplug接口(可实现网卡IP变动时,自动执行脚本) +- 支持消息通知,具体请查看 [官方文档](https://blog.03k.org/post/ue-ddns.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E9%80%89%E9%A1%B9%E5%92%8C%E6%B6%88%E6%81%AF%E9%80%9A%E7%9F%A5) -## 构建 OpenWrt 24.10 开发版(24.10-SNAPSHOT) +### RTC 硬件时钟 -### nanopi-r4s -```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r4s -``` +**本固件支持 RTC 硬件时钟读取/同步,当设备断电时,重新通电启动系统时间不会错乱** *(注意:设备需要安装 RTC 电池后使用)* -### nanopi-r5s/r5c -```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r5s -``` +**首次安装 RTC 电池写入时间命令** -### x86_64 ```shell -# linux-6.12 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev x86_64 +hwclock -w -f /dev/rtc0 ``` ------------------ - -# 基于本仓库进行自定义构建 - 本地编译 - -#### 如果你有自定义的需求,建议不要变更内核版本号,这样构建出来的固件可以直接使用 `opkg install kmod-xxxx` - -### 一、Fork 本仓库到自己 GitHub 存储库 - -### 二、修改构建脚本文件:`openwrt/build.sh`(使用 Github Actions 构建时无需更改) - -将 init.cooluc.com 脚本默认连接替换为你的 github raw 连接,像这样 `https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master` +**测试时间读取(返回当前时间表示正常)** -```diff - # script url - if [ "$isCN" = "CN" ]; then -- export mirror=https://init.cooluc.com -+ export mirror=https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master - else -- export mirror=https://init2.cooluc.com -+ export mirror=https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master - fi -``` - -### 三、在本地 Linux 执行基于你自己仓库的构建脚本,即可编译所需固件 - -#### nanopi-r4s openwrt-24.10 ```shell -# linux-6.12 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 nanopi-r4s +hwclock -f /dev/rtc0 ``` +### Node exporter +https://github.com/JohnsonRan/packages_utils_node_exporter +- 需配合 Grafana + Prometheus 使用 +- 端口为默认 `9100` +- 若不需要直接前往软件包处删除 `node_exporter` 即可 -#### nanopi-r5s/r5c openwrt-24.10 -```shell -# linux-6.12 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 nanopi-r5s -``` +### Speedtest-EX +https://github.com/JohnsonRan/packages_net_speedtest-ex +- 配置文件位于 `/etc/speedtest-ex/config.toml` +- 默认运行在:http://172.16.1.1:8989 +- 若不需要直接前往软件包处删除 `speedtest-ex` 即可 -#### x86_64 openwrt-24.10 -```shell -# linux-6.12 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 x86_64 +### boltbrowser +https://github.com/JohnsonRan/packages_utils_boltbrowser +- 可视化查看 mihomo 的 `cache.db` ``` - ------------------ - -# 使用 Github Actions 构建 - -### 一、Fork 本仓库到自己 GitHub 存储库 - -### 二、构建固件 - -- 在存储库名称下,单击(Actions Actions)。 - -- 在左侧边栏中,单击要运行的工作流的名称:**Build releases**。 - -- 在工作流运行的列表上方,单击“**Run workflow**”按钮,选择要构建的设备固件并运行工作流。 - - ![image](https://github.com/user-attachments/assets/3eae2e9f-efe6-48ad-8e9d-39c176fcd71c) +boltbrowser /etc/mihomo/run/cache.db +``` +- 若不需要直接前往软件包处删除 `boltbrowser` 即可 \ No newline at end of file diff --git a/openwrt/24-config-common b/openwrt/24-config-common index 45284a687..d547315a8 100644 --- a/openwrt/24-config-common +++ b/openwrt/24-config-common @@ -60,6 +60,7 @@ CONFIG_DOCKER_STO_BTRFS=y CONFIG_DOCKER_STO_EXT4=y CONFIG_PACKAGE_luci-app-dockerman=y CONFIG_PACKAGE_luci-lib-docker=y +CONFIG_PACKAGE_docker-compose=y ### Luci CONFIG_PACKAGE_luci=y @@ -71,8 +72,8 @@ CONFIG_PACKAGE_luci-lib-nixio=y CONFIG_PACKAGE_luci-nginx=y CONFIG_PACKAGE_luci-proto-wireguard=y CONFIG_PACKAGE_luci-theme-argon=y -CONFIG_PACKAGE_luci-theme-material=y -CONFIG_PACKAGE_luci-theme-openwrt-2020=y +# CONFIG_PACKAGE_luci-theme-material is not set +# CONFIG_PACKAGE_luci-theme-openwrt-2020 is not set CONFIG_LUCI_LANG_zh_Hans=y # CONFIG_LUCI_CSSTIDY is not set # CONFIG_LUCI_JSMIN is not set @@ -94,54 +95,101 @@ CONFIG_NGINX_HTTP_SUB=y CONFIG_NGINX_STREAM_REAL_IP=y ### APPS -CONFIG_PACKAGE_luci-app-airconnect=y -CONFIG_PACKAGE_luci-app-airplay2=y -CONFIG_PACKAGE_luci-app-alist=y +# CONFIG_PACKAGE_luci-app-airconnect is not set +# CONFIG_PACKAGE_luci-app-airplay2 is not set +# CONFIG_PACKAGE_luci-app-alist is not set CONFIG_PACKAGE_luci-app-argon-config=y -CONFIG_PACKAGE_luci-app-aria2=y -CONFIG_PACKAGE_luci-app-autoreboot=y +# CONFIG_PACKAGE_luci-app-aria2 is not set +# CONFIG_PACKAGE_luci-app-autoreboot is not set CONFIG_PACKAGE_luci-app-commands=y CONFIG_PACKAGE_luci-app-cpufreq=y -CONFIG_PACKAGE_luci-app-ddns=y +# CONFIG_PACKAGE_luci-app-ddns is not set CONFIG_PACKAGE_luci-app-diskman=y -CONFIG_PACKAGE_luci-app-eqos=y -CONFIG_PACKAGE_luci-app-filemanager=y -CONFIG_PACKAGE_luci-app-frpc=y -CONFIG_PACKAGE_luci-app-mentohust=y -CONFIG_PACKAGE_luci-app-mosdns=y -CONFIG_PACKAGE_luci-app-natmap=y +# CONFIG_PACKAGE_luci-app-eqos is not set +# CONFIG_PACKAGE_luci-app-filemanager is not set +# CONFIG_PACKAGE_luci-app-frpc is not set +# CONFIG_PACKAGE_luci-app-mentohust is not set +# CONFIG_PACKAGE_luci-app-mosdns is not set +# CONFIG_PACKAGE_luci-app-natmap is not set CONFIG_PACKAGE_luci-app-netspeedtest=y -CONFIG_PACKAGE_luci-app-nlbwmon=y -CONFIG_PACKAGE_luci-app-oaf=y -CONFIG_PACKAGE_luci-app-qbittorrent=y +# CONFIG_PACKAGE_luci-app-nlbwmon is not set +# CONFIG_PACKAGE_luci-app-oaf is not set +# CONFIG_PACKAGE_luci-app-qbittorrent is not set CONFIG_PACKAGE_luci-app-ramfree=y -CONFIG_PACKAGE_luci-app-samba4=y -CONFIG_PACKAGE_luci-app-socat=y -CONFIG_PACKAGE_luci-app-sqm=y +# CONFIG_PACKAGE_luci-app-samba4 is not set +# CONFIG_PACKAGE_luci-app-socat is not set +# CONFIG_PACKAGE_luci-app-sqm is not set CONFIG_PACKAGE_luci-app-ttyd=y # CONFIG_PACKAGE_luci-app-unblockneteasemusic is not set -CONFIG_PACKAGE_luci-app-upnp=y -CONFIG_PACKAGE_luci-app-usb-printer=y -CONFIG_PACKAGE_luci-app-vlmcsd=y +# CONFIG_PACKAGE_luci-app-upnp is not set +# CONFIG_PACKAGE_luci-app-usb-printer is not set +# CONFIG_PACKAGE_luci-app-vlmcsd is not set CONFIG_PACKAGE_luci-app-watchcat=y -CONFIG_PACKAGE_luci-app-webdav=y -CONFIG_PACKAGE_luci-app-wolplus=y -CONFIG_PACKAGE_luci-app-zerotier=y -CONFIG_PACKAGE_ariang-nginx=y +# CONFIG_PACKAGE_luci-app-webdav is not set +# CONFIG_PACKAGE_luci-app-wolplus is not set +# CONFIG_PACKAGE_luci-app-zerotier is not set +# CONFIG_PACKAGE_ariang-nginx is not set ### ImmortalWrt Proxy - nft -CONFIG_PACKAGE_luci-app-homeproxy=y +# CONFIG_PACKAGE_luci-app-homeproxy is not set + +### Mihomo +CONFIG_PACKAGE_luci-app-mihomo=y + +### QoSmate +# CONFIG_PACKAGE_luci-app-qosmate is not set + +### tailscale +CONFIG_PACKAGE_luci-app-tailscale=y + +### One-KVM +CONFIG_PACKAGE_usbutils=y +CONFIG_PACKAGE_kmod-usb-core=y +CONFIG_PACKAGE_kmod-usb-serial=y +CONFIG_PACKAGE_kmod-usb-serial-ch341=y +CONFIG_PACKAGE_kmod-video-core=y +CONFIG_PACKAGE_kmod-video-uvc=y +CONFIG_PACKAGE_kmod-video-videobuf2=y + +### procps +CONFIG_PACKAGE_procps-ng=y +CONFIG_PACKAGE_procps-ng-free=y +CONFIG_PACKAGE_procps-ng-kill=y +CONFIG_PACKAGE_procps-ng-pgrep=y +CONFIG_PACKAGE_procps-ng-pkill=y +CONFIG_PACKAGE_procps-ng-pmap=y +CONFIG_PACKAGE_procps-ng-ps=y +CONFIG_PACKAGE_procps-ng-pwdx=y +CONFIG_PACKAGE_procps-ng-skill=y +CONFIG_PACKAGE_procps-ng-slabtop=y +CONFIG_PACKAGE_procps-ng-snice=y +CONFIG_PACKAGE_procps-ng-sysctl=y +CONFIG_PACKAGE_procps-ng-tload=y +CONFIG_PACKAGE_procps-ng-top=y +CONFIG_PACKAGE_procps-ng-uptime=y +CONFIG_PACKAGE_procps-ng-vmstat=y +CONFIG_PACKAGE_procps-ng-w=y +CONFIG_PACKAGE_procps-ng-watch=y + +### boltbrowser +CONFIG_PACKAGE_boltbrowser=y + +### speedtest-ex +CONFIG_PACKAGE_speedtest-ex=y + +### node_exporter +CONFIG_PACKAGE_node_exporter=y ### Passwall -CONFIG_PACKAGE_luci-app-passwall=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Geodata=y -CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin=y +# CONFIG_PACKAGE_luci-app-passwall is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Geodata is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Brook is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server is not set @@ -151,19 +199,19 @@ CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin=y # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin is not set ### DDNS Scripts -CONFIG_PACKAGE_ddns-scripts=y -CONFIG_PACKAGE_ddns-scripts-aliyun=y -CONFIG_PACKAGE_ddns-scripts-cloudflare=y -CONFIG_PACKAGE_ddns-scripts-dnspod=y -CONFIG_PACKAGE_ddns-scripts-freedns=y -CONFIG_PACKAGE_ddns-scripts-godaddy=y -CONFIG_PACKAGE_ddns-scripts-services=y +# CONFIG_PACKAGE_ddns-scripts is not set +# CONFIG_PACKAGE_ddns-scripts-aliyun is not set +# CONFIG_PACKAGE_ddns-scripts-cloudflare is not set +# CONFIG_PACKAGE_ddns-scripts-dnspod is not set +# CONFIG_PACKAGE_ddns-scripts-freedns is not set +# CONFIG_PACKAGE_ddns-scripts-godaddy is not set +# CONFIG_PACKAGE_ddns-scripts-services is not set ### L2TP -CONFIG_PACKAGE_kmod-l2tp=y -CONFIG_PACKAGE_kmod-pppol2tp=y -CONFIG_PACKAGE_ppp-mod-pppol2tp=y -CONFIG_PACKAGE_xl2tpd=y +# CONFIG_PACKAGE_kmod-l2tp is not set +# CONFIG_PACKAGE_kmod-pppol2tp is not set +# CONFIG_PACKAGE_ppp-mod-pppol2tp is not set +# CONFIG_PACKAGE_xl2tpd is not set ### OpenSSL CONFIG_OPENSSL_ENGINE=y @@ -238,6 +286,7 @@ CONFIG_PACKAGE_kmod-rtw88-8822bu=y ### Utilities CONFIG_PACKAGE_bash=y CONFIG_PACKAGE_bash-completion=y +CONFIG_PACKAGE_bind-dig=y CONFIG_PACKAGE_dmesg=y CONFIG_PACKAGE_dosfstools=y CONFIG_PACKAGE_exfat-fsck=y @@ -248,7 +297,7 @@ CONFIG_PACKAGE_file=y CONFIG_PACKAGE_fstrim=y CONFIG_PACKAGE_ftp=y CONFIG_PACKAGE_gdisk=y -CONFIG_PACKAGE_htop=y +CONFIG_PACKAGE_btop=y CONFIG_PACKAGE_iperf3=y CONFIG_PACKAGE_iputils-ping=y CONFIG_PACKAGE_less=y @@ -263,7 +312,7 @@ CONFIG_PACKAGE_qrencode=y CONFIG_PACKAGE_rename=y CONFIG_PACKAGE_resize2fs=y CONFIG_PACKAGE_rsync=y -CONFIG_PACKAGE_samba4-admin=y +# CONFIG_PACKAGE_samba4-admin is not set CONFIG_PACKAGE_screen=y CONFIG_PACKAGE_sed=y CONFIG_PACKAGE_sshpass=y @@ -273,7 +322,7 @@ CONFIG_PACKAGE_telnet-bsd=y CONFIG_PACKAGE_tree=y CONFIG_PACKAGE_unzip=y CONFIG_PACKAGE_usbutils=y -CONFIG_PACKAGE_vim=y +CONFIG_PACKAGE_nano=y CONFIG_PACKAGE_wget-ssl=y CONFIG_PACKAGE_wpad-openssl=y CONFIG_PACKAGE_xfs-admin=y diff --git a/openwrt/24-config-musl-x86 b/openwrt/24-config-musl-x86 index f9c01bd0e..8e15b33a5 100644 --- a/openwrt/24-config-musl-x86 +++ b/openwrt/24-config-musl-x86 @@ -2,7 +2,7 @@ CONFIG_TARGET_x86=y CONFIG_TARGET_x86_64=y CONFIG_TARGET_x86_64_DEVICE_generic=y -CONFIG_GRUB_TIMEOUT="3" +CONFIG_GRUB_TIMEOUT="1" ### Basic CONFIG_ALL_KMODS=y @@ -41,7 +41,7 @@ CONFIG_PACKAGE_kmod-txgbe=y CONFIG_PACKAGE_kmod-nvme=y ### Display & Extra Drivers -CONFIG_PACKAGE_i915-firmware-huc=y -CONFIG_PACKAGE_kmod-drm-i915=y -CONFIG_PACKAGE_kmod-sound-hda-codec-realtek=y -CONFIG_PACKAGE_kmod-sound-hda-intel=y +# CONFIG_PACKAGE_i915-firmware-huc is not set +# CONFIG_PACKAGE_kmod-drm-i915 is not set +# CONFIG_PACKAGE_kmod-sound-hda-codec-realtek is not set +# CONFIG_PACKAGE_kmod-sound-hda-intel is not set diff --git a/openwrt/build.sh b/openwrt/build.sh index ae000d164..19cf72543 100644 --- a/openwrt/build.sh +++ b/openwrt/build.sh @@ -24,32 +24,10 @@ endgroup() { # NanoPi R4S OpenWrt Build Script # ##################################### -# IP Location -ip_info=`curl -sk https://ip.cooluc.com`; -[ -n "$ip_info" ] && export isCN=`echo $ip_info | grep -Po 'country_code\":"\K[^"]+'` || export isCN=US - # script url -if [ "$isCN" = "CN" ]; then - export mirror=https://init.cooluc.com -else - export mirror=https://init2.cooluc.com -fi - -# github actions - caddy server -if [ "$(whoami)" = "runner" ] && [ -z "$git_password" ]; then - export mirror=http://127.0.0.1:8080 -fi - -# private gitea +export mirror=http://127.0.0.1:8080 export gitea=git.cooluc.com - -# github mirror -if [ "$isCN" = "CN" ]; then - # There is currently no stable gh proxy - export github="github.com" -else - export github="github.com" -fi +export github=github.com # Check root if [ "$(id -u)" = "0" ]; then diff --git a/openwrt/files/bg/bg.webp b/openwrt/files/bg/bg.webp new file mode 100644 index 000000000..67edd3550 Binary files /dev/null and b/openwrt/files/bg/bg.webp differ diff --git a/openwrt/files/etc/board.d/03_model b/openwrt/files/etc/board.d/03_model new file mode 100644 index 000000000..abde0faaf --- /dev/null +++ b/openwrt/files/etc/board.d/03_model @@ -0,0 +1,7 @@ +#!/bin/sh + +[ $(grep -c -i -E "Default string" /sys/class/dmi/id/product_name) -ge 1 ] && echo "Generic x86/64" > /tmp/sysinfo/model + +grep -q "nanopi-r5s" /etc/board.json && ucidef_set_interfaces_lan_wan 'eth0 eth1' 'eth2' + +exit 0 \ No newline at end of file diff --git a/openwrt/files/etc/hotplug.d/iface/99-tailscale-needs b/openwrt/files/etc/hotplug.d/iface/99-tailscale-needs new file mode 100644 index 000000000..d830abdd4 --- /dev/null +++ b/openwrt/files/etc/hotplug.d/iface/99-tailscale-needs @@ -0,0 +1,10 @@ +#!/bin/sh + +[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { + sleep 3 + NETDEV=$(ip -o route get 223.5.5.5 | cut -f 5 -d " ") + ethtool -K $NETDEV rx-udp-gro-forwarding on rx-gro-list off + service tailscale restart + service log restart + logger "Configured $NETDEV for tailscale" +} diff --git a/openwrt/files/etc/uci-defaults/99-led b/openwrt/files/etc/uci-defaults/99-led new file mode 100644 index 000000000..1fe8a06f5 --- /dev/null +++ b/openwrt/files/etc/uci-defaults/99-led @@ -0,0 +1,6 @@ +uci batch << EOF +set system.led_wan.dev='eth2' +set system.led_lan1.dev='eth1' +set system.led_lan2.dev='eth0' +commit +EOF \ No newline at end of file diff --git a/openwrt/files/etc/uci-defaults/99-mihomo b/openwrt/files/etc/uci-defaults/99-mihomo new file mode 100644 index 000000000..0c5038d9d --- /dev/null +++ b/openwrt/files/etc/uci-defaults/99-mihomo @@ -0,0 +1,9 @@ +uci batch << EOF +set mihomo.config.start_delay='3' +set mihomo.config.mixin='0' +set mihomo.config.fast_reload='0' +set mihomo.mixin.dns_mode='fake-ip' +set mihomo.mixin.fake_ip_range='28.0.0.1/8' +set mihomo.mixin.ui_url='https://raw.ihtw.moe/https://github.com/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip' +commit +EOF \ No newline at end of file diff --git a/openwrt/files/etc/uci-defaults/99-watchcat b/openwrt/files/etc/uci-defaults/99-watchcat new file mode 100644 index 000000000..29c4b4a3d --- /dev/null +++ b/openwrt/files/etc/uci-defaults/99-watchcat @@ -0,0 +1,11 @@ +uci batch << EOF +set watchcat.@watchcat[0]=watchcat +set watchcat.@watchcat[0].mode='restart_iface' +set watchcat.@watchcat[0].period='1m' +set watchcat.@watchcat[0].pinghosts='223.5.5.5' +set watchcat.@watchcat[0].addressfamily='ipv4' +set watchcat.@watchcat[0].pingperiod='10' +set watchcat.@watchcat[0].pingsize='standard' +set watchcat.@watchcat[0].interface='pppoe-wan' +commit +EOF \ No newline at end of file diff --git a/openwrt/scripts/10-custom.sh b/openwrt/scripts/10-custom.sh index cea74a296..e0ad85dd7 100644 --- a/openwrt/scripts/10-custom.sh +++ b/openwrt/scripts/10-custom.sh @@ -1,3 +1,89 @@ #!/bin/bash -# 自定义脚本 +# mihomo +if curl -s "$mirror/openwrt/24-config-common" | grep -q "^CONFIG_PACKAGE_luci-app-mihomo=y"; then + git clone https://$github/morytyann/OpenWrt-mihomo package/new/openwrt-mihomo --depth=1 + mkdir -p files/etc/opkg/keys + echo -e "untrusted comment: MihomoTProxy\nRWSrAXyIqregizvXvG9kJI/JoTkaCCPDy6CQrrVQ4IZ8Qgu+iWMql0UW" > files/etc/opkg/keys/ab017c88aab7a08b + echo "src/gz mihomo https://raw.ihtw.moe/$github/morytyann/OpenWrt-mihomo/raw/gh-pages/openwrt-24.10/$arch/mihomo" >> files/etc/opkg/customfeeds.conf + mkdir -p files/etc/mihomo/run/ui + curl -skLo files/etc/mihomo/run/Country.mmdb https://$github/NobyDa/geoip/raw/release/Private-GeoIP-CN.mmdb + curl -skLo files/etc/mihomo/run/GeoIP.dat https://$github/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat + curl -skLo files/etc/mihomo/run/GeoSite.dat https://$github/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat + curl -skLo gh-pages.zip https://$github/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip + unzip gh-pages.zip + mv zashboard-gh-pages files/etc/mihomo/run/ui/zashboard + # make sure mihomo is always latest + git clone -b Alpha --depth=1 https://github.com/metacubex/mihomo --depth=1 + mihomo_sha=$(git -C mihomo rev-parse HEAD) + mihomo_short_sha=$(git -C mihomo rev-parse --short HEAD) + git -C mihomo config tar.xz.command "xz -c" + git -C mihomo archive --output=mihomo.tar.xz HEAD + mihomo_checksum=$(sha256sum mihomo/mihomo.tar.xz | cut -d ' ' -f 1) + sed -i "s/PKG_SOURCE_DATE:=.*/PKG_SOURCE_DATE:=$(date -u -d yesterday -I)/" package/new/openwrt-mihomo/mihomo/Makefile + sed -i "s/PKG_SOURCE_VERSION:=.*/PKG_SOURCE_VERSION:=$mihomo_sha/" package/new/openwrt-mihomo/mihomo/Makefile + sed -i "s/PKG_MIRROR_HASH:=.*/PKG_MIRROR_HASH:=$mihomo_checksum/" package/new/openwrt-mihomo/mihomo/Makefile + sed -i "s/PKG_BUILD_VERSION:=.*/PKG_BUILD_VERSION:=alpha-$mihomo_short_sha/" package/new/openwrt-mihomo/mihomo/Makefile +fi + +# tailscale +if curl -s "$mirror/openwrt/24-config-common" | grep -q "^CONFIG_PACKAGE_luci-app-tailscale=y"; then + git clone https://$github/asvow/luci-app-tailscale package/new/luci-app-tailscale --depth=1 + mkdir -p files/etc/hotplug.d/iface + curl -skLo files/etc/hotplug.d/iface/99-tailscale-needs $mirror/openwrt/files/etc/hotplug.d/iface/99-tailscale-needs + # make sure tailscale is always latest + ts_version=$(curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | grep -oP '(?<="tag_name": ")[^"]*' | sed 's/^v//') + ts_tarball="tailscale-${ts_version}.tar.gz" + curl -skLo "${ts_tarball}" "https://codeload.github.com/tailscale/tailscale/tar.gz/v${ts_version}" + ts_hash=$(sha256sum "${ts_tarball}" | awk '{print $1}') + rm -rf "${ts_tarball}" + sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=${ts_version}/" package/feeds/packages/tailscale/Makefile + sed -i "s/PKG_HASH:=.*/PKG_HASH:=${ts_hash}/" package/feeds/packages/tailscale/Makefile +fi + +# qosmate +if curl -s "$mirror/openwrt/24-config-common" | grep -q "^CONFIG_PACKAGE_luci-app-qosmate=y"; then + git clone https://$github/hudra0/qosmate package/new/qosmate --depth=1 + git clone https://$github/hudra0/luci-app-qosmate package/new/luci-app-qosmate --depth=1 +fi + +# boltbrowser +git clone https://$github/JohnsonRan/packages_utils_boltbrowser package/new/boltbrowser + +# speedtest-ex +git clone https://$github/JohnsonRan/packages_net_speedtest-ex package/new/speedtest-ex + +# node_exporter +git clone https://$github/JohnsonRan/packages_utils_node_exporter package/new/node_exporter + +# sysupgrade keep files +echo "/etc/hotplug.d/iface/*.sh" >>files/etc/sysupgrade.conf +echo "/etc/mihomo/run/cache.db" >>files/etc/sysupgrade.conf + +# add UE-DDNS +mkdir -p files/usr/bin +curl -skLo files/usr/bin/ue-ddns ddns.03k.org +chmod +x files/usr/bin/ue-ddns + +# ghp.ci is NOT stable +sed -i 's|raw.githubusercontent.com|raw.ihtw.moe/raw.githubusercontent.com|g' package/new/default-settings/default/zzz-default-settings +# hey TUNA +sed -i 's/mirrors.pku.edu.cn/mirrors.tuna.tsinghua.edu.cn/g' package/new/default-settings/default/zzz-default-settings + +# argon new bg +curl -skLo package/new/luci-theme-argon/luci-theme-argon/htdocs/luci-static/argon/img/bg.webp $mirror/openwrt/files/bg/bg.webp + +# defaults +mkdir -p files/etc/uci-defaults +mkdir -p files/etc/board.d +curl -skLo files/etc/board.d/03_model $mirror/openwrt/files/etc/board.d/03_model +curl -skLo files/etc/uci-defaults/99-led $mirror/openwrt/files/etc/uci-defaults/99-led +curl -skLo files/etc/uci-defaults/99-mihomo $mirror/openwrt/files/etc/uci-defaults/99-mihomo +curl -skLo files/etc/uci-defaults/99-watchcat $mirror/openwrt/files/etc/uci-defaults/99-watchcat + +# from pmkol/openwrt-plus +# configure default-settings +sed -i 's/openwrt\/luci/JohnsonRan\/opwrt_build_script/g' package/new/luci-theme-argon/luci-theme-argon/luasrc/view/themes/argon/footer.htm +sed -i 's/openwrt\/luci/JohnsonRan\/opwrt_build_script/g' package/new/luci-theme-argon/luci-theme-argon/luasrc/view/themes/argon/footer_login.htm +sed -i 's/openwrt\/luci/JohnsonRan\/opwrt_build_script/g' feeds/luci/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/footer.ut +sed -i '/# timezone/i sed -i "s/\\(DISTRIB_DESCRIPTION=\\).*/\\1'\''OpenWrt $(sed -n "s/DISTRIB_DESCRIPTION='\''OpenWrt \\([^ ]*\\) .*/\\1/p" /etc/openwrt_release)'\'',/" /etc/openwrt_release\nsource /etc/openwrt_release \&\& sed -i -e "s/distversion\\s=\\s\\".*\\"/distversion = \\"$DISTRIB_ID $DISTRIB_RELEASE ($DISTRIB_REVISION)\\"/g" -e '\''s/distname = .*$/distname = ""/g'\'' /usr/lib/lua/luci/version.lua\nsed -i "s/luciname = \\".*\\"/luciname = \\"LuCI openwrt-24.10\\"/g" /usr/lib/lua/luci/version.lua\nsed -i "s/luciversion = \\".*\\"/luciversion = \\"v'$(date +%Y%m%d)'\\"/g" /usr/lib/lua/luci/version.lua\necho "export const revision = '\''v'$(date +%Y%m%d)'\'\'', branch = '\''LuCI openwrt-24.10'\'';" > /usr/share/ucode/luci/version.uc\n/etc/init.d/rpcd restart\n' package/new/default-settings/default/zzz-default-settings