0

I have two machine conf files, where I am adding the required conf file from meta layer. As follows: # mymachine32.conf require conf/machine/include/tune-cortexa7.inc

and

# mymachine64.conf require conf/machine/include/arm/arch-armv8.inc

The above works fine, but I am attempting to consolidate into a single conf file as follows:

Approach #1

# mymachine.conf DEFAULTTUNE ?= "${@base_contains('MYTUNE', 'arm', 'armv7a-neon', 'aarch64', d)}" require conf/machine/include/arm/arch-armv8.inc

With Approach #1 in my conf file, I see following error:

ExpansionError: Failure expanding variable DEFAULTTUNE, expression was ${@base_contains('MYTUNE', 'arm', 'armv7a-neon', 'aarch64', d)} which triggered exception NameError: name 'base_contains' is not defined

Approach #2

# mymachine.conf DEFAULTTUNE ?= "${@bb.utils.contains('MYTUNE', 'arm', 'armv7a-neon', 'aarch64', d)}" require conf/machine/include/arm/arch-armv8.inc

Whereas with Approach #2 I always get the 'falsevalue' (i.e., aarch64) set to DEFAULTTUNE

Please note that in both cases I am exporting the MYTUNE in my shell

export MYTUNE=arm

Can you please point out what I am doing wrong? Thanks in advance for the help.

sob
  • 982
  • 11
  • 31

1 Answers1

1

For approach #1, the code is parsed and executed before base.bbclass so base_contains is not available.

For approach #2, I suspect MYTUNE is not set when the expression is evaluated. I think this is because whilst you set it in the environment, you don't indicate to bitbake it should allow it into the datastore. Try adding:

export BB_ENV_EXTRAWHITE=MYTUNE

which should allow MYTUNE into the datastore. You can test this by greping the output of bitbake -e for MYTUNE to check if it gets set as expected.

Richard Purdie
  • 2,028
  • 10
  • 16
  • Thanks Richard. I tried export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE MYTUNE" and this seems to work for me. I will now attempt build for both the architectures with the same conf file. – sob May 29 '17 at 11:56