Files
MemRelay/projects/6f47523e-e22e-4cdd-bd18-76e5e474ee0c/固件构建完整流程.md
T

49 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 固件构建完整流程
type: fact
permalink: main/projects/6f47523e-e22e-4cdd-bd18-76e5e474ee0c/固件构建完整流程
stable_id: 98bc33f7-c293-4e7c-aca8-f54752e2d5fa
scope: project
project_id: 6f47523e-e22e-4cdd-bd18-76e5e474ee0c
memory_type: fact
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T14:59:51.013720+00:00'
updated_at: '2026-09-23T14:59:51.013782+00:00'
tags:
- build
- docker
- workflow
---
## 启动方式
- Web 构建:前端 startBuild() → POST /api/build → 后端写临时 JSON → 调用 build-docker.ps1
- 命令行:.\scripts\build-docker.ps1 [-Jobs N] [-Clean]
## 构建链
1. build-docker.ps1 执行 docker build -t openwrt-local-builder:25.12(无代理支持)
2. docker run 挂载项目到 /workspace、缓存卷 openwrt-build-work 到 /work
3. docker-entrypoint.sh 修正文件权限,gosu builder 执行 build.sh
4. build.sh 主流程:
a. 从 Qosmio openwrt-ipq:25.12-nss 克隆/更新源码
b. 安装固定提交的外部包(LAN-Wake 等)
c. 复制本地 packages/ 到 OpenWrt
d. 根据选项重写 feeds(build_config.py feeds)
e. 载入 seed.config
f. build_config.py options 转换用户选项为 .config 和 UCI defaults
g. feeds update && install
h. 修补第三方包兼容性
i. build_config.py branding 注入品牌信息
j. patch_ax9000.py 应用分区/DTS/升级/内核补丁
k. make defconfig 并验证设备/NSS/IPv6
l. make -j$JOBS || make V=s
m. 复制产物到 outputs/ax9000/
5. 后端打包为时间戳 ZIP:OpenWRT-AX9000-YYYY-MM-DD_HH-mm-ss.zip
6. 构建日志通过 SSE (/api/logs/stream) 实时推送
## 构建缓存
Docker 命名卷 openwrt-build-work 在增量构建间保留。-Clean 参数清理 OpenWrt 源码树。