Bitabke is a build-engine in Yocto Project which helps to build the custom image for your target boards
We can perform various things using the bitbake commands so in this tutorial, I am providing the useful bitbake commands which help during the Yocto build.
Build recipe or image
To build any particular recipe or image, need to run the below command.
$ bitbake recipe $ bitbake image_recipe
# To build gdb package $ bitbake gdb # To build basic bootable image core-minimal-image $ bitbake core-minimal-image
Bitbake Recipe compilation command
If you want to only compile the bitbake recipe then run the below command.
$ bitbake -c compile recipe
# To only compile gdb package $ bitbake -c compile gdb
Bitbake clean command
Suppose if you want to clean the build output of a particular recipe then you need to run the below command.
# It removes only build output files $ bitbake -c clean recipe
# It removes all the file related to the recipe like sstate cahche and build output files.
# Next time if you rebuild the recipe then it will build from scratch. $ bitbake -c cleanall recipe
Bitbake environment and global variable
These variables help to debug the bitbake recipe
# To get output of the recipe environment variable $ bitbake -e recipe
# Read the global variable using the below command $ bitbake -e | grep ^DISTRO_FEATURES
# Read the variable of the recipe by using the below command # Reading source location "S" variable of a recipe $ bitbake -e recipe | grep ^S
Package Dependencies List
Yocto provides the oe-depends-dot utility which helps to find out the package dependencies using the recipe-depends.dot file.
# Generate recipe-depends.dot file using below command $ bitbake -g image_name
Example: # Generate recipe-depends.dot file for core-minimal-image $ bitbake -g core-minimal-image
# List out the dependencies of a recipe $ oe-depends-dot -d -k recipe recipe-depends.dot
# List out the packages which have a dependency on this recipe $ oe-depends-dot -w -k recipe recipe-depends.dot