Skip to main content
Version: 031

Pantavisor SDK

The SDK released with each tag compiles Pantavisor itself, not only containers. Use it to build and check a Pantavisor change without a Yocto build of this layer.

The SDK is built with the board distro (panta-distro: musl, and the board PANTAVISOR_FEATURES). Its sysroot has the libraries Pantavisor links against.

The SDK does not package Pantavisor for a device. To run a change on a device, build it through the layer: see Pantavisor Development.

Install​

Download the installer for your device's CPU as shown in Build Containers with the SDK, then:

sh ./pv-sdk-<tag>-armv8.sh -d ~/pv-sdk-armv8 -y
. ~/pv-sdk-armv8/environment-setup-*

Build Pantavisor​

The environment script exports CMAKE_TOOLCHAIN_FILE, so a plain cmake cross-compiles for the device, in scripts as well as in the shell:

git clone https://github.com/pantavisor/pantavisor.git
cd pantavisor
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build -j"$(nproc)"
DESTDIR="$PWD/pv-install" cmake --install build --strip

This builds with Pantavisor's default options. To match a board build, pass the -D options from EXTRA_OECMAKE in recipes-pv/pantavisor/pantavisor_git.bb for the features you need, e.g. -DPANTAVISOR_XCONNECT=ON.

The version string comes from git describe, so build from a clone, not a source archive. The release builds the commit in PANTAVISOR_SRCREV (recipes-pv/pantavisor/pantavisor.inc); start from it to change only what you mean to.

pv-install then holds the installed files, e.g. pv-install/usr/bin/pantavisor, built for the device's CPU:

file pv-install/usr/bin/pantavisor
pv-install/usr/bin/pantavisor: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, ...

Add a package to the SDK​

Libraries and headers for the SDK's sysroot go in RDEPENDS:${PN} in recipes-pv/pv-sdk-tools/packagegroup-pv-sdk-target.bb. List the -dev package, and -staticdev as well to link statically:

RDEPENDS:${PN} = " \
...
zlib-dev \
zlib-staticdev \
"

Tools that run on the host are nativesdk- packages: add those to RDEPENDS in recipes-pv/pv-sdk-tools/nativesdk-pv-sdk-tools.bb.

Rebuild the SDK and check that the package landed in its sysroot:

./kas-container shell kas/machines/docker-armv8.yaml:kas/scarthgap.yaml:kas/bsp-base.yaml:kas/sdk.yaml \
-c "bitbake -c populate_sdk pv-sdk"
grep zlib-dev build/tmp-scarthgap-sdk/deploy/sdk/pv-sdk-armv8-x86_64.target.manifest

Add commercial codecs​

ffmpeg, x264, x265, gstreamer1.0-libav and the GStreamer ugly plugins are only added to the SDK when the build accepts the commercial license flag. Check the licensing for your distribution, then set this in a local_conf_header entry of your KAS configuration:

LICENSE_FLAGS_ACCEPTED += "commercial"

Add a vendor GPU or NPU library​

The SDK builds for generic docker-* machines, so its graphics stack is Mesa. Vendor EGL, GBM and NPU libraries are not included: add them for a specific board in that board's layer.