diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e40580cf8..00a340234 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: 'LAN=172.16.1.1 KERNEL_CLANG_LTO=y USE_GCC15=y ENABLE_LTO=y ENABLE_MOLD=y ENABLE_BPF=y ENABLE_LRNG=y BUILD_FAST=y' type: string jobs: @@ -71,7 +71,8 @@ jobs: bash <(curl -sS https://raw.githubusercontent.com/${{ github.repository }}/master/openwrt/build.sh) rc2 ${{ github.event.inputs.device }} cd openwrt tags=$(git describe --abbrev=0 --tags) - echo "latest_release=$tags" >>$GITHUB_ENV + 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 @@ -97,7 +98,6 @@ jobs: elif [ "${{ github.event.inputs.device }}" = "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 diff --git a/README.md b/README.md index 2f447b4c0..05f3a54a0 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,67 @@ -# NanoPi R4S/R5S/R5C & X86_64 OpenWrt 简易构建脚本存档 +# opwrt_build_script -### 存档来自:https://init2.cooluc.com +### x86_64 固件下载: + +https://github.com/JohnsonRan/opwrt_build_script/releases + +``` +【首次登陆】 +地址:172.16.1.1(默认) +用户:root +密码:空 + +【分区挂载】 +系统 -> 磁盘管理 -> 磁盘 -> 编辑 +系统 -> 挂载点 +``` --------------- -## 基于 Linux 6.6 LTS 固件下载: +#### 存档来自:https://init2.cooluc.com -#### NanoPi R4S: https://r4s.cooluc.com +- 优化系统内核 + - [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: https://r5s.cooluc.com +| ⚓ 服务 | 🩺 网络 | +| :---- | :---- | +| Watchcat | 网速测试 | +| Mihomo | WireGuard | +| | UPnP | -#### X86_64: https://x86.cooluc.com +------ -#### 构建来源: https://github.com/sbwml/builder +### RTC 硬件时钟 ---------------- +**本固件支持 RTC 硬件时钟读取/同步,当设备断电时,重新通电启动系统时间不会错乱** *(注意:设备需要安装 RTC 电池后使用)* + +**首次安装 RTC 电池写入时间命令** + +```shell +hwclock -w -f /dev/rtc0 +``` + +**测试时间读取(返回当前时间表示正常)** + +```shell +hwclock -f /dev/rtc0 +``` -## 本地编译环境安装(根据 debian 11 / ubuntu 22) + +## 本地编译 + +### 环境安装(需要 `backports` 源) ```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 ``` -##### 安装 [LLVM/CLANG](https://github.com/sbwml/redhat-llvm-project) - 启用 `ENABLE_BPF` / `KERNEL_CLANG_LTO` 时需要 +### 安装 [LLVM/CLANG](https://github.com/sbwml/redhat-llvm-project) ```shell # 下载并解压 @@ -43,208 +82,26 @@ clang --version InstalledDir: /opt/clang/bin ``` ---------------- - -### 启用 [Clang/LLVM](https://docs.kernel.org/kbuild/llvm.html) 构建内核 -##### 脚本支持使用 Clang/LLVM 构建内核,NanoPi & X86_64 设备将同时启用 LLVM LTO 链接时优化,这会增加编译的时间,但会获得更优的性能 -##### 编译环境需要安装 Clang/LLVM 工具链,推荐使用 clang 16~18 版本 -##### 只需在构建固件前执行以下命令即可启用 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 -``` - -### 启用 [DPDK](https://www.dpdk.org/) 支持 -##### DPDK(Data Plane Development Kit)是一个开源工具集,专为加速数据包处理而设计,通过优化的数据平面技术,实现高性能、低延迟的网络应用 -##### 只需在构建固件前执行以下命令即可启用 DPDK 工具集支持 - -``` -export ENABLE_DPDK=y -``` - -### 快速构建(仅限 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 -``` - ---------------- - -## 构建 OpenWrt 23.05 最新 Releases - -### nanopi-r4s -```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r4s -``` - -### nanopi-r5s/r5c +### 开始构建 +#### 下载源码 ```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r5s +git clone https://github.com/JohnsonRan/opwrt_build_script +cd opwrt_build_script ``` - -### x86_64 -```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) rc2 x86_64 -``` - -## 构建 OpenWrt 23.05 开发版(23.05-SNAPSHOT) - -### nanopi-r4s -```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r4s -``` - -### nanopi-r5s/r5c -```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r5s -``` - -### x86_64 -```shell -# linux-6.6 -bash <(curl -sS https://init2.cooluc.com/build.sh) dev x86_64 -``` - ------------------ - -# 基于本仓库进行自定义构建 - 本地编译 - -#### 如果你有自定义的需求,建议不要变更内核版本号,这样构建出来的固件可以直接使用 `opkg install kmod-xxxx` - -### 一、Fork 本仓库到自己 GitHub 存储库 - -### 二、修改构建脚本文件:`openwrt/build.sh`(使用 Github Actions 构建时无需更改) - -将 init.cooluc.com 脚本默认连接替换为你的 github raw 连接(不带 https://),像这样 `raw.githubusercontent.com/你的用户名/r4s_build_script/master` +#### 修改构建脚本文件:`openwrt/build.sh` ```diff # script url if [ "$isCN" = "CN" ]; then - export mirror=init.cooluc.com -+ export mirror=raw.githubusercontent.com/你的用户名/r4s_build_script/master ++ export mirror=raw.githubusercontent.com/JohnsonRan/opwrt_build_script/master else - export mirror=init2.cooluc.com -+ export mirror=raw.githubusercontent.com/你的用户名/r4s_build_script/master ++ export mirror=raw.githubusercontent.com/JohnsonRan/opwrt_build_script/master fi ``` - -### 三、在本地 Linux 执行基于你自己仓库的构建脚本,即可编译所需固件 - -#### nanopi-r4s openwrt-23.05 +#### 启动! ```shell -# linux-6.6 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/master/openwrt/build.sh) rc2 nanopi-r4s -``` - -#### nanopi-r5s/r5c openwrt-23.05 -```shell -# linux-6.6 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/master/openwrt/build.sh) rc2 nanopi-r5s -``` - -#### x86_64 openwrt-23.05 -```shell -# linux-6.6 -bash <(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/master/openwrt/build.sh) rc2 x86_64 -``` - ------------------ - -# 使用 Github Actions 构建 - -### 一、Fork 本仓库到自己 GitHub 存储库 - -### 二、构建固件 -- 在存储库名称下,单击(Actions Actions)。 - -- 在左侧边栏中,单击要运行的工作流的名称:**Build releases**。 - -- 在工作流运行的列表上方,单击“**Run workflow**”按钮,选择要构建的设备固件并运行工作流。 - - ![image](https://github.com/sbwml/r4s_build_script/assets/16485166/136abcd1-ecf3-4e6d-aa1a-5393a75a25cc) +export LAN=172.16.1.1 KERNEL_CLANG_LTO=y USE_GCC15=y ENABLE_LTO=y ENABLE_MOLD=y ENABLE_BPF=y ENABLE_LRNG=y +bash openwrt/build.sh rc2 x86_64 +``` \ No newline at end of file diff --git a/openwrt/23-config-common b/openwrt/23-config-common index beb2db3d4..ddf742895 100644 --- a/openwrt/23-config-common +++ b/openwrt/23-config-common @@ -47,16 +47,17 @@ CONFIG_PACKAGE_dnsmasq_full_ipset=y # CONFIG_PACKAGE_dnsmasq is not set ### Docker -CONFIG_DOCKER_CGROUP_OPTIONS=y -CONFIG_DOCKER_NET_ENCRYPT=y -CONFIG_DOCKER_NET_MACVLAN=y -CONFIG_DOCKER_NET_OVERLAY=y -CONFIG_DOCKER_NET_TFTP=y -CONFIG_DOCKER_OPTIONAL_FEATURES=y -CONFIG_DOCKER_STO_BTRFS=y -CONFIG_DOCKER_STO_EXT4=y -CONFIG_PACKAGE_luci-app-dockerman=y -CONFIG_PACKAGE_luci-lib-docker=y +# 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 @@ -68,65 +69,68 @@ 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_PACKAGE_nginx-all-module=y 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-accesscontrol is not set +# 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-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-frpc=y -CONFIG_PACKAGE_luci-app-gowebdav=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-filebrowser is not set +# CONFIG_PACKAGE_luci-app-frpc is not set +# CONFIG_PACKAGE_luci-app-gowebdav 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-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-wolplus=y -CONFIG_PACKAGE_luci-app-zerotier=y -CONFIG_PACKAGE_ariang-nginx=y +# 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 ### 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 @@ -136,31 +140,31 @@ CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin=y # 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 is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_IPT2Socks is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Redsocks2 is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Simple_Obfs is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Xray_Plugin is not set +# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Libev_Client is not set # 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 @@ -223,6 +227,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 @@ -233,7 +238,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 @@ -258,7 +263,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/23-config-musl-x86 b/openwrt/23-config-musl-x86 index d072df50e..143936bab 100644 --- a/openwrt/23-config-musl-x86 +++ b/openwrt/23-config-musl-x86 @@ -8,8 +8,8 @@ CONFIG_TESTING_KERNEL=y ### Basic CONFIG_ALL_KMODS=y CONFIG_ALL_NONSHARED=y -CONFIG_KERNEL_BUILD_DOMAIN="cooluc.com" -CONFIG_KERNEL_BUILD_USER="admin" +# CONFIG_KERNEL_BUILD_DOMAIN="cooluc.com" +# CONFIG_KERNEL_BUILD_USER="admin" CONFIG_PACKAGE_autocore-x86=y CONFIG_PACKAGE_bind-host=y CONFIG_PACKAGE_block-mount=y @@ -38,25 +38,25 @@ 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-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=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-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 diff --git a/openwrt/build.sh b/openwrt/build.sh index 058cb39e6..ddd84f197 100644 --- a/openwrt/build.sh +++ b/openwrt/build.sh @@ -255,6 +255,7 @@ 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/99_clean_build_cache.sh chmod 0755 *sh [ "$(whoami)" = "runner" ] && group "patching openwrt" @@ -264,6 +265,7 @@ 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 [ "$(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..779248404 --- /dev/null +++ b/openwrt/scripts/10-customize-config.sh @@ -0,0 +1,30 @@ +# mihomo +git clone https://$github/morytyann/OpenWrt-mihomo package/new/openwrt-mihomo +mkdir -p files/etc/mihomo/run/ui +curl -Lso files/etc/mihomo/run/Country.mmdb https://$github/NobyDa/geoip/raw/release/Private-GeoIP-CN.mmdb +curl -Lso files/etc/mihomo/run/GeoIP.dat https://$github/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat +curl -Lso files/etc/mihomo/run/GeoSite.dat https://$github/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat +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 +mv metacubexd-gh-pages files/etc/mihomo/run/ui/metacubexd + +# sysupgrade keep files +echo "/etc/hotplug.d/iface/*.sh" >> files/etc/sysupgrade.conf +echo "/etc/mihomo" >> files/etc/sysupgrade.conf + +# from pmkol/openwrt-plus +# remove ssrplus +rm -rf package/new/helloworld/luci-app-ssr-plus +rm -rf package/new/helloworld/patch-luci-app-ssr-plus.patch +# 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 's/openwrt\/luci/JohnsonRan\/opwrt_build_script/g' feeds/luci/themes/luci-theme-material/ucode/template/themes/material/footer.ut +sed -i 's/openwrt\/luci/JohnsonRan\/opwrt_build_script/g' feeds/luci/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/footer.ut +sed -i 's/mirrors.pku.edu.cn/mirrors.cernet.edu.cn/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.cernet.edu.cn/openwrt/releases/packages-23.05/x86_64/luci\nsrc/gz immortalwrt_packages https://mirrors.cernet.edu.cn/openwrt/releases/packages-23.05/x86_64/packages'\'' >> /etc/opkg/distfeeds.conf\n ;;\n aarch64)\n echo -e '\''src/gz immortalwrt_luci https://mirrors.cernet.edu.cn/openwrt/releases/packages-23.05/aarch64_generic/luci\nsrc/gz immortalwrt_packages https://mirrors.cernet.edu.cn/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 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 "x86_64" > \\/tmp\\/sysinfo\\/model'\'' /etc/rc.local\n' package/new/default-settings/default/zzz-default-settings +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 \ No newline at end of file