On 29 November 2017 at 07:54, Nicolas Dechesne <nicolas.dechesne@linaro.org> wrote:
On Wed, Nov 29, 2017 at 8:36 AM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> Hello,
>
> I am seeing this error in my build:
>
> Configuring aCollected errors:
>  * check_data_file_clashes: Package linux-firmware-bcm43430 wants to install
> file
> /linaro/mbl/workspace-arm/build-mbl/tmp-mbl-glibc/work/imx7s_warp-oe-linux-gnueabi/mbl-console-image-test/1.0-r0/rootfs/lib/firmware/brcm/brcmfmac43430-sdio.bin
> But that file is already provided by package  * firmware-imx
>  * check_data_file_clashes: Package linux-firmware-bcm43430 wants to install
> file
> /linaro/mbl/workspace-arm/build-mbl/tmp-mbl-glibc/work/imx7s_warp-oe-linux-gnueabi/mbl-console-image-test/1.0-r0/rootfs/lib/firmware/brcm/brcmfmac43430-sdio.txt
> But that file is already provided by package  * firmware-imx

as the error message says it, 1 file in the root file system has to be
installed by 1 package, and only one. The process of building an image
with OE/bitbake is:

1. determine the list of all packages be installed. This is done by
looking at all RDEPENDS for the 'image' you are building.
2. build all recipes that are needed by the image (and all their dependencies)
3. install all binary packages that were just built in #2 into a
'local root filesystem'
4. create an 'image' file (ext4, sd card, ...) from the rootfs in #3

#3 is basically just 'uncompressing' binary packages into a folder. So
if 2 packages try to install the same file, it will fail and abort ,
like in your case. 1 file in the resulting rootfs belongs to 1 binary
package.

>
> In my build, I'm including meta-raspberrypi and meta-freescale-3rdparty in
> my manifest. These two meta layers include the following two files into the
> rootfs in various ways:
>
> /lib/firmware/brcm/brcmfmac43430-sdio.txt
> /lib/firmware/brcm/brcmfmac43430-sdio.bin
>
> For example, in the following files define a way of adding the firmware into
> the rootfs (there will be more ways they get into the build, saying as one
> is a .inc file):
>
> meta-freescale-3rdparty/recipes-bsp/broadcom-nvram-config/broadcom-nvram-config.inc
> meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
> openembedded-core/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
>
> My meta-layer is included after meta-freescale* and meta-raspberrypi, but
> before openembedded-core/meta in my BBLAYERS setup.

Order/priority won't matter here. if 1 file is to be found in 2
*different* packages, then installing these 2 packages into the same
image will fail.

>
> However, I want to provide a newer version of these two files in my build.
> So we created this recipe in our meta layer:
>
> file: recipes-bsp/firmware-imx/firmware-imx_%.bbappend
> --------------------------------------------------------------------------------------
> SRCREV_linuxfirmware = "a61ac5cf8374edbfe692d12f805a1b194f7fead2"
> SRCREV_recalboxbuildroot = "f648e4b54eb5e4be593746d6cc51375b22a7efbd"
>
> SRC_URI +=
> "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git;branch=${SRCBRANCH};destsuffix=${S}/git1;name=linuxfirmware
> \
> git://github.com/recalbox/recalbox-buildroot.git;protocol=https;branch=${SRCBRANCH};destsuffix=${S}/git2;name=recalboxbuildroot
> "
> LIC_FILES_CHKSUM +=
> "file://git1/LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
>                     file://git2/COPYING;md5=e4edbc78b8892db416b6a07e0d97309a
> "
>
> do_install_append() {
>     install -d ${D}${base_libdir}/firmware
>     install -d ${D}${base_libdir}/firmware/brcm
>
>     cp -rfv git1/brcm/brcmfmac43430-sdio.bin
> ${D}${base_libdir}/firmware/brcm
>     cp -rfv
> git2/board/warp7/rootfs_overlay/lib/firmware/brcm/brcmfmac43430-sdio.txt
> ${D}${base_libdir}/firmware/brcm
> }
>
> FILES_${PN} += "${base_libdir}/firmware/brcm/brcmfmac43430*"
>
> COMPATIBLE_MACHINE = "(imx7s-warp)"
> --------------------------------------------------------------------------------------

I am not familiar with the layers you are using, but I think that a
bbappend for linux-firmware like they do in meta-rpi would be more
appropriate. e.g. you would modify an existing package instead of
making a new one.

Well, that's what I'm trying to do - to overlay the recipe that provides the firmware and provide a newer version of the same firmware. Perhaps I'm overlaying the wrong recipe?

The error implies that instead of overlaying "firmware-imx", I should be overlaying "linux-firmware-bcm43430" , but I can't find a package of that name in my workspace. But I suspect that the package name in the error comes from the FILES_${PN}-bcm43430 entry in another bbappend.


>
> It builds fine in a "normal" configuration. However, in a "test" build,
> where "dev-pkgs" is added to IMAGE_FEATURES, I get the error as above.

It probably means that linux-firmware is not included by default, and
gets pulled in when you include dev-pkgs feature.

>
> So how do I work around this issue? Am I doing the wrong thing by providing
> a bbappend to overlay these files?
>
> Any advice appreciated.
>
> Regards,
> Ryan.
>
> _______________________________________________
> OpenEmbedded mailing list
> OpenEmbedded@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/openembedded
>