Pantavisor Development
Use kas/with-workspace.yaml to develop pantavisor source locally while rebuilding through the Yocto layer.
Initial Setup
The first build with the workspace overlay creates the devtool workspace:
./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml
Workspace sources:
build/workspace/sources/pantavisor/ # Pantavisor runtime
build/workspace/sources/lxc-pv/ # LXC with pantavisor patches
Workspace bbappend files (redirect recipes to local sources):
build/workspace/appends/pantavisor_git.bbappend
build/workspace/appends/lxc-pv_git.bbappend # create manually if needed
Development Cycle
-
Edit source code:
cd build/workspace/sources/pantavisor# Make changes to C files, headers, etc. -
Rebuild:
cd /path/to/meta-pantavisor./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml -
Test — see ../testing/development-workflow.md
-
Commit when ready:
cd build/workspace/sources/pantavisorgit add -A && git commit -m "feat: description" && git push
Building Specific Targets
Build only pantavisor (faster iteration):
./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml \
--target pantavisor
Build pantavisor and appengine image:
./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml \
--target pantavisor-appengine
Common Workflows
Quick Pantavisor Change Test
# 1. Edit pantavisor source
cd build/workspace/sources/pantavisor
vim xconnect/plugins/drm.c
# 2. Rebuild (from meta-pantavisor root)
cd /path/to/meta-pantavisor
./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml
# 3. Reload docker image
docker load < build/tmp-scarthgap/deploy/images/docker-x86_64/pantavisor-appengine-docker.tar
# 4. Test (fresh storage)
docker rm -f pva-test; docker volume rm storage-test
docker run --name pva-test -d --privileged \
-v $(pwd)/pvtx.d:/usr/lib/pantavisor/pvtx.d \
-v storage-test:/var/pantavisor/storage \
--entrypoint /bin/sh pantavisor-appengine:latest -c "sleep infinity"
docker exec pva-test sh -c 'pv-appengine &'
sleep 15
docker exec pva-test lxc-ls -f
Testing xconnect Plugin Changes
# 1. Edit plugin
cd build/workspace/sources/pantavisor
vim xconnect/plugins/unix.c
# 2. Build appengine
cd /path/to/meta-pantavisor
./kas-container build kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml
# 3. Reload and test
docker load < build/tmp-scarthgap/deploy/images/docker-x86_64/pantavisor-appengine-docker.tar
docker rm -f pva-test; docker volume rm storage-test
docker run --name pva-test -d --privileged \
-v $(pwd)/pvtx.d:/usr/lib/pantavisor/pvtx.d \
-v storage-test:/var/pantavisor/storage \
--entrypoint /bin/sh pantavisor-appengine:latest -c "sleep infinity"
docker exec pva-test sh -c 'pv-appengine &'
sleep 15
docker exec pva-test pvcontrol graph ls
Bumping pantavisor SRCREV
When bumping the pantavisor commit:
- Update
PANTAVISOR_SRCREVinrecipes-pv/pantavisor/pantavisor.inc— the actual hash lives there;pantavisor_git.bbjust forwards it viaSRCREV = "${PANTAVISOR_SRCREV}" - Verify the hash against the actual remote — squash merges rewrite hashes, so a branch SHA won't match the merged master SHA
- Update
PKGVinpantavisor_git.bbto match the latest tag reachable from the new SRCREV (e.g. if latest tag is026, setPKGV = "026+git0+${GITPKGV}")
Adding Workspace Packages
To use a local source for a package not yet in the workspace (e.g., lxc-pv):
# Create bbappend
cat > build/workspace/appends/lxc-pv_git.bbappend << 'EOF'
inherit externalsrc
EXTERNALSRC = "${TOPDIR}/workspace/sources/lxc-pv"
EXTERNALSRC_BUILD = "${WORKDIR}/build"
EOF
# Clone the source
cd build/workspace/sources
git clone https://github.com/pantavisor/lxc.git lxc-pv
cd lxc-pv && git checkout <branch>
Troubleshooting Build Issues
Stale Build Artifacts
./kas-container shell kas/build-configs/release/docker-x86_64-scarthgap.yaml:kas/with-workspace.yaml \
-c "bitbake -c cleansstate <recipe-name>"
Stale Configure Artifacts in Workspace Source
cd build/workspace/sources/<package>
git clean -fdx
Docker Image Not Updated
After rebuilding, always reload the docker image before testing:
docker load < build/tmp-scarthgap/deploy/images/docker-x86_64/pantavisor-appengine-docker.tar