The SDK is under active development and is subject to changes as development continues.
An SDK to allow developers to easily build their applications and package them as OCI images suitable for use with DAC
- Repository: https://github.com/stagingrdkm/meta-dac-sdk/
- Same application source code: https://github.com/stagingrdkm/dac-examples-src
To develop DAC applications, an SDK has been developed that allows developers to write Bitbake recipes that compile their code and produce an OCI image. This OCI image can then be uploaded to an OCI registry where it can be converted and downloaded to a STB ready to be run by Dobby.
The SDK is based on Yocto 3.1 Dunfell and does not require any RDK specific layers - instead it uses the standard Poky distribution and can run on a developer's workstation, independent of any other build systems. This decreases the amount of time it takes for a developer to build and test their application.
The resulting applications can be run on a Yocto 2.2-based STB - it does not require Yocto 3.1 on the STB.
The following instructions will describe how to use the SDK to create an OCI image for the wayland-egl-test app which is provided with the SDK as an example
1. Set up a suitable build environment for compiling Yocto 3.1 Dunfell (Ubuntu 18.04)
2. Follow the instructions in the README.md file to clone the Pocky distribution and add the appropriate bitbake layers
3. Build the wayland-egl-test image
4. Once complete, the wayland-egl-test application with its dependencies inside will be packaged as an OCI image, the following OCI image file will be created in the following directory:
Note that above file is symlink to dac-image-wayland-egl-test-raspberrypi3-20201107165225.rootfs-oci-latest-arm-linux.oci-image.tar in same dir
The wayland-egl-test application has now been packaged as an OCI image. To run this app on a STB/CPE, it must be converted to an OCI bundle using BundleGen (BundleGen).
There are two ways to work with the OCI image in BundleGen:
- Upload the image to an OCI registry such as the Docker Hub. This can be done with Docker's load command (https://docs.docker.com/engine/reference/commandline/load/) or https://github.com/containers/skopeo.
- Extract the tar locally and point BundleGen to this directory.
If using the local directory method, run the following BundleGen command. Note the difference in syntax for the image URL when compared to pulling from the docker hub
To quickly test the generated bundle there is a useful test script under ./test. The below example shows how to test the bundle on RPI3 running the reference image, "next" version. You can find the build script and a pre-built image for that here: RDK reference image#RPIbuildscript
Also, you can combine both above steps with the other test script called "build_and_test_on_rpi.sh". In this case you don't pass the generated bundle as argument but the OCI dac tarball you want to test. The bundle is first generated and then installed to the RPI3. For example:
Yocto meta-dac-sdk layer introduce new types of OCI Images:
- dac-image-base - for DAC application that run as system service without graphics output or user input
- dac-image-wayland - for DAC application that are using OpenGL ES for 3D graphics and Wayland protocol to communicate with display server
- dac-image-qt - for DAC application that are using QT5 framework
dac-image-essos - for DAC application that are using Firebolt ® Essos framework
Provided OCI Images are used as a base classes for specialized DAC Application OCI Images.
To create new OCI Image with application, developer had to define:
- Application BitBake recipe. This recipe define:
- Where the application sources are located
- What other components and libraries are used during application build process
- How to build the application
- How to install the application and its resources
- What other components and libraries need to be installed together with the application
- Specialized OCI Image BitBake recipe. This recipe inherit one of pre-defined DAC Image recipes and define:
- Which application should be installed inside the OCI Image
- What is an entry point (executable binary) inside Container
- What additional ENV variables should be set for application