2017-07-24 54 views
0

我想用我自己的文件替換默認的vsftpd.conf文件! bitbake的我文件看起來如下:如何編寫一個yocto/bitbake配方,以用我自己的文件替換默認的vsftpd.conf文件?

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} 
} 

但是,該文件不能被替換! 有什麼不對?

回答

0

您應該添加到你的食譜:

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

你需要做的是在自己的層使用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的here

+0

我試過_______,但我沒有取得任何成功。 – BachehKaraji

+0

可以確定你的bbappend已經加載。使用'bitbake-layers show-appends | grep vsftpd' –

相關問題