简体   繁体   English

用bbappend替换mosquitto.conf文件?

[英]Replace mosquitto.conf file with bbappend?

I have a layer meta-test where I have created a mosquitto_%.bbappend for customizing the default mosquitto.conf file which is created by the meta-openembedded layer's recipe. 我有一个图层元测试,其中创建了mosquitto _%。bbappend,用于自定义默认的mosquitto.conf文件,该文件是由meta-openembedded图层的配方创建的。 My bbappend file looks like this: 我的bbappend文件如下所示:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"  
SRC_URI += "file://mosquitto.conf"

The image builds without error but the mosquitto.conf is not replaced. 映像生成没有错误,但是mosquitto.conf没有被替换。 What I have observed is the above process replaces mosquitto.conf only if it present in any of the main layers but since the mosquitto_1.5.1.bb file only installs this, and since this file is not present in any layers,how do I overwrite this file? 我观察到的是,仅当mosquitto_1.5.1.bb文件仅安装此文件时,上述过程才替换mosquitto.conf,但由于mosquitto_1.5.1.bb文件仅安装此文件,并且由于该文件不存在于任何层中,我该如何覆盖这个文件? This file gets generated in /etc/mosquitto directory. 该文件在/ etc / mosquitto目录中生成。 This is the bitbake file I want to overwrite: http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb?h=thud 这是我要覆盖的bitbake文件: http ://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb?h=thud

In addition to Nayfe's answer I want to add this. 除了Nayfe的答案之外,我还要添加此内容。 I solved it by the task do_install_append where I have made some changes compared to the meta-openembedded's mosquitto recipe. 我通过do_install_append任务解决了它,与meta-openembedded的mosquitto配方相比,我做了一些更改。 I have moved my mosquitto.conf from the working directory to the destination directory which replaces the original conf file. 我已经将mosquitto.conf从工作目录移动到了替换原始conf文件的目标目录。

 do_install_append() {

     install -d ${D}${sysconfdir}/mosquitto
     install -m 0644 ${WORKDIR}/mosquitto.conf \
                ${D}${sysconfdir}/mosquitto/mosquitto.conf
 }

you need to put your customized mosquitto.conf file here: 您需要在此处放置自定义的mosquitto.conf文件:

meta-test
  |_ recipes-connectivity
       |_ mosquitto
            |_ mosquitto_%.bbappend
            |_ files
                 |_ mosquitto.conf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM