Yocto Build Systems

Created on April 15, 2024


The primary function of the Yocto Project within RDK development is the building and packaging of multiple components. RDK leverages the capabilities of the Yocto Project to create customized Linux-based software distributions that power the devices like set-top boxes, smart TVs, cable modems, routers etc. To fully understand the concepts presented in this document, it is recommended to read RDK Yocto Build System Overview – DOCUMENTATION – RDK Central Wiki as an introduction to the concepts explored in this document.


Introduction

Folder overview in Yocto for RDK-B:

  1. meta-virtualization/recipes-networking: This folder consists of recipes related to networking components in RDK-B. It includes recipes for network protocols, connectivity options, and network management utilities.

  2. meta-virtualization/recipes-graphics: This folder contains recipes for graphics-related components in RDK-B. It includes recipes for graphical user interfaces (GUIs), graphics libraries, and rendering engines.

  3. meta-virtualization/recipes-containers: This folder includes recipes that provide containerization support in RDK-B. They allow you to build and include container images as part of your embedded system.

  4. meta-virtualization/recipes-core: Core recipes and configurations specific to RDK-B.

  5. meta-virtualization/recipes-extended: This folder includes additional recipes that extend the functionality of RDK-B. It covers recipes for various extended components, tools, and services.

  6. meta-virtualization/recipes-devtools: This folder contains recipes that provide development tools and utilities in RDK-B. These tools assist in the development and debugging processes, making it easier to build, test, and analyze the software.

  7. meta-virtualization/conf: conf files define various settings and variables that control the build process and customize the resulting embedded Linux system. It consists of distro and layer.conf file.

 other OE layers are-

  1. meta-gnomeThis layer provides recipes and configurations for the GNOME desktop environment. It includes packages and components related to the GNOME project, such as the GNOME Shell, GNOME applications, and various GNOME libraries.

  2. meta-filesystemsThis layer focuses on filesystem-related recipes and configurations. It includes packages for various filesystem types, utilities for managing and formatting filesystems, and other related tools.

  3. meta-initramfsThis layer is dedicated to initramfs (initial RAM filesystem) support. It provides recipes for creating and managing initramfs images, which are used during the boot process to load essential components and prepare the system for further booting.

  4. meta-multimediaThis layer is focused on multimedia-related recipes and configurations. It includes packages for multimedia frameworks, codecs, players, and related tools. It enables multimedia capabilities in the embedded system.

  5. meta-networking: This layer provides recipes and configurations for networking-related components. It includes packages for network protocols, utilities for network configuration, network services, and related tools.

  6. meta-oe: This is a fundamental layer that provides a collection of additional recipes and components from the wider OpenEmbedded community. It includes a wide range of packages and configurations contributed by the community, covering various domains such as development tools, libraries, utilities, and applications.

  7. meta-perlThis layer focuses on Perl language support. It includes recipes for Perl modules, extensions, and related tools. It enables Perl development and runtime support in the embedded system.

  8. meta-pythonThis layer provides recipes and configurations for Python language support. It includes packages for Python modules, libraries, and tools. It enables Python development and runtime support in the embedded system.

  9. meta-webserverThis layer focuses on web server-related recipes and configurations. It includes packages for popular web servers such as Apache, Nginx, or lighttpd, as well as related tools and configurations for web application development and deployment.

  10. meta-xfceThis layer provides recipes and configurations for the Xfce desktop environment. It includes packages and components related to the Xfce project, such as the Xfce desktop environment, applications, and various Xfce libraries.

For more details on how to add new component to yocto build system refer: Integration Guide for third-party applications into RDK-B stack – RDK – RDK Central Wiki

This document focuses on the example of the RDKB openvswitch module. Openvswitch is utilized for software-defined networking and virtual switching functionalities. It plays a crucial role in enabling network virtualization and providing advanced networking capabilities within the RDKB platform.

openvswitch comes under these layers: meta-cmf-broadband, meta-cmf-raspberrypi, meta-rdk-broadband, meta-virtualization 

Module Structure

openvswitch module is structured as:

meta-virtualization
|       └── recipes-networking
|          └── openvswitch   
|             ├── openvswitch_git.bb
|             └── openvswitch.inc
meta-cmf-raspberrypi
       └── recipes-networking
          └── openvswitch
              └── openvswitch_git.bbappend

     
The main recipe for building the openvswitch package is represented by openvswitch_git.bb. This recipe contains the necessary instructions, dependencies, and configurations to compile and construct the Open vSwitch package from the corresponding source code within the RDKB environment.

Additionally, there is an “openvswitch.inc” file, which is an include file that provides common build settings and variables used in the openvswitch module. It helps streamline the build process and ensures consistency across different recipes and components related to openvswitch.

For openvswitch, certain overrides exist in other meta layers, which can be device specific, here we are focusing on raspberrypi device, there are dedicated append files specific to the ‘raspberrypi’.

 Recipe Parameters

Below are some of the important parameters present in the recipes:

ParametersDescription
SRC_URI/SRCREVURI of source code, patches and extra files to be used to build packages. Uses different fetchers based on the URI/ specify the revision or commit ID of the source code or repository to be used for building a software package.
DEPENDS/RDEPENDSBuild time and run time package dependencies, where ${PN} represents the package name defined in the recipe.
PACKAGECONFIGused to enable or disable specific features or configurations during the build process.
EXTRA_OEMAKEIt is used to add extra options or arguments to the build command (typically make) during the build process. 
do_install()Responsible for installing the built software into the target filesystem. It is automatically called during the build process after the compilation stage.

Parameters in append file-

This .bbappend file modifies the original openvswitch recipe by removing and adding dependencies, enabling SSL support, disabling the autostart of a particular service, and configuring the package to exclude SSL support. These modifications tailor the build and behavior of the openvswitch package to the specific requirements.
Parameters present in the .bbappend file are mentioned below:

ParametersDescription
DEPENDS_remove/DEPENDS_append_classtargetare used in recipe files (e.g., .bb or .bbappend files) to modify the dependency information, either to remove or to add additional dependencies to the existing list of dependencies for a specific class-target combination.
EXTRA_OECONFallows you to add extra command-line arguments or configuration options to the configuration command that is executed during the build of a recipe.
SYSTEMD_SERVICESYSTEMD_SERVICE refers to a service unit configuration file that is used by systemd to define and manage a specific system service.

In this example, we are referring to the above mentioned append file. Similarly, if we need to include any additional modifications to the recipe, we can do so by adding them in the append file within the SOC and OEM layers.


Building the Module

To build the openvswitch module, execute the following command with Bitbake:”bitbake openvswitch

We can add the Install task bitbake command, which can be helpful if modifications have been made to the openvswitch source code and there is a need to copy the resulting binaries and libraries from the openvswitch build directory to the target system. The following command can be used:

Install  bitbake -c install -f openvswitch

If someone needs to execute a task-wise module, the following commands can be used:

ActionsBitbake command
Configurebitbake -c configure -f lib32-openvswitch
Compilationbitbake -c compile -f lib32-openvswitch
cleanallbitbake -c cleanall lib32-openvswitch
cleansstatebitbake -c cleansstate lib32-openvswitch

Yocto Build Images

  • All the components are built using individual recipes. There shall be a main image recipe (example , rdk-generic-image) which includes all other required recipe and create the final RFS
  • Package groups recipe is one support a image recipe to select the set of packages
  • The recipes will be called in sequence- opensource components, Kernel, SDK, RDKB, MSO, Packaging and create final image.
  • The final linux and RFS  image will be created under build_folder/tmp/deploy/images

Target image name:-

Image nameDescription
rdk-oss-imageAn RDK image based on open-source software components, providing flexibility and customization options.
 rdk-generic-broadband-imageA generic RDK build for broadband gateways, providing standardized software components and configurations for internet connectivity.

Yocto build Image target names are of format- <RDK vendor>-<profile>-<build-type>-<developer>-image
Example-
rdkb-generic-broadband-image_rdkb-2023q4-dunfell_20240102103224.rootfs.wic
rdkb-generic-broadband-image_rdkb-2023q4-dunfell_20240102103224
.rootfs.wic.bz2
rdkb-generic-broadband-image_rdkb-2023q4-dunfell_20240102103224.rootfs.tar.gz

Debugging

When facing errors or failures while executing a bitbake action, such as compilation or configuration errors, the specific log files can be found in the following directory structure:
Path: build-raspberrypi4-64-rdk-broadband/tmp/work/raspberrypi4_64_rdk_broadband-rdk-linux/openvswitch/2.13+AUTOINC+71d553b995-r0/temp/
Example

  • log.do_compile: This file contains the error logs related to the compilation process. It provides information about any issues encountered during the translation of source code into executable or object files.

  • log.do_configure: This file contains the error logs associated with the configuration step. It helps identify any problems encountered while setting up the build configuration, such as missing dependencies or incorrect settings.

Example
ERROR: openvswitch-1.0-r0 do_compile: oe_runmake failed
ERROR: Logfile of failure stored in: ~/rpi3/build-raspberrypi-rdk-broadband/tmp/work/raspberrypi_rdk_broadband-rdk-linux-gnueabi/openvswitch/1.0-r0/temp/log.do_compile.1540323

The provided example demonstrates a compilation error in the “openvswitch” package. The details of the error can be found in the specified log file, which can be analyzed by searching for the keyword “error”.

The path provided in the example is specific to the mentioned build environment. In your actual working environment, the paths may differ depending on the build system or project structure you are using.


Go To Top