Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Most Firebolt bolt web apps just point WPE WebKit at a URL and rely on codecs already present in the standard RDK/bolt runtime image, so packaging them only needs bolt pack with an empty rootfs (see Building App packages).

Sometimes, though, a web app needs a GStreamer codec/plugin that isn't part of the standard runtime image — for example a commercially licensed codec from gstreamer1.0-libav, an extra parser like opusparse, or a different DRM/CDM backend. Codec support lives in the OS/runtime image, not in the app package, so this can't be solved by bolt pack alone. You need your own small Yocto meta-layer that:

  1. Extends the base bolt runtime image with the extra codec package(s)/plugins.
  2. Builds that extended image into a bolt package via bolt make.
  3. Defines the app's bolt package config (entry point, permissions, dependencies) so it is packaged/deployed together with (or on top of) that runtime.

This document walks through creating such a layer from scratch.

1. Prerequisites

  • A build host set up per the Yocto system requirements, plus the repo tool and (on 64-bit hosts) g++-multilib.
  • The bolt tool and its dependencies (node, tar, unzip, rsync, umoci, mkfs.erofs/fsck.erofs, veritysetup, ssh/scp) installed and on PATH.
  • Access to the RDK meta layers your distro release needs (meta-rdk, meta-rdk-video, meta-rdk-auxiliary, meta-rdk-oss-reference) and to meta-bolt-distro.
  • Certificates for signing the app bundle (see App package - signing and verification).

2. Create the meta-layer repository

Pick a name for your layer, e.g. meta-bolt-<your-app-name>, and create the following structure:

Code Block
languagejson
meta-bolt-<your-app-name>/
├── conf/
│   └── layer.conf
├── manifests/
│   └── deps.xml
├── repo-sync
├── setup-environment
├── recipes-core/
│   └── images/
│       └── <your-app>-bolt-image.bb
├── recipes-multimedia/
│   └── gstreamer/
│       └── gstreamer1.0-plugins-bad_%.bbappend   (only if you need to toggle plugins)
└── package-configs/
    ├── com.rdkcentral.<your-app-name>.json
    └── <your-app-name>.bolt.json


2.1 manifests/deps.xml — pin your dependency layers

A repo manifest listing the exact revision of every meta layer your build depends on:


Code Block
languagejson
<manifest>
  <remote name="rdkcentral" fetch="https://github.com/rdkcentral/"/>

  <project remote="rdkcentral" name="meta-rdk" upstream="develop" revision="refs/tags/<version>" path="meta-rdk"/>
  <project remote="rdkcentral" name="meta-rdk-video" upstream="develop" revision="<commit-or-tag>" path="meta-rdk-video"/>
  <project remote="rdkcentral" name="meta-rdk-auxiliary" upstream="main" revision="refs/tags/<version>" path="meta-rdk-auxiliary"/>
  <project remote="rdkcentral" name="meta-rdk-oss-reference" upstream="main" revision="refs/tags/<version>" path="meta-rdk-oss-reference"/>

  <project remote="rdkcentral" name="meta-bolt-distro" upstream="main" revision="refs/tags/<version>" path="bolt"/>
</manifest>

Pick versions that match the RDK/bolt distro release you are targeting. Refer: deps.xml

2.2 repo-sync — fetch the pinned layers

You can reuse this -> repo-sync
Code Block
languagejson
#!/bin/bash
set -e
BASE_DIR=$(readlink -m "$(dirname "${BASH_SOURCE[0]}")")
MANIFEST="${BASE_DIR}/manifests/deps.xml"

mkdir -p deps
pushd deps
repo init --standalone-manifest --manifest-url="file://${MANIFEST}" ${BOLT_REPO_INIT_PARAMS}
repo sync ${BOLT_REPO_SYNC_PARAMS}
popd

2.3 setup-environment — one command to bootstrap the build

You can also reuse this → setup-environment

Code Block
languagejson
#!/bin/bash
test -f .env && source $_

META_ROOT=$(readlink -m "$(dirname "${BASH_SOURCE[0]}")")
SETUP_SCRIPT=deps/bolt/setup-environment

if [ ! -f ${SETUP_SCRIPT} ]; then
  ${META_ROOT}/repo-sync
fi

if [ -f ${SETUP_SCRIPT} ]; then
  source ${SETUP_SCRIPT}
fi

if [[ -n "${BUILDDIR}" && "$(pwd)" == "$(readlink -m ${BUILDDIR})" ]]; then
  DIR_FILE=$(basename ${META_ROOT}).done
  if [ ! -f conf/${DIR_FILE} ]; then
    echo "BBLAYERS:append = \" ${META_ROOT}\"" >> conf/bblayers.conf
    echo ${META_ROOT} > conf/${DIR_FILE}
  fi
fi

This fetches dependencies on first run (via repo-sync), sources the bolt distro's own setup-environment (which creates the bitbake BUILDDIR), and appends your layer to conf/bblayers.conf so bitbake picks up its recipes.

2.4 conf/layer.conf — declare the bitbake layer

Code Block
languagejson
BBPATH .= ":${LAYERDIR}"
BBPATH .= ":${LAYERDIR}/deps/meta-rdk"
BBPATH .= ":${LAYERDIR}/deps/meta-rdk-video"
BBPATH .= ":${LAYERDIR}/deps/meta-rdk-auxiliary"
BBPATH .= ":${LAYERDIR}/deps/meta-rdk-oss-reference"

BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-bolt-<your-app-name>"
BBFILE_PATTERN_meta-bolt-<your-app-name> = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-bolt-<your-app-name> = "10"

LAYERDEPENDS_meta-bolt-<your-app-name> = "bolt-base"
LAYERSERIES_COMPAT_meta-bolt-<your-app-name> = "kirkstone"

Add any recipe/version overrides your app needs here, e.g.:

Code Block
languagejson
PREFERRED_VERSION_ffmpeg = "4.2.2"

2.5 A custom image recipe with the extra codec(s)

recipes-core/images/<your-app>-bolt-image.bb:

Code Block
languagejson
SUMMARY = "Runtime image with extra codec support"

inherit base-bolt-image

# Pull in the codec(s) your app's media pipeline needs, e.g. FFmpeg/libav-backed
# GStreamer decoders/demuxers not present in the stock base image.
IMAGE_INSTALL += "gstreamer1.0-libav"

Info
You can refer →  extracodecs-bolt-image.bb

If you only need to toggle individual plugins inside an existing GStreamer recipe (rather than add a whole extra package), use a .bbappend instead, e.g. recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend:

Code Block
languagejson
PACKAGECONFIG:append = " opusparse"
PACKAGECONFIG:remove = "hls"

If the codec requires DRM-protected playback, you may also need .bbappends for wpe-webkit/wpeframework to switch their CDM/DRM backend (e.g. to Rialto) and enable the matching DISTRO_FEATURES. This is highly version- and vendor-specific, so consult the WPE WebKit/WPEFramework recipes for the release you are building against.

2.6 App package config — package-configs/com.rdkcentral.<your-app-name>.json

This is the bolt package config for the app itself:

Code Block
languagejson
{
  "id": "com.rdkcentral.<your-app-name>",
  "version": "0.1.0",
  "versionName": "develop",
  "name": "<your-app-name>",
  "packageType": "application",
  "entryPoint": "--dev https://<host>/<path-to-app>/index.html",
  "dependencies": {
    "com.rdkcentral.wpe": "<matching-wpe-version>"
  },
  "permissions": [
    "urn:rdk:permission:internet",
    "urn:rdk:permission:firebolt",
    "urn:rdk:permission:thunder",
    "urn:rdk:permission:rialto"
  ],
  "configuration": {}
}

Info
You can refer → com.rdkcentral.webaudio.json

Key fields:

  • entryPoint — the URL WPE WebKit should load.
  • dependencies — the WPE runtime (and any other bolt packages) the app requires.
  • permissions — capabilities the container needs (internet, thunder, firebolt, rialto, etc.).
  • configuration — optional app/runtime configuration overrides (e.g. enabling Web Audio).

2.7 Bolt make instructions — package-configs/<your-app-name>.bolt.json

Ties the package config to the bitbake image built in step 2.5, per the bolt make file format:

Code Block
languagejson
{
  "config": "com.rdkcentral.<your-app-name>.json",
  "bitbake": {
    "image": "<your-app>-bolt-image"
  }
}
Info
You can refer → fc-webaudio.bolt.json

3. Build

Code Block
languagejson
git clone <your-repo-url> meta-bolt-<your-app-name>
cd meta-bolt-<your-app-name>
source setup-environment

Adjust MACHINE/BBMULTICONFIG in conf/local.conf if needed, then:

Code Block
languagejson
# 1. Build the extended runtime image with the extra codec(s)
bitbake <your-app>-bolt-image

# 2. Build (and install to the local package store) the packages it depends on
bolt make base --install
bolt make wpe --install
## ****Or you can get the base and wpe bolt packages and place it in ~/bolts folder in your machine****

# 3. Package the app, using the bitbake image built in step 1
bolt make <your-app-name> --install

bolt make <your-app-name> resolves to <your-app-name>.bolt.json, runs bitbake <your-app>-bolt-image (reusing the output from step 1), and produces com.rdkcentral.<your-app-name>+<version>.bolt — a bolt/DAC package containing the extended runtime plus your app's package config, ready to sign and deploy.

4. Sign and deploy

  1. Sign the package as described in App package - signing and verification.
  2. Copy/SCP the .bolt file to the device.
  3. Install it via PackageManager:
  4. Launch it via Home Ui: