如何在构建时添加更多线程?

How to add more threads when building?

做的时候

bitbake core-image-xxxx

构建任务将自动 select 8 个线程(因为我的 CPU 是 8 个核心)来构建图像。

我的系统是 72GB 内存,我可以用更多线程强制 bitbake 到 运行 吗?

或者以任何方式要求 bitbake 使用更多 ram?

增加线程使用: 您将以下内容添加到 build/conf 目录中的 local.conf。用你想要的配置替换 x 和 y

PARALLEL_MAKE = "-j x"

BB_NUMBER_THREADS = "y"

PARALLEL_MAKE 定义在 do_compile.

期间使用 make -j 命令时应使用多少线程

BB_NUMBER_THREADS 定义 bitbake 的线程数。

我不知道增加内存使用量,如果你想提高构建速度,你可以使用 ramdisk。 https://www.linuxbabe.com/command-line/create-ramdisk-linux

https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-PARALLEL_MAKE https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-BB_NUMBER_THREADS