The most notorious *non*-official Yocto Project resource ever!
When: Thursday July 23th, 2020 - 5:00 PM Europe/Berlin
Topic: Looking at variables in recipes and the various forms of operations and assignments that can be used on them. Includes some notes on bbappends and bbclasses, as well as evaluation order.
bitbake -e example | awk '/^# \$FOOBAR \[/,/^FOOBAR/'
Will give you the evaluation history of the variable FOOBAR
in the context of the example
recipe.
if you need to be able to remove for some reason, you can provide an intermediate variable. FOOBAR_REMOVE ?= “foo”; FOOBAR_remove = “${FOOBAR_REMOVE}”; for example. if you’re making a bbappend o remove something, this is a best practice so that additional bbappends after that one can undo the removal. but yes, best to reduce usage entirely
Magic to do the filtering! (Note, I haven’t tried it :P)
bbfilt() { VAR=$1 awk -v start="# \\\\\$$VAR \\\[" -v stop="^$VAR" 'BEGIN{p=0}; $0 ~ start{p=1}; $0 ~ stop{p=0}; /^./{ if(p) print $0; }'; }
Usage:
bitbake -e example | bbfilt FOOBAR
meta-lithium: the layer created during the session
Bitbake User Manual: the manual for bitbake which elaborates on the operation.