使用快照从本地源构建根包

buildroot package from local source with snapshots

我想分叉 buildroot,添加自定义包,直接在树中添加包的源,让 buildroot 使用树内源构建自定义包。我已经这样做了,在 chapter 17 of the buildroot user manual 之后,但是 buildroot 似乎没有采纳我所做的本地更改

例如,我构建了整个图像,它还构建了我的自定义应用程序。然后我进入我的自定义应用程序的源代码并添加了一个故意的语法错误——但后来我 运行 再次制作并且它愉快地生成了一个图像 使用我的自定义应用程序的旧版本 .

如何告诉 buildroot 查找本地源代码修改,即使它已经具有匹配版本的包的缓存构建?

这些是我添加到我的 buildroot 分支中的新文件:

buildroot/
  package/
    customapp/
      customapp.mk
      Config.in
  customapp/
    configure.ac
    Makefile.am
    README
    src/
      main.c
      Makefile.am

(我还编辑了 buildroot/package/Config.in 以便它获取 buildroot/package/customapp/Config.in 文件。所有 Config.in 的东西只是一个简单的布尔值来启用 customapp,它们工作正常,所以我将从这个问题中省略它们。)

以下是构建相关文件的内容:

buildroot/package/customapp/customapp.mk

CUSTOMAPP_VERSION = 0.1
CUSTOMAPP_SITE = customapp
CUSTOMAPP_SITE_METHOD = local
CUSTOMAPP_AUTORECONF = YES

$(eval $(autotools-package))

buildroot/customapp/configure.ac

AC_INIT([customapp], [0.1], [name@email.tld])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
 Makefile
 src/Makefile
])
AC_OUTPUT

buildroot/customapp/Makefile.am

SUBDIRS = src
dist_doc_DATA = README

buildroot/customapp/src/Makefile.am

bin_PROGRAMS = customapp
customapp_SOURCES = main.c

要重建 buildroot 包,您必须删除 output/build/customapp-version/.stamp* 中的标记文件。最简单的方法是删除整个构建目录。

Buildroot 仅依赖 .stamp 文件来了解需要重建的内容。

buildroot 手册的

Section 8.3 解释了如何重建单个包。最简单的方法是使用 [package name]-rebuild 目标。在你的情况下它将是:

make customapp-rebuild

您可能还想触发 buildroot post 构建操作以在您的包重新构建完成后重建目标设备文件系统映像:

make target-post-image