On 30 November 2017 at 16:54, Khem Raj <raj.khem@gmail.com> wrote:
On Thu, Nov 30, 2017 at 2:53 AM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
>
>
> On 30 November 2017 at 09:31, Ryan Harkin <ryan.harkin@linaro.org> wrote:
>>
>>
>>
>> On 30 November 2017 at 09:18, Koen Kooi <koen.kooi@linaro.org> wrote:
>>>
>>>
>>>
>>> > Op 30 nov. 2017, om 10:08 heeft Ryan Harkin <ryan.harkin@linaro.org>
>>> > het volgende geschreven:
>>> >
>>> >
>>> >
>>> > On 30 November 2017 at 08:34, Koen Kooi <koen.kooi@linaro.org> wrote:
>>> > Op 30 nov. 2017, om 09:26 heeft Ryan Harkin <ryan.harkin@linaro.org>
>>> > het volgende geschreven:
>>> > >
>>> > > Here's another question:
>>> > >
>>> > > When I build for MACHINE=imx7s-warp, should meta-raspberrypi's
>>> > > linux-firmware recipe be running or not? Is there something in
>>> > > meta-raspberrypi that makes it only run on MACHINE=raspberrypi?
>>> >
>>> > Looking at
>>> > https://github.com/agherzan/meta-raspberrypi/blob/master/recipes-kernel/linux-firmware/linux-firmware_%25.bbappend
>>> > it should be included
>>> >
>>> > > In an OE-RPB based build, it doesn't run. I put a bbwarn statement
>>> > > into the bbappend file's do_install and it didn't output anything.
>>> > >
>>> > > But when I run it in the "other" distro, meta-raspberrypi's
>>> > > linux-firmware_%.bbappend is running during a warp7 build and outputting the
>>> > > bbwarn from meta-raspberrypi.
>>> > >
>>> > > Is this expected?
>>> >
>>> > It depends on the order and content of the other linux-firmware
>>> > bbappend files, if one that sorts higher does:
>>> >
>>> > do_install() {
>>> >   something
>>> > }
>>> >
>>> > all the lower sorted appends will not get their do_install_append in.
>>> >
>>> > Anyway, try doing ‘bitbake -e linux-firmware > firmware-e.txt’ and
>>> > inspecting the result, that should list the overrides and their order for
>>> > every variable and method.
>>> >
>>> > OK, thanks for that top tip.
>>> >
>>> > So rpi and warp7 are both being included in the final do_install
>>> > function in both OE-RPB and my other distro.
>>> >
>>> > Why I didn't see the bbwarn from meta-raspberrypi on OE-RPB is a
>>> > different matter, especially as I'm no longer seeing either bbwarn when I
>>> > build right now.
>>>
>>> Code in methods only gets executed when that method runs and *doesn’t*
>>> run if bitbake uses sstate to restore it. So you might not see it due to
>>> caching working as intended.
>>
>>
>> Yes, I tried unsuccessfully to clean, I guess...
>>
>> Eg:
>> bitbake -c do_cleanall linux-firmware
>>
>>>
>>>
>>>
>>> >
>>> > But because the rpi layer is included in the manifest after/later than
>>> > my layer, the rpi do_install appended commands run after the warp7 ones, so
>>> > there's no way I'll ever get my firmware into the disk image with this
>>> > mechanism.
>>>
>>> Both appends touch the same file(s)?
>>
>>
>> Yes, identical filenames and locations, but different versions.
>>
>> :-(
>
>
> I'm trying to work out what I can to here to stop WaRP7
> linux-firmware_%.bbappend corrupting RPi3 and vice versa.
>
> In my recipe, I can use do_install_append_imx7s-warp() to prevent it from
> including during an RPi build. But RPi will still trample over my WaRP7
> build.
>
> I could move my meta-layer to be higher than RPi's, but I don't think that's
> a good solution.
>
> Would it be a good idea to submit a patch to meta-raspberrypi to change
> their do_install_append() to do_install_append_raspberrypi()?
>

I think yes you can. rpi layer is adding specific firmware and making
it universally
applicable, this is not multi-bsp friendly. So please turn that whole
bbappend to
act under _rpi override.

Thanks for the +1 on that.

However, I've just worked out that all of the firmware that RPi3's recipe is included is good for what I want to do on WaRP7:

- the BlueTooth firmware is exactly the same binary file
- the WiFi firmware is a slightly newer version than I was using on WaRP7

And it all just works if I add this to my meta layer:

diff --git a/conf/machine/imx7s-warp-foo.conf b/conf/machine/imx7s-warp-foo.conf
new file mode 100644
index 0000000..c822aa6
--- /dev/null
+++ b/conf/machine/imx7s-warp-foo.conf
@@ -0,0 +1,8 @@
+#@TYPE: Machine
+#@NAME: NXP WaRP7 Development Board
+#@DESCRIPTION: Machine configuration for the WaRP7 Zero board
+
+MACHINEOVERRIDES = "imx7s-warp:${MACHINE}"
+include conf/machine/imx7s-warp.conf
+
+MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-bcm43430"


So, in effect, I can use the RPi3 pollution of my rootfs to my advantage and move on until someone else fixes the problem.


> (I assume the SRC_URI and other variables would need their machine tags
> added too).
>
> I'll try to create a new clone of oe-rpb-manifest.xml and a fresh meta layer
> with only this recipe so I can isolate this problem and share it publicly.