Yocto Build : Useful Commands

Reading time ~2 minutes

This month, I was working on Yocto build system to create my own custom linux distribution. Online we can find many tutorials to build an image. but the tutorial on how to create/build/debug custom layer is hard to find. This is sort of help cheatsheet to look uptu for commands.

Clean and Build new Yocto Meta layer :-

bitbake tool_name -c do_compile

You can use a devshell to efficiently debug commands or simply edit packages.

python3 /home/ubuntu/temp/yocto_build/bitbake/bin/bitbake tool_name -c devshell

Root FS is present here :-

./build/tmp/work/intel_corei7_64-poky-linux/core-image-sato/1.0-r0/rootfs ./build/tmp/work/intel_corei7_64-poky-linux/core-image-sato/1.0-r0/rootfs

[Very imp] For any recipe, you can find the values of any variable by getting an environment file as:-

bitbake -e netperf > env

In the env file, you can search value of WORKDIR as:

grep -rin “workdir=” env

Find the file/modules:-

find . -name “tool_name

If the Size is less in df -h :-

rm -rf /tmp

bitbake core-image-sato

Note: The output is at


Location of the kernel source:-


This is the Staging Area:-


Do this from the Staging Area.

make mrproper

make clean

Add this in local.conf to put the binaries in the rootfs

IMAGE_INSTALL_append = “ tool_name”

Create the new iso,HDD image for your distro including your layers:-

bitbake -c cleanall tool_name

bitbake core-image-sato -c cleanall

bitbake core-image-sato

Day trek to China Peak

Published on October 13, 2018

Benchmarking Databases Using Sysbench

Published on October 05, 2018