Get target machine


Iggy
 

Hi,

I have a .inc file that contains this information:

# Set the MACHINE string, expected to eventually replace the long list of
# build settings below
EXTRA_OECMAKE += "-DRDK_MACHINE=${@d.getVar('MACHINE', False)} "
 
# Set the region and platform type (defaults to Xi6 and UK)
EXTRA_OECMAKE_append_xione-uk = " -DRDK_PLATFORM=XI1 -DREGION=UK "
EXTRA_OECMAKE_append_xione-us = " -DRDK_PLATFORM=XI1 -DREGION=UK "
 
EXTRA_OECMAKE_append_llama-uk = " -DRDK_PLATFORM=LLAMA -DREGION=UK "
EXTRA_OECMAKE_append_llama-us = " -DRDK_PLATFORM=LLAMA -DREGION=UK "

I understand that the append lines add extra parameters to the make call. How does Yocto know which platform to use? I mean how does it choose xione-uk or llama-us for instance?

Plus is there a variable that captures the target name, i.e. "xione-uk", "xione-us", etc?
 


Quentin Schulz
 

Hi Iggy,

On 12/1/22 13:55, Iggy via lists.yoctoproject.org wrote:
Hi,
I have a .inc file that contains this information:
# Set the MACHINE string, expected to eventually replace the long list of
# build settings below
EXTRA_OECMAKE += "-DRDK_MACHINE=${@d.getVar('MACHINE', False)} "
# Set the region and platform type (defaults to Xi6 and UK)
EXTRA_OECMAKE_append_xione-uk = " -DRDK_PLATFORM=XI1 -DREGION=UK "
EXTRA_OECMAKE_append_xione-us = " -DRDK_PLATFORM=XI1 -DREGION=UK "
EXTRA_OECMAKE_append_llama-uk = " -DRDK_PLATFORM=LLAMA -DREGION=UK "
EXTRA_OECMAKE_append_llama-us = " -DRDK_PLATFORM=LLAMA -DREGION=UK "
I understand that the append lines add extra parameters to the make call. How does Yocto know which platform to use? I mean how does it choose xione-uk or llama-us for instance?
You are building for a specific machine (MACHINE in your local.conf or via command line argument for example), so Yocto definitely knows it.

Then your machine configuration file (the one in the form of <machinename>.conf contains multiple MACHINEOVERRIDES in .inc files which define "families" under which your machine could be matched.

Since MACHINEOVERRIDES is part of OVERRIDES variable which is used to filter some variables "overrides", it'll just work (e.g. EXTRA_OECMAKE_append_<machinename>).

Hope this helps,
Cheers,
Quentin