Skip to content

RPI5 image update with qbee and RAUC


In the ever-evolving landscape of embedded systems and single-board computers, two prominent entities have garnered significant attention: RAUC and Raspberry Pi 5. RAUC, which stands for "Robust Auto-Update Controller," is a crucial component in managing software updates for embedded Linux systems. On the other hand, Raspberry Pi 5 represents the latest iteration of the immensely popular Raspberry Pi series, known for its versatility, affordability, and extensive community support. This tutorial shows how you can integrate RAUC and qbee-agent on Raspberry PI 5 to perform A/B image updates through the qbee platform.

Get boilerplate sources

Set up the general yocto build environment with dependencies.

export YOCTO_DIR=$(pwd)
git clone -b scarthgap $YOCTO_DIR/sources/poky
source $YOCTO_DIR/sources/poky/oe-init-build-env
bitbake-layers layerindex-fetch --branch master --fetchdir $YOCTO_DIR/sources meta-networking meta-multimedia

Get sources for Raspberry PI

We need a specially tweaked build of u-boot for RAUC.

This build has not been added to the stable branch but we expect it to appear there soon. A Big thanks to Konsulko Group for their great work in integrating u-boot for Raspberry PI 5.

bitbake-layers layerindex-fetch --branch master --fetchdir $YOCTO_DIR/sources meta-raspberrypi
cd $YOCTO_DIR/sources/meta-raspberrypi
git remote add timo
git remote update
git checkout scarthgap/raspberrypi5_u-boot

Get BSP layers for rauc on Raspberry PI

bitbake-layers layerindex-fetch --branch master --fetchdir $YOCTO_DIR/sources meta-rauc-raspberrypi
cd $YOCTO_DIR/sources/meta-rauc-community
git remote add timo
git remote update
git checkout scarthgap/raspberrypi5_u-boot
NB! This command will produce an error regarding missing dependency, but that will be handled below.

u-boot support for raspberrypi5 scarthgap

This adds u-boot support for Raspberry PI 5 on Yocto release scarthgap.

git clone --branch scarthgap/u-boot $YOCTO_DIR/sources/meta-lts-mixins
bitbake-layers add-layer $YOCTO_DIR/sources/meta-lts-mixins

Add qbee-agent

git clone --branch master $YOCTO_DIR/sources/meta-qbee
bitbake-layers add-layer $YOCTO_DIR/sources/meta-qbee/meta-qbee

Configure $YOCTO_DIR/build/conf/local.conf

MACHINE = "raspberrypi5"
INIT_MANAGER = "systemd"
IMAGE_INSTALL:append = " rauc"
IMAGE_FSTYPES = "tar.bz2 ext4 wic.bz2 wic.bmap"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
# qbee-agent bootstrap key to use
QBEE_BOOTSTRAP_KEY = "<bootstrap_key>"

Verify files

Verify that the following file contains these lines:



Verify that the following file is identical this:


DESCRIPTION = "RAUC bundle generator"

inherit bundle



RAUC_SLOT_rootfs = "core-image-minimal"
RAUC_SLOT_rootfs[fstype] = "ext4"
RAUC_SLOT_rootfs[adaptive] = "block-hash-index"

Create a PKI for signing of RAUC update bundles

bitbake openssl-native
bitbake openssl-native -c addto_recipe_sysroot

Build the image

bitbake core-image-minimal

Flash the sdcard using the following command. NB! Make sure you use the right device for flashing.

cd $YOCTO_DIR/build
sudo umount /dev/sdX*
bzcat tmp-glibc/deploy/images/raspberrypi5/core-image-minimal-raspberrypi5.rootfs.wic.bz2 | sudo dd of=/dev/sdX

Put the sdcard in the Raspberry PI 5, attach the ethernet port to a working network and power on the device. The device will now auto-bootstrap to the qbee platform given that the bootstrap key above is a valid one.

Create the update bundle

Add the following to local.conf

IMAGE_INSTALL:append =" nano"

Build the update bundle

bitbake update-bundle

This produces a .raucb file which is symlinked to tmp-glibc/deploy/images/raspberrypi5/update-bundle-raspberrypi5.raucb.

This file can be uploaded to the qbee file manager and used in combination with the RAUC image update configuration option in the qbee platform.

Update RPI5 firmware image with RAUC