用 bbappend 替换 mosquitto.conf 文件?

ape*_*pex 0 embedded linux-kernel embedded-linux openembedded yocto

我有一个层元测试,我在其中创建了一个 mosquitto_%.bbappend 用于自定义默认的 mosquitto.conf 文件,该文件由元开放嵌入层的配方创建。我的 bbappend 文件如下所示:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"  
SRC_URI += "file://mosquitto.conf"
Run Code Online (Sandbox Code Playgroud)

图像构建没有错误,但 mosquitto.conf 没有被替换。我所观察到的是,上述过程仅在存在于任何主层中时才会替换 mosquitto.conf,但由于 mosquitto_1.5.1.bb 文件仅安装此文件,并且由于此文件不存在于任何层中,我该如何覆盖这个文件?该文件在 /etc/mosquitto 目录中生成。这是我想覆盖的 bitbake 文件:http ://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb?h=thud

ape*_*pex 5

除了 Nayfe 的回答之外,我还想补充一点。我通过任务 do_install_append 解决了它,与 meta-openembedded 的 mosquitto 配方相比,我做了一些更改。我已将我的 mosquitto.conf 从工作目录移动到替换原始 conf 文件的目标目录。

 do_install_append() {

     install -d ${D}${sysconfdir}/mosquitto
     install -m 0644 ${WORKDIR}/mosquitto.conf \
                ${D}${sysconfdir}/mosquitto/mosquitto.conf
 }
Run Code Online (Sandbox Code Playgroud)