Yocto Project

Yocto Project


Introduction :-

The Yocto Project is a set of templates, tools and methods that allow to build custom embedded Linux-based systems. It creates our own custom linux distributions. Yocto is an Open source project Initiated by Linux Foundation in 2010. It is Managed by Richard Purdie. Nowadays most of the product companies are widely using Yocto build systems to create custom linux builds.

Core Components :- The Core components of the Yocto project are:
  • Poky :- Poky is the reference system. It is a collection of tools, used for bootstrap a new distribution on the yocto project.
  • Open Embedded Core :- It is a Set of base layers, set of recipes, layers, configs and classes Which can share between all Open Embedded based Systems.
  • Bitbake :- Bitbake is a build Engine and Task Schedulers. It Extracts the python and shell scripts. It interprets configuration files and recipes to perform set of tasks, to download, configure and build specified applications and filesystems images.
Organization of Open Embedded core :-
  • Recipes describe how to fetch, configure, compile and package applications and images. It has a specific syntax.
  • Layers are set of recipes, matching a common purpose. For example meta-ti, meta-intel, etc. these are meta bsp layers for yocto.
  • Multiple layers are used with in a same distribution, depending on the requirements. It supports different Architectures like ARM, MIPS, POWERPC, RISC-V, X86 etc. It can support QEMU Emulator for all above ARCH’s.
  • Official yocto project link https://git.yoctoproject.org/
  • For every 6 months new version of poky will release by Yocto team.
  • It can Support different packages like rpm, deb, ipkg, etc.


Once we download the poky, we can able to below files
  • Bitbake :- It holds all the scripts used by Bitbake command.
  • Documentation :- It contains All documentation for the Yocto project Documentation. Can be used to generate nice PDF’s.
  • Meta :- It contains the Open Embedded Core Metadata.
  • Meta-skelton :- It contains temples recipes for BSP and Kernel Development.
  • Meta-poky :- It contains the Configuration for the Poky reference distribution.
  • Meta-yocto-bsp :- Configuration for the yocto project reference hardware board support package
  • LICENSE :- The License under which poky is distributed(A mix of GPLv2 andMIT)
  • Oe-build-init-env :- Script to set up the Open Embedded build Environment. It will create a build directory.
  • Scripts :- It contains scripts used to set up the environment, development tools, and tools to flash the generated images on the target.
Environment Set-up :-

A script , Oe-build-init-env is provided to set up the build directory and Environment variables. Command to set up build environment

Common Targets :-
  • Core-image-minimal :- A small image to boot a device and have access to core command line commands and services
  • Core-image-sato :- Image with sato support. Sato is GNOME mobile based user interface.
  • Meta-toolchain :- Generates the Cross-Toolchain in an installable formats.
  • Meta-ide-support :- Generates the Cross-toolchain and additional tools(GDB, QEMU,) For IDE integration.
BUILD STEPS :-
  • Download the poky reference $ git clone -b kirkstone Download the poky reference $ git clone -b kirkstone
  • Once Download the poky source. Run environment setup using below command $ source oe-build-init-env
  • Above command creates build directory and it contains conf directory which contains bblayer.conf and local.conf files.
  • Bblayer.conf has list the layers to use.
  • The compilation is handled by the Bitbake build engine. To build a Target : $ bitbake core-image-minimal or bitbake [options] [recipename/target]
Once the build is success, below directories present in the build directory.
  • Conf :- Configuration files, Image Specific and Layer configuration.
  • Downloads :- Downloaded Upstream tarballs of the recipes used in he build.
  • Sstate-cache :- Shared state cache used by all builds.
  • Tmp :- Holds the build system outputs.
  • Tmp/work :- Set of work directories, split by Architecture. They are used to unpack, patch, configure and build the packages. Contains the patched sources, generated objects and logs.
  • Tmp/sysroots :- Shared libraries and headers used to compile applications for the target but also for the host.
  • Tmp/buildstates :- build statistics for all packages built.( CPU usage, elapsed time, host, timestamps)
RECIPE BUILD STEPS :-
  • Do_fetch :- It fetches the source code from local or remote. For example git, http, wget etc. SRC_URI = http://example.com/src.tar.bz2;name=tarball \ http://example.com/fixes.patch;name=patch
  • Do_unpack :- It Extracts the source.
  • Do_Configure :- Configure to the target config.
  • Do_compile :- It compiles the source code.
  • Do_install :- Install the binaries into target rootfs.


  • Conclusion:

    Yocto is not an Embedded Linux Distribution –It creates a custom one for you. Yocto project lets you customize your Embedded linux OS. It can Support for both App and device development models. Easy to create an Images for Embedded devices.