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

build/tmp/deploy/images/intel-corei7-64/


Location of the kernel source:-

/home/ubuntu/temp/yocto_build/build/tmp/work-shared/intel-corei7-64/kernel-source/

This is the Staging Area:-

/corei7-64-intel-common-poky-linux/linux-intel-rt/4.9.27+gitAUTOINC+8b40e0ad3a_20d97c347a-r0/linux-corei7-64-intel-common-preempt-rt-build/.

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