feature: buildmeter support#90
Merged
Merged
Conversation
将 rootfs 构建从手工脚本链迁移到 buildroot。buildroot 只接管 rootfs
用户空间;kernel/uboot 仍由 build_helper 双轨构建,镜像脚本不变。
阶段一 rootfs 主体:
- third_party/buildroot submodule + rootfs/buildroot/ external tree
(imx6ull_aes_defconfig:Cortex-A7 / 外部 arm-gnu 15.2 工具链 / busybox
877 applet / ttymxc0 getty / eudev / ext4)
- build_helper/{build-buildroot,buildroot_menuconfig,clean_buildroot}.sh
- varified_rootfs_ok.sh 拆分:构造移交 buildroot,只留校验闸门(-358 行)
- post-build.sh 补 linuxrc / home / securetty(busybox SECURETTY 要求)
+ 下载 SDMA 固件 + 跑 varified 校验
- release-all.sh Stage 3/4 改调 buildroot;CI/Docker 装 cpio
- 删 build-busybox.sh / build_release_busybox.sh / install_libc.sh
阶段二 第三方包:
- alsa → buildroot ALSA_LIB + ALSA_UTILS(aplay/arecord/amixer/alsactl/
alsaucm/speaker-test)
- SDMA 固件 → post-build 下载
- 删 install_alsa.sh / install_firmwares.sh / merge_overlay_rootfs.sh
- build-buildroot.sh rsync 加 NFS root 运行时 exclude(seedrng/urandom/...)
验证:rootfs 442MB → 32MB(消除 .a 臃肿);完整重编 + NFS 上板启动到登录。
buildroot 2026.02 原生 Qt6 = 6.9.1(与项目一致),阶段三可直接用原生包。
阶段三(buildroot 原生 Qt6 替代 install_qt_with_compile.sh / install_fonts.sh / qt-compile-pipeline submodule): - defconfig 加 Qt6 6.9.1(buildroot 2026.02 原生 = 项目版本): qt6base(gui/widgets/linuxfb/tslib,关 xcb/eglfs/opengl 对齐 target.conf) + QT6DECLARATIVE_QUICK(拉 qt6shadertools + host qmlprofiler 依赖) + declarative/multimedia/charts/serialport/virtualkeyboard/core5compat (对齐 qt.conf 8 模块) - post-build 加 Noto CJK Regular + Emoji 字体下载 (DejaVu 由 buildroot dejavu 包装;字体全集 = DejaVu + CJK + Emoji) - 删 install_qt_with_compile.sh + install_fonts.sh + config/qt/ - 删 qt-compile-pipeline submodule + third_party_install/ 整个目录 (机制完全退役,buildroot packages + overlay + post-build 接管) 验证:Qt6 全模块(11 .so + linuxfb plugin + qmake6)构建通过; rootfs 173MB(字体全集 + Qt6 全模块 .so;原 442MB 含 .a 臃肿,省 61%)。
buildroot defconfig 默认含 Qt6(2-4h)→ ci-full 无 label 时 30 分钟超时必败。 延续原 SKIP_THIRD_PARTY 机制(默认快 + label 触发慢): - imx6ull_aes_defconfig 移除 Qt6 段(最小 rootfs:busybox+alsa+firmware) - 新增 fragments/qt6.config(Qt6 全模块,对齐原 qt.conf 8 模块) - build-buildroot.sh 加 --with-qt6 / BUILDROOT_QT6=1:defconfig 后 merge_config.sh -m -O 合 qt6 fragment + olddefconfig(merge_config 需 -O 才能调 conf) - post-build CJK/Emoji 字体仅 Qt6 rootfs 时下载(检测 libQt6Core.so, 最小 rootfs 跳过省 30MB) - ci-full.yml:SKIP_THIRD_PARTY_INSTALL → BUILDROOT_QT6(compile-support-3rd-party label) 默认最小 rootfs(~15min,30min timeout 够),label 触发 Qt6(600min) 本地出 Qt6 rootfs:build-buildroot.sh --with-qt6
ci-build.yml:删 busybox job + detect output + changes filter (busybox 现由 buildroot 构建,在 ci-full 验证;ci-build PR 不再单独编 busybox) document/scripts:删 9 个孤立 .md(对应已删脚本)+ 补 3 个新脚本文档 (build-buildroot.sh / buildroot_menuconfig.sh / clean_buildroot.sh) index.md:目录结构 + 用法示例去 build-busybox/third_party_install,加 buildroot 三脚本 docker:Dockerfile / Dockerfile.cn / README 的示例 build-busybox → build-buildroot
buildroot 迁移删了 build-busybox / build_release_busybox / merge_overlay_rootfs 等脚本后,varified_rootfs_ok.sh.md / release-all.sh.md / logging.sh.md 的 "相关文档"链接仍指向已删 .md → VitePress build 报 4 dead link。 改向 build-buildroot.sh.md(或删 merge_overlay 项)。 (各 .md 正文的纯文本历史引用留待 3e 文档重写统一清理。)
mainline 内核编译慢的两个 ccache 根源: - ccache 只有 2G:mainline 内核编译 ccache 需 3-5G,2G 不够 → LRU 清除 旧条目 → 命中率下降 → 重编慢。改 5G(ci-build + ci-full linux-mainline job) - ci-full linux-mainline ccache key 带 run_id:每次 run 新 key,save 累积被 GitHub LRU 清 → 命中率降。去掉 run_id 对齐 ci-build 稳定 key 下次 CI 跑可见 ccache -s 命中率提升、mainline 编译时间下降。
ci-build 的 linux-mainline job 原走 `release-all --mainline --stage 2` → `build_release_mainline_linux.sh`(reset submodule + 创建 release 分支 + apply patch + 生成 build_info),那是 release 发布流程,CI 验证不需要, reset/clean/release 分支等额外开销拖慢。照 NXP(linux-imx)job 抄: - 加 "应用 Linux Mainline 补丁" step(像 NXP,直接 apply_patches.sh linux_mainline) - build 直接 `build-mainline-linux.sh`(不走 release-all / build_release_mainline) - 验证/上传路径 out/release-latest/linux → out/mainline/linux;去掉 build_info 检查 - timeout 22 → 25(对齐 NXP) ccache 5G(上一 commit)保留。ci-full 的 mainline 仍走完整 release-all(它要 release 产物 + build_info,不变)。
照 drivers job 的整树缓存模式,给 ci-build 的 linux-mainline job 加: - kernel-meta(采集 linux_mainline HEAD sha)+ kernel-cache(out/mainline/linux 整树,key = sha + defconfig/patch/build 脚本 hash) - build step 加 if: cache-hit != true(命中跳过编译) 效果:同 PR 反复 re-trigger(源码/defconfig/patch/build 都没变)→ key 命中 → 跳过 16min 编译秒级过;patch/defconfig/源码更新 → key 变 → 全编(ccache 兜底)。 根因(mainline 慢):mainline patch/defconfig 跟随驱动教程频繁更新 → ccache 失效 (实测 mainline 1.74% hit vs NXP 99.89%)。整树缓存(管"没变就秒过")+ ccache 5G (管"变了的部分加速")两层兜底。
- scripts/lib/progress.sh(新): 定位 buildmeter(cli.py 路径 + 可用性检测), 支持 FORGE_PROGRESS_PY / FORGE_PROGRESS_TAIL / FORGE_PROGRESS_DISABLE 环境变量 - build-mainline-linux.sh: kernel pipe 接入(set -o pipefail),clean 走 make -n -k 预扫描出 %,fast 增量 indeterminate - build-buildroot.sh: buildroot 接入(-j$(nproc) + tee 全量 log + show-targets "All Packages: N" + --tail 滑动窗口);--clean 改只清理不构建(原 fallthrough 自动构建)
- third_party/buildmeter: submodule(AELS org,pin e7e20f5,ignore=dirty) - progress.sh: FORGE_PROGRESS_PY 默认从 ~/buildmeter(临时克隆)改 third_party/buildmeter (正式);用 source 方提供的 PROJECT_ROOT(不用 BASH_SOURCE —— 它在 bash -c/嵌套 source 下会退化成空串)
- build-uboot.sh: make pipe 接入 buildmeter(uboot profile,同 kernel kbuild), dry-run 预扫描出 %;--ignore-errors 过滤 binman 的 'Error 103'/'images are invalid' 已知噪音 - third_party/buildmeter: bump submodule(含 UbootParser)
# Conflicts: # .gitmodules # document/scripts/build_helper/build-buildroot.sh.md # scripts/build_helper/build-buildroot.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.