bbappend file for replacing a file

aa86 picture aa86 · Sep 27, 2017 · Viewed 9.1k times · Source

I created a new layer in yocto: meta-abc, a recipe: abc-efg_0.1.bb and an .bbapend: abc-efg_01.bbapend file. With the bbappend file I want to overwrite a file from intel-edison board. More exactly, the wpa_supplicant.conf from /etc/wpa_supplicant/. This wpa_supplicant.conf is already created from another layer (meta-intel-edison-distro). I can write my file in /etc/ so my recipe and my bbappend file are working. I can bitbake my recipe, but when I try to creat the image I receive the message:

" * check_data_file_clashes: Package abc-efg wants to install file /home/atr-int/Desktop/Yocto/yocto-edison/build_edison/tmp/work/edison-poky-linux/edison-image/1.0-r0/rootfs/etc/wpa_supplicant/wpa_supplicant.conf But that file is already provided by package * wpa-supplicant * opkg_install_cmd: Cannot install package abc-etc. " Here is my bbappend file content:

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

SRC_URI += "file://wpa_supplicant.conf"

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

Can anyone give my any tip ? Thank you.

Answer

Anders picture Anders · Sep 27, 2017

You shouldn't rewrite the wpa_supplicant.conf from another recipe, as the files will clash.

Instead, rename your abc-efg_01.bbapend to wpa-supplicant_%.bbappend, and it should work.

If for some reason you need to have wpa_supplicant.conf in abc-efg, you need to add a wpa-supplicant_%.bbappend in which you'll need to remove wpa_supplicant.conf.