- Embedded Linux Development Using Yocto Project Cookbook(Second Edition)
- Alex González
- 227字
- 2021-06-30 19:21:26
Using the development shell
BitBake offers the devshell and devpyshell tasks to help developers. They are executed with the following commands:
$ bitbake -c devshell <target>
And:
$ bitbake -c devpyshell <target>
They will unpack and patch the source, and open a new Terminal (they will autodetect your Terminal type or it can be set with OE_TERMINAL) in the target source directory, which has the environment correctly set up. They run with the nostamp flag so up-to-date tasks will be rerun.
The devpyshell command will additionally set up the Python environment including Python objects and code such as the datastore d object.
OE_TERMINAL = "screen"
Inside the devshell, you can run development commands such as configure and make or invoke the cross-compiler directly (use the $CC environment variable, which has been set up already). You can also run BitBake tasks inside devshell by calling the ${WORKDIR}/temp/run* script directly. This has the same result as invoking BitBake externally to devshell for that task.
Inside the devpyshell Python interpreter, you can call functions, such as d.setVar() and d.getVar(), or any Python code, such as bb.build.exec_fun().