簡體   English   中英

如何編寫yocto / bitbake食譜,用我自己的文件替換默認的vsftpd.conf文件?

[英]How do I write a yocto/bitbake recipe to replace the default vsftpd.conf file with my own file?

我想用我自己的文件替換默認的vsftpd.conf文件! 我的bitbake文件如下所示:

bbexample_1.0.bb

DESCRIPTION = "Configuration and extra files for TX28"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

S = "${WORKDIR}"

SRC_URI += " \
    file://ld.so.conf \
    file://nginx/nginx.conf \
    file://init.d/myscript.sh"

inherit allarch

do_install () {
    install -d ${D}${sysconfdir}
    install -d ${D}${sysconfdir}/nginx
    install -d ${D}${sysconfdir}/init.d
    rm -f ${D}${sysconfdir}/ld.so.conf
    install -m 0755 ${WORKDIR}/ld.so.conf ${D}${sysconfdir}
    install -m 0755 ${WORKDIR}/nginx/nginx.conf ${D}${sysconfdir}/nginx/
    install -m 0755 ${WORKDIR}/init.d/myscript.sh ${D}${sysconfdir}/init.d/
}

bbexample_1.0.bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

SRC_URI += " \
    file://vsftpd.conf"

do_install_append () {
    install -m 0755 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}
}

但是,該文件無法替換! 怎么了?

您需要做的是在自己的圖層中使用bbappend,

vsftpd配方位於meta-openembedded/meta-networking/recipes-daemons

因此,您需要創建一個名為vstfpd_%.bbappend的文件( %使其對每個版本均有效)

該文件必須位於<your-layer>/meta-networking/recipes-daemons 您還需要將自定義的vsftpd.conf放在<your-layer>/meta-networking/recipes-daemons/vsftpd文件夾中

其內容應為:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

do_install_append(){
    install -m 644 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}
}

從實例元的OpenEmbedded 這里

您應該添加到食譜中:

FILES_${PN} += " file you installed"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM