Posted onIn系统构建Views: Symbols count in article: 1.9kReading time ≈2 mins.
Notes about some useful Yocto debugging commands
Checking owner of installed files
Assuming that build environments is ready(which means you can run bitbake normally), using oe-pkgdata-util can help to find the recipe who populated it. i.e:
There are several .manifest files under the path of built images, which contained packages has been installed.
Checking variables inside recipes
bb.utils.contains can help to check variables inside recipes. i.e. we’d like to install some files base on MACHINE_FEATURES :
1 2 3 4 5 6 7 8 9 10 11
do_install() { if ${@bb.utils.contains('MACHINE_FEATURES','ethernet','true','false',d)}; then install -d ${D}${systemd_unitdir}/network/ install -m 0644 ${WORKDIR}/10-eth.network ${D}${systemd_unitdir}/network/ fi
if ${@bb.utils.contains('MACHINE_FEATURES','wifi','true','false',d)}; then install -d ${D}${systemd_unitdir}/network/ install -m 0644 ${WORKDIR}/51-wlan.network ${D}${systemd_unitdir}/network/ fi }
Below is the python code from openembedded, which explains usage of this function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
defcontains(variable, checkvalues, truevalue, falsevalue, d): """Check if a variable contains all the values specified. Arguments: variable -- the variable name. This will be fetched and expanded (using d.getVar(variable)) and then split into a set(). checkvalues -- if this is a string it is split on whitespace into a set(), otherwise coerced directly into a set(). truevalue -- the value to return if checkvalues is a subset of variable. falsevalue -- the value to return if variable is empty or if checkvalues is not a subset of variable. d -- the data store. """