Skip to contentSkip to conversation

DTC_FLAGS with devshell

DISCUSSION Drew Moseley 2 participants 3 messages Feb 25, 2021

lore
Share & tools
lore
#0 lore raw

Hello,

I'm having difficulty using "bitbake -c devshell virtual/kernel" to build dtb files properly. In our case, we set "DTC_FLAGS=-@" in recipe metadata to ensure device tree overlay support is available. It all works fine when run as a standard build.  In the devshell, that variable is not respected by default. I do see that there is an EXTRA_OEMAKE environment variable with HOSTCC, HOSTCPP and DTC_FLAGS set but when I try to invoke "make ${EXTRA_OEMAKE} dtbs" it gets a weird argument parsing error presumably due to shell globbing, quotation mark processing etc:

    # make ${EXTRA_OEMAKE} dtbs
    make: invalid option -- 'y'
    make: invalid option -- '/'
    make: invalid option -- '/'
    make: invalid option -- '/'
    make: invalid option -- 'E'
    make: invalid option -- '"'
    Usage: make [options] [target] ...

If I manually copy/paste the value of EXTRA_OEMAKE onto my make invocation it works. If I just add the DTC_FLAGS it also works (ie "make DTC_FLAGS=-@ dtbs").

Is there a better mechanism for handling this?

Drew

#1 lore raw

Hi Drew,

Quoted 21 lines · Drew Moseley

Hello,

I'm having difficulty using "bitbake -c devshell virtual/kernel" to build dtb files properly. In our case, we set "DTC_FLAGS=-@" in recipe metadata to ensure device tree overlay support is available. It all works fine when run as a standard build.  In the devshell, that variable is not respected by default. I do see that there is an EXTRA_OEMAKE environment variable with HOSTCC, HOSTCPP and DTC_FLAGS set but when I try to invoke "make ${EXTRA_OEMAKE} dtbs" it gets a weird argument parsing error presumably due to shell globbing, quotation mark processing etc:

    # make ${EXTRA_OEMAKE} dtbs
    make: invalid option -- 'y'
    make: invalid option -- '/'
    make: invalid option -- '/'
    make: invalid option -- '/'
    make: invalid option -- 'E'
    make: invalid option -- '"'
    Usage: make [options] [target] ...
Quoted 6 lines

If I manually copy/paste the value of EXTRA_OEMAKE onto my make invocation it works. If I just add the DTC_FLAGS it also works (ie "make DTC_FLAGS=-@ dtbs").

Is there a better mechanism for handling this?

There's a recent patch for this:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/classes/kernel-devicetree.bbclass?id=ff036cbb77124867a6c6f97ca206b4fd3ee00c70

Reading the commit log, it seems you could use KERNEL_EXTRA_ARGS right now.

Cheers,
Quentin

Signature · 4 lines
StreamUnlimited Engineering GmbH
High Tech Campus Vienna, Gutheil-Schoder-Gasse 10, 1100 Vienna, Austria
Fax: +43 1 667 20 02 4401
[email protected], www.streamunlimited.com