Raspberry Pi Embedded Linux with Containers
Why Raspberry Pi for Embedded Linux
The Raspberry Pi has graduated from hobbyist board to widely-deployed industrial gateway, kiosk controller, edge node, and prototype platform. With models ranging from the Pi Zero 2 W to the Pi 5, and the Compute Module line for embedded designs, it covers a huge range of use cases.
The catch: making an RPi production-ready — atomic OTA, automatic rollback, signed updates, fleet management — is non-trivial. Pantavisor solves that out of the box.
Two Quick-Start Paths
Path 1 — Pre-Built Image (Fastest)
Download a ready-made Pantavisor image for your RPi model from docs.pantahub.com/initial-devices, flash it, and you’re running Pantavisor in minutes.
# Install pvflasher
curl -fsSL https://raw.githubusercontent.com/pantavisor/pvflasher/main/scripts/install.sh | bash
# List candidate disks
pvflasher list
# Flash (replace /dev/sdX with your SD card)
sudo pvflasher copy rpi4-pantavisor.wic.bz2 /dev/sdXBoot the Pi. It registers with Pantahub, gets a nickname, and is immediately manageable via PVR. Skip ahead to Update Embedded Linux Firmware OTA.
Path 2 — Yocto Build (Production)
For custom hardware revisions, additional kernel features, or auditable supply chain, build with meta-pantavisor:
git clone https://github.com/pantavisor/meta-pantavisor.git
cd meta-pantavisor
# RPi 4 ARMv8 (64-bit)
kas build kas/scarthgap.yaml:kas/machines/raspberrypi-armv8.yaml:kas/bsp-base.yaml
# Output:
# build/tmp-scarthgap/deploy/images/raspberrypi-armv8/pantavisor-starter-raspberrypi-armv8.wicFlash with pvflasher exactly as above. See Build an Embedded Linux Image from Containers for the full Yocto workflow.
Supported Raspberry Pi Models
meta-pantavisor ships KAS machine configs for the common RPi targets:
- Raspberry Pi 3 (32-bit and 64-bit)
- Raspberry Pi 4 (
raspberrypi-armv8) - Raspberry Pi 5
- Raspberry Pi Zero 2 W
- Compute Module 4 / 5
For the authoritative list, see Supported Devices and the kas/machines/ directory in meta-pantavisor.
What You Get on First Boot
The pre-built starter image typically ships with:
- BSP container — RPi-specific kernel, device tree, firmware blobs
- Networking container — Alpine + ConnMan handling Ethernet + WiFi
- WiFi connect container — captive portal for first-time WiFi setup
pvr-sdkcontainer — on-device PVR + tooling for diagnostics- Pantahub agent built into Pantavisor itself — auto-registration
After registration, the device shows up under your Pantahub account with a generated nickname (e.g. fleet_rpi_001).
Common Industrial RPi Use Cases
Industrial Gateway
Pi 4 + USB serial adapters or HATs (CAN, Modbus, RS-485). Compose a gateway from BSP + ConnMan + Tailscale + protocol-adapter + edge-app containers. See IoT Gateway with Composable Containers.
Kiosk / Digital Signage
Pi 4 + HDMI display. Compose BSP + Wayland/Weston container + signage-app container. Update the signage app weekly without touching the rest.
Edge AI / Vision
Pi 5 + camera. Compose BSP + camera-stack + inference container. Swap models by updating one container.
Compute Module Gateway
CM4 on a custom carrier. Build a custom MACHINE config in meta-pantavisor, ship as a sealed BSP container.
Pi-Specific Notes
config.txt and Boot Parameters
Pantavisor respects standard RPi boot config. To customize:
- Pre-built images — write
cmdline.txt/config.txtoverrides into the boot partition before flashing. - Yocto builds — set them in your machine config and they’re baked into the BSP container.
USB Boot
CM4 and Pi 4/5 support USB / NVMe boot. meta-pantavisor’s wic recipes can produce images for these targets — check the kas/machines/ configs.
WiFi Provisioning
The pvwificonnect container brings up an AP-mode SSID on first boot if no network is configured. Connect with a phone, pick your home/lab WiFi, the device joins and registers with Pantahub.
GPIO and HATs from Containers
Containers can access GPIO via /dev/gpiomem or /dev/mem with appropriate mdev.json permissions. Declare the device nodes in args.json:
{
"PV_DRIVERS_OPTIONAL": ["wifi", "usbnet", "bluetooth"]
}OTA Workflow on RPi
Identical to any other Pantavisor device — see Update Embedded Linux Firmware OTA:
pvr clone https://pvr.pantahub.com/<USER>/<DEVICE_NICK> ws
cd ws
pvr app update edge-app --from=https://gitlab.com/myorg/edge-app:1.4.2
pvr commit -m "edge-app 1.4.2"
pvr post https://pvr.pantahub.com/<USER>/<DEVICE_NICK>The Pi pulls the new objects, switches atomically, and rolls back if anything fails its status_goal.
RPi vs Custom Hardware Trade-offs
| Aspect | RPi (pre-built) | RPi (Yocto) | Custom Hardware (Yocto) |
|---|---|---|---|
| Setup time | Minutes | Hours | Days–weeks |
| Customization | Limited | Full | Full |
| Long-term supply | Pi Foundation roadmap | Same | Your supply chain |
| Production-ready | Prototypes / light prod | Yes | Yes |
For prototyping and small-volume deployments, the pre-built path is fine. For high-volume or long-lived industrial deployments, build with Yocto so you control the entire stack.
Common Pitfalls
- Wrong machine name — RPi 4 in 64-bit is
raspberrypi-armv8, notraspberrypi4. Pick the right KAS machine YAML. - Underpowered PSU — Pi 4 / 5 with WiFi + peripherals need 3 A. Brownouts cause weird Pantavisor behavior that looks like software bugs.
- SD card quality — industrial deployments should use eMMC / industrial-grade SD or USB SSD; consumer SD cards die fast under write load.
- Skipping
pvflasher list— flashing the wrong disk destroys data irreversibly.
Next Steps
- Pre-built RPi images — Download and flash now
- Build an Embedded Linux Image from Containers — Yocto build guide
- IoT Gateway with Composable Containers — RPi as gateway
- Update Embedded Linux Firmware OTA — Ship updates after first boot
- Supported Devices — Full hardware compatibility list