Re: Using OVERRIDES to set variables from outside the recipe file


Quentin Schulz
 

Hi Andrew,

On Thu, Dec 03, 2020 at 03:45:41AM +0000, Andrew Loader wrote:
In the bitbake user manual it has an example of how to set the variable value using the OVERRIDE variable

OVERRIDES = "architecture:os:machine"
TEST = "default"
TEST_os = "osspecific"
TEST_nooverride = "othercondvalue"

Lets say this is in the recipe called "test_0.1.bb" and we remove the OVERRIDES line from it

If we want to the OVERRIDES value to configure the recipe externally say in local.conf as I do not want to change the recipe how would I do that?
OVERRIDES is set in configuration files usually (always?). It can be
either in a distro if you use DISTROOVERRIDES, in a machine if you use
MACHINEOVERRIDES, and you might be able to add manually to it from
local.conf or other ways but I think you should go with DISTROOVERRIDES
or MACHINEOVERRIDES.

Then, the OVERRIDES (which contains MACHINEOVERRIDES:DISTROOVERRIDES
among other things) will be used in all recipes you can find and it
should just work.

You can use bitbake -e my-recipe | grep -e "^OVERRIDES=" to check the
content of the OVERRIDES variable. Note that righmost "OVERRIDE" is the
one which takes precedence over all others.

Quentin

Join yocto@lists.yoctoproject.org to automatically receive all group messages.