1

I want to replace the default vsftpd.conf file with my own file! My bitbake file looks following:

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

But, the file could not be replaced! What is wrong?

BachehKaraji
  • 21
  • 2
  • 5

2 Answers2

4

What you need to do is to use a bbappend in your own layer,

vsftpd recipe is located in meta-openembedded/meta-networking/recipes-daemons

Thus you need to create a file called vstfpd_%.bbappend (% makes it valid for every version)

This file must be located in <your-layer>/meta-networking/recipes-daemons. You also need to put your custom vsftpd.conf in <your-layer>/meta-networking/recipes-daemons/vsftpd folder

Its content should be:

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

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

Example from meta-openembedded here

David Bensoussan
  • 2,887
  • 2
  • 38
  • 55
  • To be sure you're bbappend is loaded. Use `bitbake-layers show-appends | grep vsftpd` – David Bensoussan Jul 25 '17 at 05:51
  • 1
    This was very helpful: worked for me. One comment though: you say that the bbappend must be located in "/meta-networking/recipes-daemons/vsftpd". I do not think it needs to be in a path which matches the path of the recipe being appended to. Only the file name must match. I have a different path, and it picked up the bbappend. – dazed Jun 27 '19 at 12:47
  • You are right, it is not mandatory, but it is very convenient to find it easily – David Bensoussan Jun 27 '19 at 15:37
0

you should add to your recipe:

FILES_${PN} += " file you installed"
BachehKaraji
  • 21
  • 2
  • 5