...
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:
- Extends the base bolt runtime image with the extra codec package(s)/plugins.
- Builds that extended image into a bolt package via
bolt make. - 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.
- 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).
Pick a name for your layer, e.g. meta-bolt-<your-app-name>, and create the following structure:
| Code Block |
|---|
|
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
|
A repo manifest listing the exact revision of every meta layer your build depends on:
...
Pick versions that match the RDK/bolt distro release you are targeting. Refer: deps.xml
You can reuse this -> repo-sync
| Code Block |
|---|
|
#!/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 |
|---|
|
#!/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.
| Code Block |
|---|
|
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 |
|---|
|
PREFERRED_VERSION_ffmpeg = "4.2.2" |
recipes-core/images/<your-app>-bolt-image.bb:
| Code Block |
|---|
|
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"
|
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:
...
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.
This is the bolt package config for the app itself:
| Code Block |
|---|
|
{
"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": {}
}
|
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).
Ties the package config to the bitbake image built in step 2.5, per the bolt make file format:
| Code Block |
|---|
|
{
"config": "com.rdkcentral.<your-app-name>.json",
"bitbake": {
"image": "<your-app>-bolt-image"
}
} |
| Code Block |
|---|
|
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 |
|---|
|
# 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
- Sign the package as described in App package - signing and verification.
- Copy/SCP the
.bolt file to the device. - Install it via PackageManager:
- Launch it via Home Ui: