编译 Linux Buildroot 覆盖本地更改

Compiling Linux Buildroot overrides local changes

我正在努力在我的专有 Linux 发行版中启用 kexec 支持,我想在用户 space 中调试 kexec 工具。我在位于 buildroot/output/build/kexec-2.0.15/kexec/kexec.c 的 kexec.c 中添加调试打印,但是如果我使用 make,看起来 kexec 二进制文件没有更新。如果我使用 make all 从头开始​​重建所有内容,源代码 kexec.c 已被覆盖,我看不到我的更改。我的猜测是每个完整构建都会重新提取 kexec 包,这就是我的更改没有生效的原因。

如何解决这个问题?

尝试使用"make kexec-rebuild"。

If you only want to restart the build process of a package from its compilation step, you can run make <package>-rebuild [...]. It will restart the compilation and installation of the package, but not from scratch: it basically re-executes make and make install inside the package, so it will only rebuild files that changed.

[...]

Internally, Buildroot creates so-called stamp files to keep track of which build steps have been completed for each package. They are stored in the package build directory, output/build/-/ and are named .stamp_. The commands detailed above simply manipulate these stamp files to force Buildroot to restart a specific set of steps of a package build process.

(来自 Buildroot 手册,第 Understanding how to rebuild packages 部分——我建议您阅读整个部分)

此外,请查看您的构建日志。如果您没有看到

这样的行

>>> kexec 2.0.16 Building

那么 kecxec 包还没有被(重新)构建。