A summary of all things one might need to work with Yocto Project. One stop repository for Yocto since there are so many variables and CLIs to work with.
Please feel free to add / adapt the list accordingly via PRs. As OE/Yocto Project still has a steep learning-curve, a better way would be to share resources with the community.
All hints for CLIs like bitbake
, bitbake-layers
, devtool
etc. used within common Yocto Project development
Purpose | Command(s) |
---|---|
Populate Classic SDK | bitbake -c populate_sdk <IMAGE_NAME> |
Populate Extensible SDK | bitbake -c populate_sdk_ext <IMAGE_NAME> |
Start build from scratch | cd $BUILD_DIR && rm -Rf tmp sstate-cache |
Supported HW Boards | ls sources/meta-<hardware>*/recipes*/conf/machine/*.conf |
Supported Images | ls sources/meta-<hardware>*/recipes*/images/*.bb |
Single PR Server instance | bitbake-prserv --host <server_ip> --port <port> --start |
Find a package in a layer | cd sources && find --name "*busybox*" |
Find a recipe in a layer | cd sources && find --name "*busybox*.bb*" |
Search recipe | bitbake-layers show-recipes "gdb*" |
Find dependency cache | devtool search <RegEx> |
Dump global env & find | bitbake -e | grep -w DISTRO_FEATURES |
Locate source directory | bitbake -e <recipe> | grep ^S= |
Locate working directory | bitbake -e <recipe> | grep ^WORKDIR= |
devshell |
bitbake -c devshell <target> |
devpyshell |
bitbake -c devpyshell <target> |
List tasks for a recipe | bitbake -c listtasks <target> |
Force a build | bitbake -f <target> |
Force-run a specific task | bitbake -c compile -f <target> |
Current/given pkg version | bitbake --show-versions |
Verbose output | bitbake -v <target> |
Display debug information | bitbake -DDD <target> |
Send error report | send-error-report ${LOG_DIR}/error-report/error-report_${TSTAMP} |
Create a new layer | yocto-layer create <layer_name> |
Add custom layer | bitbake-layers add-layer /path/to/your_meta-layer |
Remove custom layer | bitbake-layers remove-layer /path/to/your_meta-layer |
Find all recipe layers | bitbake-layers show-recipes |
Find all clashing recipe | bitbake-layers show-overlayed |
Show all bbappend files |
bitbake-layers show-appends |
Flatten all Layers | bitbake-layers flatten <output_dir> |
Show recipe cross-depends | bitbake-layers show-cross-depends |
List layer dependencies from OE Index | bitbake-layers layerindex-show-depends <layer_name> |
Fetch & add layer using OE Index | bitbake-layers layerindex-fetch <layer name> |
All variables that can be added to files like bblayers.conf
or local.conf
or other configuration files in Yocto.
Purpose | File | Variable(s) |
---|---|---|
Add systemd |
local.conf |
DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" |
Remove sysvinit |
local.conf |
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" VIRTUAL-RUNTIME_initscripts = "" |
Add strace |
local.conf |
CORE_IMAGE_EXTRA_INSTALL += "strace" |
root Login w/o Password |
local.conf |
EXTRA_IMAGE_FEATURES ?= "debug-tweaks" |
Add gcc |
local.conf |
EXTRA_IMAGE_FEATURES ?= "tools-sdk" |
Add dropbear-ssh-server |
local.conf |
EXTRA_IMAGE_FEATURES ?= "ssh-server-dropbear" |
Add virtualization |
local.conf |
DISTRO_FEATURES_append = " virtualization" |
Persistent Bitbake server | local.conf |
BB_SERVER_TIMEOUT= "n" # n in seconds |
Remove build packages | local.conf |
INHERIT += "rm_work" |
Exclude packages from cleaning | local.conf |
RM_WORK_EXCLUDE += "recipe_name" |
Avoid -dbg packages |
local.conf |
INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
Accept FSL's EULA license | local.conf |
ACCEPT_FSL_EULA = "1" |
Download Directory | local.conf |
DL_DIR ?= "${BSP_DIR}/downloads/" |
Configuring a Pre-mirror | local.conf |
INHERIT += "own-mirrors" SOURCE_MIRROR_URL = "http://example.com/source-mirror" |
tarballs of git repos. | local.conf |
BB_GENERATE_MIRROR_TARBALLS = "1" |
Build using Pre-mirrors only | local.conf |
BB_FETCH_PREMIRRORONLY = "1" |
Add Package Mgmt. System | local.conf |
EXTRA_IMAGE_FEATURES += "package-management" |
Simple PR server |
local.conf |
PRSERV_HOST = "<server_ip>:<port>" |
Enable build history | local.conf |
INHERIT += "buildhistory" |
Store build history in repo. | local.conf |
BUILDHISTORY_COMMIT = "1" |
Track image, pkg, SDKs change | local.conf |
BUILDHISTORY_FEATURES = "image" # package or sdk |
Track a file for buildhistory | local.conf |
BUILDHISTORY_IMAGE_FILES += "/path/to/file" |
Terminal for dev(py)shell |
local.conf |
OE_TERMINAL = "screen" |
Submit Failed build error | local.conf |
INHERIT += "report-error" |
Number of parallel tasks | local.conf |
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}" |
Value of -j in make |
local.conf |
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}" |
Add Real-Time Kernel | local.conf |
PREFERRED_PROVIDER_virtual/kernel = "<RT_Kernel_Image_name_from_Meta-Layer>" |
All miscellaneous resources once can find for understanding the Yocto Project and working with it.
- Blogs by Johan Thelin (@e8johan)
- Blog by Khem Raj (@kraj)