RDK Yocto Build Systems
Introduction
Yocto build manifest file
The starting point for the Yocto build is a manifest file. The manifest file is an xml file that contains details of the different layers (including their repository URL, target location where they need to be downloaded and any specific version – like branch or tag – which need to be used ) that needs to be fetched during initial stages of the builds. The manifest file will be usually used to download the repositories with details of meta layers and build configurations. A set of sample manifests that can be used as a template for developing vendor specific manifests are given below ( along with sample manifest for OEM and third party)
File |
Remarks |
|
---|---|---|
1 |
This is the starting point of the build and is specific to a device/board . If the SoC/OEM has only one target device /board, still it is recommended to maintain a different manifest for SoC/OEM for keeping it future-proof. Usually it contains references to other manifest files which will be having specific set of repos |
|
2 |
This manifest contains meta layer details of OEM and , optionally, some OEM specific repos |
|
3 |
This manifest has details of the basic Yocto Open Embedded layers |
|
4 |
This manifest can contain meta layers specific to RDK & RDK-V and , for EXTERNALSRC cases, the RDK & RDK-V component repo details too. It might be supplemented with a conf file too |
Folder overview in Yocto for RDK-V:
This document focuses on the example of the RDK video devicesettings module.The devicesettings module provides functionality related to device settings management within the context of the Raspberry Pi platform and the RDK (Reference Design Kit) video meta-layer.
devicesettings comes under these layers: meta-cmf-raspberrypi, meta-cmf-video, meta-rdk-video.
Module Structure
devicesettings module is structured as:
meta-rdk-video
| └── recipes-extended
| └── devicesettings
| ├── devicesettings_git.bb
| └── devicesettings-hal-headers_git.bb
|
meta-cmf-raspberrypi
└── meta-rdk-video
└── recipes-extended
└── devicesettings
├── devicesettings_git.bbappend
└── devicesettings-hal-raspberrypi_git.bb
The devicesettings recipe, represented by “devicesettings_git.bb”, is responsible for building the devicesettings package from the corresponding source code. It defines the necessary build steps, dependencies, and configurations to create the devicesettings package, and in “devicesettings-hal-headers_git.bb”, hal-specific definitions are available.
Also for devicesettings, certain overrides exist in other meta layers, which can be device specific, here we are focusing on raspberrypi device, there are dedicated recipe specific to the ‘raspberrypi’ hardware abstraction layer (HAL) and append file.
Recipe Parameters
Below are some of the important parameters present in the recipes:
Parameters | Description |
---|---|
SRC_URI | URI of source code, patches and extra files to be used to build packages. Uses different fetchers based on the URI. |
DEPENDS/RDEPENDS_${PN} | Build time and run time package dependencies, where ${PN} represents the package name defined in the recipe. |
CFLAGS/CXXFLAGS/LDFLAGS | environment variables commonly used in software development to specify compilation and linking options for C and C++ programs |
do_install(), do_configure_prepend(), do_compile() | These are integral parts of the build process, they enable developers to customize the configuration, compilation, and installation steps of software packages, providing flexibility and control over the build process. |
Parameters in append file-
The *. bbappend file provided above is specifying additional CFLAGS (compiler flags) for the build process.
The line CFLAGS += " -DHAS_HDCP_CALLBACK -DHAS_FLASH_PERSISTENT"
adds two specific compiler flags to the existing CFLAGS.
-
-DHAS_HDCP_CALLBACK
: This flag defines the macroHAS_HDCP_CALLBACK
, which indicates that the build should include support for HDCP (High-bandwidth Digital Content Protection) callback functionality. -
-DHAS_FLASH_PERSISTENT
: This flag defines the macroHAS_FLASH_PERSISTENT
, indicating that the build should include support for persistent storage on Flash memory.
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 devicesettings module, execute the following command with Bitbake:”bitbake lib32-devicesettings“
We can add the Install task bitbake command, which can be helpful if modifications have been made to the devicesettings source code and there is a need to copy the resulting binaries and libraries from the devicesettings build directory to the target system. The following command can be used:
Install bitbake -c install -f devicesettings
If someone needs to execute a task-wise module, the following commands can be used:
Action | Bitbake command |
---|---|
configure | bitbake -c configure -f lib32-devicesettings |
compilation | bitbake -c compile -f lib32-devicesettings |
cleanall | bitbake -c cleanall lib32-devicesettings |
cleansstate | bitbake -c cleansstate lib32-devicesettings |
If we want to list down rdkv specific components- Execute bitbake -s it will list down all the components.
RDK Package Groups
During the image creation phase of the build process, package groups are added to organize and include related packages in the final image.
devicesettings module is included in:
meta-rdk/recipes-core/packagegroup/packagegroup-rdk-media-common.bb
- packagegroup-rdk-media-common – contains common RDK (non-OSS) components for mediaclient, mediaserver build types. These components are essential for building media-related functionalities in RDK-based systems.
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, RDK, 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 name | Description |
---|---|
rdk-generic-hybrid-image | A generic RDK build for hybrid devices with QAM-based tuners, enabling streaming and broadcasting of QAM content. |
rdk-oss-image | An RDK image based on open-source software components, providing flexibility and customization options. |
rdk-generic-mediaclient-image | A generic RDK build for media client devices capable of streaming IP-based or QAM content from hybrid devices. |
rdk-generic-ipclient-image | A generic RDK build for IP client devices, suitable for scenarios where an RDK license is not mandatory. |
Yocto build Image target names are of format- <RDK vendor>-<profile>-<build-type>-<developer>-image
Example-
rdk-generic-mediaclient-wpe-image_FBT_6.0.0-rc4_20231108131757.rootfs.wic
rdk-generic-mediaclient-wpe-image_FBT_6.0.0-rc4_20231108131757.rootfs.wic.bz2
rdk-generic-mediaclient-wpe-image_FBT_6.0.0-rc4_20231108131757.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-android-ipmc/tmp/work/raspberrypi4_64_rdk_android_ipmc-rdk-linux/devicesettings/5+gitr999-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.
ERROR: lib32-devicesettings-5+gitr999-r0 do_compile: oe_runmake failed ERROR: Logfile of failure stored in: ~/rpi_build/raspberrypi4-64-rdk-hybrid/tmp/work/armv7at2hf-neon-vfpv4-rdkmllib32-linux-gnueabi/lib32-devicesettings/5+gitr999-r0/temp/log.do_compile.4085187
The provided example demonstrates a compilation error in the “devicesettings” 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.