aa86
aa86

Reputation: 165

bbappend file for replacing a file

I created a new layer in yocto: meta-abc, a recipe: abc-efg_0.1.bb and a .bbappend file: abc-efg_01.bbappend.

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

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 me any tip? Thank you.

Upvotes: 12

Views: 21621

Answers (2)

Iceberg
Iceberg

Reputation: 3402

Install extra files for p910nd with bbappend file:

layout of p910nd directory

.
├── files
│   ├── p910nd.conf
│   └── p910nd.init
└── p910nd_0.97.bbappend

Content of the bbappend file

SUMMARY = "install init script"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://p910nd.init"
SRC_URI += "file://p910nd.conf"

RDEPENDS_${PN} += "bash"

do_install_append() {
         install -D -m 0644 ${WORKDIR}/p910nd.conf ${D}${sysconfdir}/default/p910nd
         install -D -m 0755 ${WORKDIR}/p910nd.init ${D}/etc/init.d/p910nd
}

In my test, do_install_append will also overwrite the file if the it is already installed in the destination.

Upvotes: 1

Anders
Anders

Reputation: 9011

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.

Upvotes: 9

Related Questions