November 2017
Intermediate to advanced
162 pages
4h 8m
English
Metadata recipes (.bb) and class files (.bbclass) can use Shell Script code as follows:
do_mytask () { echo "Hello, world!"}
This is essentially identical to setting a variable, except that this variable happens to be an executable shell code. It is important to be careful when writing shell script code as we should not use shell-specific code such as bash or zsh. When in doubt, a good way to test if our code is safe is to use the dash shell to test it.
Another way to inject code is by using Python code, as shown:
python do_printdate () { import time print time.strftime('%Y%m%d', time.gmtime())}
This is similar to the previous code but flags it as Python so that BitBake knows it is Python code and runs it accordingly. ...
Read now
Unlock full access