{"id":20550884,"url":"https://github.com/sbwml/r4s_build_script","last_synced_at":"2026-01-26T18:08:56.271Z","repository":{"id":65544198,"uuid":"582661789","full_name":"sbwml/r4s_build_script","owner":"sbwml","description":"个人自用 OpenWrt 定制脚本存档（仅存档）","archived":false,"fork":false,"pushed_at":"2026-01-25T13:21:57.000Z","size":3478,"stargazers_count":130,"open_issues_count":1,"forks_count":178,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-26T05:31:37.949Z","etag":null,"topics":["build-script","clang","kernel-lto","nanopi-r4s","nanopi-r5s","nanopi-r76s","x86-64"],"latest_commit_sha":null,"homepage":"https://github.com/sbwml/builder","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbwml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-27T14:05:36.000Z","updated_at":"2026-01-25T21:53:22.000Z","dependencies_parsed_at":"2024-02-04T18:49:02.642Z","dependency_job_id":"69edf164-8554-4925-bdd7-09bb31e15880","html_url":"https://github.com/sbwml/r4s_build_script","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sbwml/r4s_build_script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbwml%2Fr4s_build_script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbwml%2Fr4s_build_script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbwml%2Fr4s_build_script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbwml%2Fr4s_build_script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbwml","download_url":"https://codeload.github.com/sbwml/r4s_build_script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbwml%2Fr4s_build_script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28784093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-script","clang","kernel-lto","nanopi-r4s","nanopi-r5s","nanopi-r76s","x86-64"],"created_at":"2024-11-16T02:27:46.951Z","updated_at":"2026-01-26T18:08:56.266Z","avatar_url":"https://github.com/sbwml.png","language":"Makefile","readme":"# NanoPi R4S/R5S/R5C/R76S \u0026 X86_64 OpenWrt 简易构建脚本存档\n\n### 存档来自：https://init2.cooluc.com\n\n---------------\n\n## 基于 Linux 6.18 LTS 固件下载:\n\n#### NanoPi R4S: https://r4s.cooluc.com\n\n#### NanoPi R5S/R5C: https://r5s.cooluc.com\n\n#### NanoPi R76S: https://r76s.cooluc.com\n\n#### X86_64: https://x86.cooluc.com\n\n#### Snapshot 25.12: https://snapshot.cooluc.com\n\n#### 构建来源: https://github.com/sbwml/builder\n\n---------------\n\n## 本地编译环境安装（根据 debian 11 / ubuntu 22）\n```shell\nsudo apt-get update\nsudo 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\n```\n\n---------------\n\n## 授权构建\n#### 由于本源码具备后门被证实 [#92](https://github.com/sbwml/r4s_build_script/issues/92)，良心发现后，防止毒害社会不再允许任何人~~与狗~~直接构建😏\n#### 如果你得到授权，请在构建前执行以下命令\n\n```\nexport git_name=账户名 git_password=密码\n```\n\n---------------\n\n### 启用 [Clang/LLVM](https://docs.kernel.org/kbuild/llvm.html) 构建内核\n##### 脚本支持使用 Clang/LLVM 构建内核，NanoPi \u0026 X86_64 设备将同时启用 LLVM LTO 链接时优化，这会增加编译的时间，但会获得更优的性能\n##### 只需在构建固件前执行以下命令即可启用 Clang/LLVM 构建内核与内核模块\n\n```\nexport KERNEL_CLANG_LTO=y\n```\n\n### 启用 [GCC13](https://gcc.gnu.org/gcc-13/)/[GCC14](https://gcc.gnu.org/gcc-14/)/[GCC15](https://gcc.gnu.org/gcc-15/) 工具链编译\n##### 只需在构建固件前执行以下命令即可启用 GCC13/GCC14/GCC15 交叉工具链\n\n```\n# GCC13\nexport USE_GCC13=y\n```\n\n```\n# GCC14\nexport USE_GCC14=y\n```\n\n```\n# GCC15\nexport USE_GCC15=y\n```\n\n### 启用 [LTO](https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html) 优化\n##### 只需在构建固件前执行以下命令即可启用编译器 LTO 优化\n\n```\nexport ENABLE_LTO=y\n```\n\n### 启用 [MOLD](https://github.com/rui314/mold) 现代链接器（需要启用 `USE_GCC13=y` 或 `USE_GCC14=y` 或 `USE_GCC15=y`）\n##### 只需在构建固件前执行以下命令即可启用 MOLD 链接，如果使用它建议同时启用 LTO 优化\n\n```\nexport ENABLE_MOLD=y\n```\n\n### 启用 [eBPF](https://docs.kernel.org/bpf/) 支持\n##### 只需在构建固件前执行以下命令即可启用 eBPF 支持\n\n```\nexport ENABLE_BPF=y\n```\n\n### 启用 [LRNG](https://github.com/smuellerDD/lrng)\n##### 只需在构建固件前执行以下命令即可启用 LRNG 内核随机数支持\n\n```\nexport ENABLE_LRNG=y\n```\n\n### ~~启用 [Glibc](https://www.gnu.org/software/libc/) 库构建 （实验性）~~\n##### ~~启用 glibc 库进行构建时，构建的固件将会同时兼容 musl/glibc 的预构建二进制程序，但缺失 `apk install` 安装源支持~~\n##### ~~只需在构建固件前执行以下命令即可启用 glibc 构建~~\n\n```\nexport ENABLE_GLIBC=y\n```\n\n### 启用本地 Kernel Modules 安装源 （For developers）\n##### 启用该标志时，将会拷贝全部 target packages 到 rootfs 并替换 openwrt_core 源为本地方式，以供离线 `opkg install kmod-xxx` 安装操作\n##### 这会增加固件文件大小（大约 70MB），对项目内核版本、模块、补丁 有修改的需求时，该功能可能会有用\n##### 只需在构建固件前执行以下命令即可启用本地 Kernel Modules 安装源\n\n```\nexport ENABLE_LOCAL_KMOD=y\n```\n\n### 启用 [DPDK](https://www.dpdk.org/) 支持\n##### DPDK（Data Plane Development Kit）是一个开源工具集，专为加速数据包处理而设计，通过优化的数据平面技术，实现高性能、低延迟的网络应用\n##### 只需在构建固件前执行以下命令即可启用 DPDK 工具集支持\n\n```\nexport ENABLE_DPDK=y\n```\n\n### 快速构建（仅限 Github Actions）\n##### 脚本会使用 [toolchain](https://github.com/sbwml/toolchain-cache) 缓存代替源码构建，与常规构建相比能节省大约 60 分钟的编译耗时，仅适用于 Github Actions `ubuntu-24.04` 环境\n##### 只需在构建固件前执行以下命令即可启用快速构建\n\n```\nexport BUILD_FAST=y\n```\n\n### 构建 Minimal 版本\n##### 不包含第三方插件，接近官方 OpenWrt 固件\n##### 只需在构建固件前执行以下命令即可构建 Minimal 版本\n\n```\nexport MINIMAL_BUILD=y\n```\n\n### 构建 iStoreOS 样式\n##### 包含 iStoreOS 的商店、状态页\n##### 只需在构建固件前执行以下命令即可构建 iStoreOS 样式\n\n```\nexport ENABLE_ISTORE=y\n```\n\n### 更改 LAN IP 地址\n##### 自定义默认 LAN IP 地址\n##### 只需在构建固件前执行以下命令即可覆盖默认 LAN 地址（默认：10.0.0.1）\n\n```\nexport LAN=10.0.0.1\n```\n\n### 更改默认 ROOT 密码\n##### 只需在构建固件前执行以下命令即可设置默认 ROOT 密码（默认：无密码）\n\n```\nexport ROOT_PASSWORD=12345678\n```\n\n### 使用 uhttpd 轻量 web 引擎\n##### 固件默认使用 Nginx（quic） 作为页面引擎，只需在构建固件前执行以下命令即可使用 uhttpd 取代 nginx\n##### Nginx 在具备公网的环境下可以提供更丰富的功能支持\n\n```\nexport ENABLE_UHTTPD=y\n```\n\n### 禁用全模块编译（For developers）\n##### 启用该标志时，固件仅编译 config 指定的软件包和内核模块，但固件不再支持安装内核模块（opkg install kmod-xxx），强制安装模块将会导致内核崩溃\n##### 最大的可能性降低 OpenWrt 的编译耗时，适用于开发者调试构建\n\n```\nexport NO_KMOD=y\n```\n\n---------------\n\n## 构建 OpenWrt 25.12 最新 Releases\n\n### nanopi-r4s\n```shell\n# linux-6.12\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r4s\n```\n\n### nanopi-r5s/r5c\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r5s\n```\n\n### nanopi-r76s\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) rc2 nanopi-r76s\n```\n\n### x86_64\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) rc2 x86_64\n```\n\n## 构建 OpenWrt 25.12 开发版（25.12-SNAPSHOT）\n\n### nanopi-r4s\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r4s\n```\n\n### nanopi-r5s/r5c\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r5s\n```\n\n### nanopi-r76s\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) dev nanopi-r76s\n```\n\n### x86_64\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://init2.cooluc.com/build.sh) dev x86_64\n```\n\n-----------------\n\n# 基于本仓库进行自定义构建 - 本地编译\n\n#### 如果你有自定义的需求，建议不要变更内核版本号，这样构建出来的固件可以直接使用 `opkg install kmod-xxxx`\n\n### 一、Fork 本仓库到自己 GitHub 存储库\n\n### 二、修改构建脚本文件：`openwrt/build.sh`（使用 Github Actions 构建时无需更改）\n\n将 init.cooluc.com 脚本默认连接替换为你的 github raw 连接，像这样 `https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master`\n\n```diff\n # script url\n-export mirror=https://init.cooluc.com\n+export mirror=https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master\n```\n\n### 三、在本地 Linux 执行基于你自己仓库的构建脚本，即可编译所需固件\n\n#### nanopi-r4s openwrt-25.12\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 nanopi-r4s\n```\n\n#### nanopi-r5s/r5c openwrt-25.12\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 nanopi-r5s\n```\n\n#### x86_64 openwrt-25.12\n```shell\n# linux-6.18\nbash \u003c(curl -sS https://raw.githubusercontent.com/你的用户名/r4s_build_script/refs/heads/master/openwrt/build.sh) rc2 x86_64\n```\n\n-----------------\n\n# 使用 Github Actions 构建\n\n### 一、Fork 本仓库到自己 GitHub 存储库\n\n### 二、构建固件\n\n- 在存储库名称下，单击（\u003cimg src=\"https://github.com/user-attachments/assets/f1db14da-2dd9-4f10-8e37-d92ef9651912\" alt=\"Actions\"\u003e Actions）。\n  \n- 在左侧边栏中，单击要运行的工作流的名称：**Build releases**。\n  \n- 在工作流运行的列表上方，单击“**Run workflow**”按钮，选择要构建的设备固件并运行工作流。\n  \n  ![image](https://github.com/user-attachments/assets/3eae2e9f-efe6-48ad-8e9d-39c176fcd71c)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbwml%2Fr4s_build_script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbwml%2Fr4s_build_script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbwml%2Fr4s_build_script/lists"}