diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e40580cf8..36ad5b8f4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -17,7 +17,7 @@ on: build_options: description: 'Build options (separate multiple options with spaces)' required: false - default: 'BUILD_FAST=y ENABLE_LTO=y ENABLE_MOLD=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y' + default: 'KERNEL_CLANG_LTO=y BUILD_FAST=y ENABLE_UHTTPD=y ENABLE_LTO=y ENABLE_MOLD=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y' type: string jobs: diff --git a/.github/workflows/build-x86_64.yml b/.github/workflows/build-x86_64.yml new file mode 100644 index 000000000..4f81538eb --- /dev/null +++ b/.github/workflows/build-x86_64.yml @@ -0,0 +1,150 @@ +name: Build x86_64 + +on: + workflow_dispatch: + +jobs: + build: + if: github.event.repository.owner.id == github.event.sender.id + name: Build ${{ matrix.model }}-${{ matrix.tag.version }} + runs-on: ubuntu-22.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - x86_64 + tag: + - type: rc2 + version: openwrt-23.05 + + steps: + - name: Checkout + uses: actions/checkout@main + with: + ref: x86_64 + + - name: Set time zone + run: sudo timedatectl set-timezone 'Asia/Shanghai' + + - name: Show system + run: | + lscpu + free -h + df -Th + uname -a + + - name: Set release env + run: | + sudo mkdir -p /builder + sudo chown -R runner.runner /builder + echo WORKDIR="/builder" >> "$GITHUB_ENV" + + - name: Free disk space + run: | + sudo rm -rf /etc/apt/sources.list.d + sudo swapoff -a + sudo rm -f /swapfile /mnt/swapfile + sudo docker image prune -a -f + sudo systemctl stop docker + sudo snap set system refresh.retain=2 + sudo apt-get -y purge firefox clang* ghc* google* llvm* mono* mongo* mysql* php* + sudo apt-get -y autoremove --purge + sudo apt-get clean + sudo rm -rf /etc/mysql /etc/php /usr/lib/jvm /usr/libexec/docker /usr/local /usr/src/* /var/lib/docker /var/lib/gems /var/lib/mysql /var/lib/snapd /etc/skel /opt/{microsoft,az,hostedtoolcache,cni,mssql-tools,pipx} /usr/share/{az*,dotnet,swift,miniconda,gradle*,java,kotlinc,ri,sbt} /root/{.sbt,.local,.npm} + sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} + rm -rf ~/{.cargo,.dotnet,.rustup} + df -Th + + - name: Build System Setup + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y build-essential flex bison cmake 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 rename qemu-utils + sudo apt-get clean + git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com' + df -Th + + - name: Install LLVM + run: | + export PATH="/opt/clang/bin:$PATH" + mkdir /opt/clang + curl -LO https://github.com/sbwml/redhat-llvm-project/releases/download/18.1.8/clang-18.1.8-x86_64-redhat-linux.tar.xz --progress-bar + sudo tar --strip-components=1 -C /opt/clang -xf clang-18.1.8-x86_64-redhat-linux.tar.xz + rm -rf clang-18.1.8-x86_64-redhat-linux.tar.xz + clang --version + + - name: Compile OpenWrt + working-directory: /builder + id: compile + continue-on-error: true + run: | + export PATH="/opt/clang/bin:$PATH" + export GITHUB_REPO=${{ github.repository }} + export KERNEL_CLANG_LTO=y BUILD_FAST=y ENABLE_UHTTPD=y ENABLE_LTO=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y USE_MOLD=y + bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/x86_64/openwrt/build.sh) ${{ matrix.tag.type }} ${{ matrix.model }} + cd openwrt + tags=$(git describe --abbrev=0 --tags) + echo "latest_release=$tags" >>$GITHUB_ENV + + - name: Extensive logs after a failed compilation + working-directory: /builder + if: steps.compile.outcome == 'failure' + run: | + export PATH="/opt/clang/bin:$PATH" + cd openwrt + make V=s + + - name: Prepare Firmware Files + working-directory: /builder + run: | + mkdir -p rom info + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "x86_64" ]; then + cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-generic-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "armv8" ]; then + 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.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-generic-squashfs-combined.img.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*-rootfs.tar.gz rom/ + cp -a openwrt/bin/targets/armsr/armv8*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + fi + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.model }}-${{ matrix.tag.version }} + path: ${{ env.WORKDIR }}/rom/* + + - name: Create release + continue-on-error: true + uses: sbwml/release-action@main + with: + name: OpenWrt-${{ env.latest_release }} + allowUpdates: true + prerelease: true + tag: ${{ env.latest_release }} + commit: x86_64 + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: ${{ env.WORKDIR }}/rom/* diff --git a/.github/workflows/sync-build.yml b/.github/workflows/sync-build.yml new file mode 100644 index 000000000..1b7fba2e8 --- /dev/null +++ b/.github/workflows/sync-build.yml @@ -0,0 +1,180 @@ +name: Build sync releases + +on: + workflow_dispatch: + push: + branches: + - master + paths: + - 'tags/**' + +jobs: + build: + if: github.event.repository.owner.id == github.event.sender.id + name: Build ${{ matrix.model }}-${{ matrix.tag.version }} + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + model: + - armv8 + - nanopi-r4s + - nanopi-r5s + - x86_64 + tag: + - type: rc2 + version: openwrt-23.05 + + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Set time zone + run: sudo timedatectl set-timezone 'Asia/Shanghai' + + - name: Show system + run: | + lscpu + free -h + df -Th + uname -a + + - name: Set release env + run: | + sudo mkdir -p /builder + sudo chown -R runner:runner /builder + echo WORKDIR="/builder" >> "$GITHUB_ENV" + + - name: Free disk space + run: | + sudo swapoff -a + sudo rm -f /swapfile /mnt/swapfile + sudo docker image prune -a -f + sudo systemctl stop docker + sudo snap set system refresh.retain=2 + sudo apt-get -y purge firefox clang* gcc-12 gcc-14 ghc* google* llvm* mono* mongo* mysql* php* + sudo apt-get -y autoremove --purge + sudo apt-get clean + sudo rm -rf /etc/mysql /etc/php /usr/lib/{jvm,llvm} /usr/libexec/docker /usr/local /usr/src/* /var/lib/docker /var/lib/gems /var/lib/mysql /var/lib/snapd /etc/skel /opt/{microsoft,az,hostedtoolcache,cni,mssql-tools,pipx} /usr/share/{az*,dotnet,swift,miniconda,gradle*,java,kotlinc,ri,sbt} /root/{.sbt,.local,.npm} /usr/libexec/gcc/x86_64-linux-gnu/14 /usr/lib/x86_64-linux-gnu/{*clang*,*LLVM*} /home/linuxbrew + sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} + rm -rf ~/{.cargo,.dotnet,.rustup} + df -Th + + - name: Create Swap + run: | + sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=8192 + sudo chmod 600 /mnt/swapfile + sudo mkswap /mnt/swapfile + sudo swapon /mnt/swapfile + free -h | grep -i swap + + - name: Build System Setup + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y build-essential flex bison cmake g++ gawk gcc-multilib g++-multilib gettext git libfuse-dev libncurses5-dev libssl-dev python3 python3-pip python3-ply 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 rename qemu-utils + sudo apt-get clean + git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com' + + - name: Create VG & LV + run: | + mnt_size=$(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') + root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 2) + sudo truncate -s "$mnt_size"G /mnt/mnt.img + sudo truncate -s "$root_size"G /root.img + sudo losetup /dev/loop6 /mnt/mnt.img + sudo losetup /dev/loop7 /root.img + sudo pvcreate /dev/loop6 + sudo pvcreate /dev/loop7 + sudo vgcreate github /dev/loop6 /dev/loop7 + sudo lvcreate -n runner -l 100%FREE github + sudo mkfs.xfs /dev/github/runner + + - name: Mount LV + run: | + sudo mkdir -p /builder + sudo mount /dev/github/runner /builder + sudo chown -R runner:runner /builder + df -Th + + - name: Install LLVM + run: | + export PATH="/opt/clang/bin:$PATH" + mkdir /opt/clang + curl -LO https://github.com/sbwml/redhat-llvm-project/releases/download/18.1.8/clang-18.1.8-x86_64-redhat-linux.tar.xz --progress-bar + sudo tar --strip-components=1 -C /opt/clang -xf clang-18.1.8-x86_64-redhat-linux.tar.xz + rm -rf clang-18.1.8-x86_64-redhat-linux.tar.xz + clang --version + + - name: Compile OpenWrt + working-directory: /builder + id: compile + continue-on-error: true + run: | + export PATH="/opt/clang/bin:$PATH" + export GITHUB_REPO=${{ github.repository }} + export KERNEL_CLANG_LTO=y BUILD_FAST=y ENABLE_UHTTPD=y ENABLE_LTO=y ENABLE_LRNG=y ENABLE_BPF=y USE_GCC14=y ENABLE_DPDK=y ENABLE_MOLD=y + bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/master/openwrt/build.sh) ${{ matrix.tag.type }} ${{ matrix.model }} + cd openwrt + tags=$(git describe --abbrev=0 --tags) + kernel=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/master/tags/kernel-6.6" | 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 + if: steps.compile.outcome == 'failure' + run: | + export PATH="/opt/clang/bin:$PATH" + cd openwrt + make V=s + + - name: Prepare Firmware Files + working-directory: /builder + run: | + mkdir -p rom info + if [ "${{ matrix.model }}" = "nanopi-r4s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*-r4s.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "nanopi-r5s" ]; then + cp -a openwrt/bin/targets/rockchip/*/*.img.gz rom/ + cp -a openwrt/bin/targets/rockchip/*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/rockchip/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "x86_64" ]; then + cp -a openwrt/bin/targets/x86/*/*-ext4-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-squashfs-combined-efi.img.gz rom/ + cp -a openwrt/bin/targets/x86/*/*-x86-64-generic.manifest info/manifest.txt + cp -a openwrt/bin/targets/x86/*/config.buildinfo info/config.buildinfo + cd rom && sha256sum *gz > ../info/sha256sums.txt + elif [ "${{ matrix.model }}" = "armv8" ]; then + 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*/*.manifest info/manifest.txt + cp -a openwrt/bin/targets/armsr/armv8*/config.buildinfo info/config.buildinfo + cd rom && sha256sum * > ../info/sha256sums.txt + fi + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.model }}-${{ matrix.tag.version }} + path: ${{ env.WORKDIR }}/rom/*.gz + + - name: Create release + continue-on-error: true + uses: sbwml/release-action@main + with: + name: OpenWrt-${{ env.latest_release }} + allowUpdates: true + tag: ${{ env.latest_release }} + body: OpenWrt 23.05 with Kernel 6.6 Enhanced + commit: master + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: ${{ env.WORKDIR }}/rom/* diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml new file mode 100644 index 000000000..4d9ad21c9 --- /dev/null +++ b/.github/workflows/sync-fork.yml @@ -0,0 +1,31 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 23 * * *' + workflow_dispatch: + +jobs: + sync: + if: github.repository_owner == 'pmkol' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: 'master' + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + + - name: Merge upstream changes + run: | + git remote add upstream https://github.com/sbwml/r4s_build_script.git + git fetch upstream + git merge upstream/master --allow-unrelated-histories --no-edit || exit 1 + + - name: Push changes + run: git push diff --git a/README.md b/README.md index 2f447b4c0..74d20ad5a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,47 @@ -# NanoPi R4S/R5S/R5C & X86_64 OpenWrt 简易构建脚本存档 +# OpenWrt Plus 23.05 -### 存档来自:https://init2.cooluc.com +### NanoPi R4S/R5S/R5C & X86_64 固件下载: ---------------- - -## 基于 Linux 6.6 LTS 固件下载: +https://github.com/pmkol/openwrt-plus/releases -#### NanoPi R4S: https://r4s.cooluc.com +``` +【首次登陆】 +地址:10.0.0.1(默认) +用户:root +密码:空 -#### NanoPi R5S/R5C: https://r5s.cooluc.com +【分区挂载】 +系统/磁盘管理 将系统盘剩余空间创建新分区 +系统/挂载点 启用新分区并挂载至/opt目录 +``` -#### X86_64: https://x86.cooluc.com +--------------- -#### 构建来源: https://github.com/sbwml/builder +#### 固件编译脚本存档来自:https://init2.cooluc.com + +- 优化系统内核 + - [x] Full cone NAT + - [x] TCP BBRv3 + - [x] TCP Brutal + - [x] LLVM-BPF + - [x] Shortcut-FE +- 使用 OpenWrt+ImmortalWrt 软件源,支持更多插件的在线安装与升级 +- 最小化集成常用插件,修复多处上游插件BUG + +| ⚓ 服务 | 🗳️ Docker | 🩺 网络 | +| :---- | :---- | :---- | +| PassWall | Dockerman | 网速测试 | +| Mihomo | Docker | SQM队列管理 | +| MosDNS | Dockerd | UPnP | +| 硬盘休眠 | Docker-compose | 带宽监控 | +| Watchcat | | Socat | +| Aira2 | | 访问控制 | +| FRP客户端 | | IP限速 | +| 网络共享 | | | +| 网络唤醒 | | | +| ZeroTier | | | + +自定义预装插件建议fork上游原项目,以免因本项目未及时同步导致编译失败 --------------- diff --git a/openwrt/23-config-common b/openwrt/23-config-common index 1b4f0e9bd..4d808daaa 100644 --- a/openwrt/23-config-common +++ b/openwrt/23-config-common @@ -57,6 +57,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 @@ -65,102 +66,98 @@ CONFIG_PACKAGE_luci-lib-ip=y CONFIG_PACKAGE_luci-lib-ipkg=y CONFIG_PACKAGE_luci-lib-jsonc=y CONFIG_PACKAGE_luci-lib-nixio=y -CONFIG_PACKAGE_luci-nginx=y +# CONFIG_PACKAGE_luci-nginx is not set 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_nginx-all-module=y +# CONFIG_PACKAGE_luci-theme-material is not set +# CONFIG_PACKAGE_luci-theme-openwrt-2020 is not set +# CONFIG_PACKAGE_nginx-all-module is not set CONFIG_LUCI_LANG_zh_Hans=y # CONFIG_LUCI_CSSTIDY is not set # CONFIG_LUCI_JSMIN is not set ### APPS CONFIG_PACKAGE_luci-app-accesscontrol=y -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-commands=y CONFIG_PACKAGE_luci-app-cpufreq=y # CONFIG_PACKAGE_luci-app-daed is not set -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-filebrowser=y +# CONFIG_PACKAGE_luci-app-filebrowser is not set CONFIG_PACKAGE_luci-app-frpc=y -CONFIG_PACKAGE_luci-app-gowebdav=y -CONFIG_PACKAGE_luci-app-mentohust=y +CONFIG_PACKAGE_luci-app-hd-idle=y +# CONFIG_PACKAGE_luci-app-gowebdav is not set +# CONFIG_PACKAGE_luci-app-mentohust is not set CONFIG_PACKAGE_luci-app-mosdns=y -CONFIG_PACKAGE_luci-app-natmap=y +# CONFIG_PACKAGE_luci-app-natmap is not set +# CONFIG_PACKAGE_luci-app-netdata 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-oaf is not set +# CONFIG_PACKAGE_luci-app-qbittorrent is not set +# CONFIG_PACKAGE_luci-app-qbittorrent_dynamic 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-ttyd=y +# CONFIG_PACKAGE_luci-app-uhttpd is not set # 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-usb-printer is not set +# CONFIG_PACKAGE_luci-app-vlmcsd is not set CONFIG_PACKAGE_luci-app-watchcat=y -CONFIG_PACKAGE_luci-app-wireguard=y +# CONFIG_PACKAGE_luci-app-wireguard is not set CONFIG_PACKAGE_luci-app-wolplus=y +# CONFIG_PACKAGE_luci-app-xfrpc is not set CONFIG_PACKAGE_luci-app-zerotier=y -CONFIG_PACKAGE_ariang-nginx=y +# 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 ### 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_INCLUDE_Brook is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria 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_ShadowsocksR_Libev_Client is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_tuic_client is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_GO is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus is not set # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin is not set -### SSR Plus -CONFIG_PACKAGE_luci-app-ssr-plus=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_IPT2Socks=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Redsocks2=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Simple_Obfs=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Xray_Plugin=y -CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Libev_Client=y -# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Hysteria is not set -# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Trojan 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 @@ -210,6 +207,7 @@ CONFIG_PACKAGE_kmod-tcp-brutal=y CONFIG_PACKAGE_kmod-tls=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-storage-uas=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y @@ -222,6 +220,7 @@ CONFIG_PACKAGE_kmod-mt7921u=y ### Utilities CONFIG_PACKAGE_bash=y +CONFIG_PACKAGE_bind-dig=y CONFIG_PACKAGE_dmesg=y CONFIG_PACKAGE_dosfstools=y CONFIG_PACKAGE_exfat-fsck=y @@ -285,7 +284,6 @@ CONFIG_PACKAGE_shadow-useradd=y CONFIG_PACKAGE_shadow-userdel=y CONFIG_PACKAGE_shadow-usermod=y CONFIG_PACKAGE_shadow-utils=y -# CONFIG_shadow-all is not set ### GNU Core Utilities CONFIG_PACKAGE_coreutils=y diff --git a/openwrt/23-config-minimal-common b/openwrt/23-config-minimal-common index 26c8599e7..a4df2d26c 100644 --- a/openwrt/23-config-minimal-common +++ b/openwrt/23-config-minimal-common @@ -1,4 +1,3 @@ - ### Curl CONFIG_PACKAGE_curl=y CONFIG_PACKAGE_libcurl=y @@ -47,6 +46,19 @@ CONFIG_PACKAGE_dnsmasq_full_ipset=y # CONFIG_PACKAGE_dnsmasq_full_broken_rtc is not set # CONFIG_PACKAGE_dnsmasq is not set +### Docker +# CONFIG_DOCKER_CGROUP_OPTIONS is not set +# CONFIG_DOCKER_NET_ENCRYPT is not set +# CONFIG_DOCKER_NET_MACVLAN is not set +# CONFIG_DOCKER_NET_OVERLAY is not set +# CONFIG_DOCKER_NET_TFTP is not set +# CONFIG_DOCKER_OPTIONAL_FEATURES is not set +# CONFIG_DOCKER_STO_BTRFS is not set +# CONFIG_DOCKER_STO_EXT4 is not set +# CONFIG_PACKAGE_luci-app-dockerman is not set +# CONFIG_PACKAGE_luci-lib-docker is not set +# CONFIG_PACKAGE_docker-compose is not set + ### Luci CONFIG_PACKAGE_luci=y CONFIG_PACKAGE_luci-lib-base=y @@ -54,26 +66,40 @@ CONFIG_PACKAGE_luci-lib-ip=y CONFIG_PACKAGE_luci-lib-ipkg=y CONFIG_PACKAGE_luci-lib-jsonc=y CONFIG_PACKAGE_luci-lib-nixio=y -CONFIG_PACKAGE_luci-nginx=y -CONFIG_PACKAGE_nginx-all-module=y +# CONFIG_PACKAGE_luci-nginx is not set +CONFIG_PACKAGE_luci-theme-argon=y +# CONFIG_PACKAGE_nginx-all-module is not set CONFIG_LUCI_LANG_zh_Hans=y # CONFIG_LUCI_CSSTIDY is not set # CONFIG_LUCI_JSMIN is not set ### APPS +CONFIG_PACKAGE_luci-app-argon-config=y CONFIG_PACKAGE_luci-app-autoreboot=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-oaf=y +# CONFIG_PACKAGE_luci-app-hd-idle is not set +# CONFIG_PACKAGE_luci-app-oaf is not set CONFIG_PACKAGE_luci-app-ramfree=y CONFIG_PACKAGE_luci-app-ttyd=y CONFIG_PACKAGE_luci-app-upnp=y +# CONFIG_PACKAGE_luci-app-watchcat is not set ### DDNS Scripts -CONFIG_PACKAGE_ddns-scripts=y -CONFIG_PACKAGE_ddns-scripts-aliyun=y -CONFIG_PACKAGE_ddns-scripts-dnspod=y +# CONFIG_PACKAGE_ddns-scripts is not set +# CONFIG_PACKAGE_ddns-scripts-aliyun is not set +# CONFIG_PACKAGE_ddns-scripts-dnspod is not set + +### Mihomo +# CONFIG_PACKAGE_luci-app-mihomo is not set + +### Passwall +# CONFIG_PACKAGE_luci-app-passwall is not set +# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy 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 ### OpenSSL CONFIG_OPENSSL_ENGINE=y @@ -121,6 +147,7 @@ CONFIG_PACKAGE_kmod-tcp-brutal=y CONFIG_PACKAGE_kmod-tls=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-storage-uas=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y diff --git a/openwrt/23-config-musl-armsr-armv8 b/openwrt/23-config-musl-armsr-armv8 index 663c30b53..559e5728f 100644 --- a/openwrt/23-config-musl-armsr-armv8 +++ b/openwrt/23-config-musl-armsr-armv8 @@ -19,7 +19,7 @@ CONFIG_COREMARK_NUMBER_OF_THREADS=16 # CONFIG_KERNEL_KALLSYMS is not set ### Utilities -CONFIG_PACKAGE_qemu-ga=y +# CONFIG_PACKAGE_qemu-ga is not set ### RTL8723D / RTL8821C / RTW89 firmware CONFIG_PACKAGE_rtl8723de-firmware=m diff --git a/openwrt/23-config-musl-x86 b/openwrt/23-config-musl-x86 index d072df50e..7ebd0732a 100644 --- a/openwrt/23-config-musl-x86 +++ b/openwrt/23-config-musl-x86 @@ -38,28 +38,28 @@ CONFIG_PACKAGE_kmod-txgbe=y CONFIG_PACKAGE_kmod-nvme=y ### Display & Extra Drivers -CONFIG_PACKAGE_kmod-backlight-pwm=y -CONFIG_PACKAGE_kmod-backlight=y -CONFIG_PACKAGE_kmod-drm-amdgpu=y -CONFIG_PACKAGE_kmod-drm-i915=y -CONFIG_PACKAGE_kmod-drm-kms-helper=y -CONFIG_PACKAGE_kmod-drm-radeon=y -CONFIG_PACKAGE_kmod-drm-ttm=y -CONFIG_PACKAGE_kmod-drm=y -CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y -CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y -CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y -CONFIG_PACKAGE_kmod-fb-sys-fops=y -CONFIG_PACKAGE_kmod-fb-sys-ram=y -CONFIG_PACKAGE_kmod-fb=y -CONFIG_PACKAGE_kmod-sound-hda-codec-realtek=y -CONFIG_PACKAGE_kmod-sound-hda-intel=y -CONFIG_PACKAGE_kmod-video-pwc=y -CONFIG_PACKAGE_kmod-video-uvc=y -CONFIG_PACKAGE_kmod-video-videobuf2=y +# CONFIG_PACKAGE_kmod-backlight-pwm is not set +# CONFIG_PACKAGE_kmod-backlight is not set +# CONFIG_PACKAGE_kmod-drm-amdgpu is not set +# CONFIG_PACKAGE_kmod-drm-i915 is not set +# CONFIG_PACKAGE_kmod-drm-kms-helper is not set +# CONFIG_PACKAGE_kmod-drm-radeon is not set +# CONFIG_PACKAGE_kmod-drm-ttm is not set +# CONFIG_PACKAGE_kmod-drm is not set +# CONFIG_PACKAGE_kmod-fb-cfb-copyarea is not set +# CONFIG_PACKAGE_kmod-fb-cfb-fillrect is not set +# CONFIG_PACKAGE_kmod-fb-cfb-imgblt is not set +# CONFIG_PACKAGE_kmod-fb-sys-fops is not set +# CONFIG_PACKAGE_kmod-fb-sys-ram is not set +# CONFIG_PACKAGE_kmod-fb is not set +# CONFIG_PACKAGE_kmod-sound-hda-codec-realtek is not set +# CONFIG_PACKAGE_kmod-sound-hda-intel is not set +# CONFIG_PACKAGE_kmod-video-pwc is not set +# CONFIG_PACKAGE_kmod-video-uvc is not set +# CONFIG_PACKAGE_kmod-video-videobuf2 is not set ### Utilities -CONFIG_PACKAGE_qemu-ga=y +# CONFIG_PACKAGE_qemu-ga is not set ### Virtualization CONFIG_PACKAGE_kmod-kvm-intel=y diff --git a/openwrt/build.sh b/openwrt/build.sh index 058cb39e6..66e5abc25 100644 --- a/openwrt/build.sh +++ b/openwrt/build.sh @@ -255,6 +255,8 @@ curl -sO https://$mirror/openwrt/scripts/02-prepare_package.sh curl -sO https://$mirror/openwrt/scripts/03-convert_translation.sh curl -sO https://$mirror/openwrt/scripts/04-fix_kmod.sh curl -sO https://$mirror/openwrt/scripts/05-fix-source.sh +curl -sO https://$mirror/openwrt/scripts/10-customize-config.sh +curl -sO https://$mirror/openwrt/scripts/11-fix-vendor.sh curl -sO https://$mirror/openwrt/scripts/99_clean_build_cache.sh chmod 0755 *sh [ "$(whoami)" = "runner" ] && group "patching openwrt" @@ -264,6 +266,10 @@ bash 02-prepare_package.sh bash 03-convert_translation.sh bash 04-fix_kmod.sh bash 05-fix-source.sh +bash 10-customize-config.sh +if [ "$platform" = "x86_64" ] || [ "$platform" = "armv8" ]; then + bash 11-fix-vendor.sh +fi [ "$(whoami)" = "runner" ] && endgroup if [ "$USE_GCC14" = "y" ] || [ "$USE_GCC15" = "y" ]; then diff --git a/openwrt/scripts/10-customize-config.sh b/openwrt/scripts/10-customize-config.sh new file mode 100644 index 000000000..5ce0191fd --- /dev/null +++ b/openwrt/scripts/10-customize-config.sh @@ -0,0 +1,34 @@ +# remove ssrplus +rm -rf package/new/helloworld/luci-app-ssr-plus +rm -rf package/new/helloworld/patch-luci-app-ssr-plus.patch + +# add mihomo +git clone https://$github/pmkol/openwrt-mihomo package/new/openwrt-mihomo +if curl -s "https://$mirror/openwrt/23-config-common" | grep -q "^CONFIG_PACKAGE_luci-app-mihomo=y"; then + mkdir -p files/etc/mihomo/run/ui + curl -Lso files/etc/mihomo/run/Country.mmdb https://$github/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb + curl -Lso metacubexd-gh-pages.tar.gz https://$github/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.tar.gz + tar zxf metacubexd-gh-pages.tar.gz + rm metacubexd-gh-pages.tar.gz + mv metacubexd-gh-pages files/etc/mihomo/run/ui/metacubexd +fi + +# change geodata +rm -rf package/new/helloworld/v2ray-geodata +git clone https://$github/sbwml/v2ray-geodata package/new/helloworld/v2ray-geodata +sed -i 's#Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat#MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat#g; s#Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat#MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat#g' package/new/helloworld/v2ray-geodata/Makefile +sed -i '/geoip_api/s#Loyalsoldier/v2ray-rules-dat#pmkol/geodata-lite#' package/new/helloworld/luci-app-passwall/root/usr/share/passwall/rule_update.lua +sed -i '/geosite_api/s#Loyalsoldier/v2ray-rules-dat#MetaCubeX/meta-rules-dat#' package/new/helloworld/luci-app-passwall/root/usr/share/passwall/rule_update.lua + +# configure default-settings +sed -i 's/openwrt\/luci/pmkol\/openwrt-plus/g' package/new/luci-theme-argon/luci-theme-argon/luasrc/view/themes/argon/footer.htm +sed -i 's/openwrt\/luci/pmkol\/openwrt-plus/g' package/new/luci-theme-argon/luci-theme-argon/luasrc/view/themes/argon/footer_login.htm +sed -i 's/openwrt\/luci/pmkol\/openwrt-plus/g' feeds/luci/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/footer.ut +sed -i 's/openwrt\/luci/pmkol\/openwrt-plus/g' feeds/luci/themes/luci-theme-material/ucode/template/themes/material/footer.ut +sed -i 's/openwrt\/luci/pmkol\/openwrt-plus/g' feeds/luci/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/footer.ut +sed -i 's/mirrors.pku.edu.cn/mirrors.aliyun.com/g' package/new/default-settings/default/zzz-default-settings +sed -i '/# opkg mirror/a case $(uname -m) in\n x86_64)\n echo -e '\''src/gz immortalwrt_luci https://mirrors.vsean.net/openwrt/releases/packages-23.05/x86_64/luci\nsrc/gz immortalwrt_packages https://mirrors.vsean.net/openwrt/releases/packages-23.05/x86_64/packages'\'' >> /etc/opkg/distfeeds.conf\n ;;\n aarch64)\n echo -e '\''src/gz immortalwrt_luci https://mirrors.vsean.net/openwrt/releases/packages-23.05/aarch64_generic/luci\nsrc/gz immortalwrt_packages https://mirrors.vsean.net/openwrt/releases/packages-23.05/aarch64_generic/packages'\'' >> /etc/opkg/distfeeds.conf\n ;;\n *)\n echo "Warning: This system architecture is not supported."\n ;;\nesac' package/new/default-settings/default/zzz-default-settings +sed -i '/# opkg mirror/a echo -e '\''untrusted comment: Public usign key for 23.05 release builds\\nRWRoKXAGS4epF5gGGh7tVQxiJIuZWQ0geStqgCkwRyviQCWXpufBggaP'\'' > /etc/opkg/keys/682970064b87a917' package/new/default-settings/default/zzz-default-settings + +# comment out the following line to restore the full description +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-23.05\\"/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-23.05'\'';" > /usr/share/ucode/luci/version.uc\n/etc/init.d/rpcd restart\n' package/new/default-settings/default/zzz-default-settings diff --git a/openwrt/scripts/11-fix-vendor.sh b/openwrt/scripts/11-fix-vendor.sh new file mode 100644 index 000000000..d4e6424f6 --- /dev/null +++ b/openwrt/scripts/11-fix-vendor.sh @@ -0,0 +1 @@ +sed -i '/# timezone/i grep -q '\''/tmp/sysinfo/model'\'' /etc/rc.local || sudo sed -i '\''/exit 0/i [ "$(cat /sys\\/class\\/dmi\\/id\\/sys_vendor 2>\\/dev\\/null)" = "Default string" ] \&\& echo "Industrial Router" > \\/tmp\\/sysinfo\\/model'\'' /etc/rc.local\n' package/new/default-settings/default/zzz-default-settings