Webinars

Special Interest Groups

RDK-B Working Groups
RDK-V Working Groups
UI-UX Research and Development
DAC

Conferences

[Leadership Update]
[Global Summit]
[Technology Summit]

Preferred Resources

Skip to end of metadata
Go to start of metadata

DAC Distro Feature

Overview

In order to upstream DAC (the DSM and Dobby stack) to a mainline release of RDK-B we need to create a distro feature which enables DAC functionality

This new distro feature "dac" should result in DSM and Dobby being installed on the image with correct kernel config when enabled.

Implementation

The bitbake function bb.utils.contains can be used to conditionally add the DAC components to an existing broadband package group, such as rdk-oss-broadband.

For example, this could be done by adding the following to meta-rdk-broadband/recipes-core/packagegroups/packagegroup-rdk-oss-broadband.bbappend

example listing of packagegroup-rdk-oss-broadband.bbappend:

.
.

RDEPENDS_packagegroup-rdk-oss-broadband_append_dunfell = "${@bb.utils.contains('DISTRO_FEATURES', 'dac',' dobby', '', d)}"

RDEPENDS_packagegroup-rdk-oss-broadband_append_dunfell += "${@bb.utils.contains('DISTRO_FEATURES', 'dac',' dsm', '', d)}"


Then in the local workspace's local.conf  file (or a custom distro definition file) the feature can be enabled like so:

.
.

DISTRO_FEATURES_append += " dac"

Enabling the feature will add Dobby and DSM to the rdk-oss-broadband package group, which is installed as part of an RDK-B build.

Kernel Config

This section covers the implementation of the necessary kernel changes when DAC is enabled in an RDK-B Build.

When the 'dac' distro feature is enabled, the following kernel changes must be in place:

  1. The line ' CMDLINE_append = "cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1" ' must be added to the linux-raspberrypi.inc file

  2. The kernel config file container.cfg must be added to meta-raspberrypi/recipes-kernel/linux/files
  3. linux-raspberrypi_5.4.bb needs to be modified so that container.cfg is added to the SRC_URI variable

These changes are added based on the distro feature like so:

linux-raspberrypi.inc

Append the following line to the file:

.
.
CMDLINE_append = "${@bb.utils.contains('DISTRO_FEATURES', 'dac', 'cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1', '', d)}"

container.cfg

Adding the file will not cause any changes unless it's explicitly added to the kernel recipe so it can just be added without any condition on the distro feature

linux-raspberrypi_5.4.bb

The container.cfg needs to be appended to the kernel's SRC_URI list when the distro feature is enabled.

Append the following line to the recipe:

.
.
SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'dac', 'file://container.cfg', '', d)}"

Implementation

These changes can be applied to a build using the attached patchfile:

This patch was made using the 22q3 source code but has been tested successfully on 22q1 also.

Components

crun

In the DAC implementation (and also RDK-V) crun is configured into the build via a runtime dependency from dobby. The dobby recipe contains no build time dependency on crun (since it makes its crun calls via the binary) but does contain a runtime dependency which simply causes crun to be installed on the image with dobby.

Dobby also specifies a restriction on what versions of crun are compatible:

RDEPENDS_${PN} = "crun (>= 0.14.1)... "

In 22qX RDK-B there are two versions of crun available:

  • 0.10 in meta-virtualization
  • 1.4.2 in meta-rdk-ext

given the restriction set in the dobby recipe, bitbake will select v1.4.2 (It will also just select the newest if no other restriction is given).

To summarise, crun does not need any special additions to configure it behind the distro feature. So long as dobby is configured behind the distro feature, it will cause an appropriate version of crun to be installed alongside it.

Dobby

Recipes for dobby already exist in the RDK-B source. These recipes appear to come directly from RDK-V and include the Dobby Thunder plugin for json rpc. The dobby recipe has a runtime dependency on the thunder plugin which causes the build to fail as RDK-B does not have all the necessary dependencies for thunder ("nothing provides wpeframework-clientlibraries"). As we instead intend to control dobby with DSM, this plugin is not needed for DAC.

Different releases of RDK-B contain varying versions of Dobby for example:

  • 22q3: v3.5
  • 22q1: v3.2
  • 21q4: v3.1 (?)

It is likely best to use the newest version available. In this case v3.5.

Options for implementation

As mentioned, the current dobby recipe doesn't successfully build due to a missing dependency for the thunder plugin. We do not use thunder so it is acceptable to remove this dependency (which gives a successful dobby build).

There are a few options for mainlining this change:

  1. Edit the existing recipe. If RDK-M agrees and no one else actually uses thunder with dobby in RDK-B (seems likely since it's missing the recipes) then the existing recipe can be changed to remove the dependency on 'dobby-thunderplugin'. 
  2. Add a new version of the recipe. If we want to leave the existing recipe in place then a new version can be added. The distro feature can specify PREFERRED_PROVIDER or PREFERRED_VERSION to get this new version.
  3. Toggle the dependency via the distro feature. The dependency can be edited to be removed when the 'dac' feature is enabled. This change would edit the existing dobby recipe. 

Due to the fact that the meta-rdk layer is shared between RDK-V and RDK-V, option 3 is preferred.

Delivering these changes can either be done via a pull request or a patch set. Depending on which approach is taken.

With a sufficient recipe for dobby it can be added conditionally to the rdk-oss-broadband packagegroup based on the distro feature.


  • No labels