Bitbake recipes requiring configuration
Brad Bishop
bradleyb at fuzziesquirrel.com
Tue May 3 11:48:47 AEST 2022
On Mon, May 02, 2022 at 05:54:20AM +0000, Joel Stanley wrote:
>Hi Brad,
>
>I'm after some general direction for bitbake recipes that require a
>machine to provide configuration or script. eg:
>
>SRC_URI += "file://whiz-bang.sh"
>
>whiz-app/
> whiz-app.bb
> amachine/whiz-bang.sh
> theothermachine/whiz-bang.sh
>
>If my layer supports three machines: amachine, theothermachine, and
>bestmachine, bitbake will emit a warning for bestmachine, because
>there's no whiz-bang.sh specified.
>
>We could change the SRC_URI to be conditional on :append:<machine>, or
>provide an whiz-bang.sh next to the .bb. Or another option I haven't
>thought of.
>
>Is there a (better) pattern we should be following here?
>
>For a concrete case, I have put this change up for review:
>
> https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/53432
>
>There are several apps in meta-ibm that currently warn depending on
>the machine you're targeting, so would benefit from cleaning this up.
I think you've listed/discovered all the options I'm aware of. The
approach taken in the patch seems reasonable. A variation of it might
be to identify an abstraction if there is one and add it to
MACHINEOVERRIDES. For example if a bunch of systems are P9 systems add
something like:
MACHINEOVERRIDES := "ibm-power9-cpu"
to the <machine>.conf and do this in the recipes:
SRC_URI:append:ibm-power9-cpu = " file://foo.sh"
-brad
More information about the openbmc
mailing list