Unfortunately I could only found one Yocto layer that could give us support for rockchip boards and that one only supports RockPi C4+. So yeah it makes this article here invalid. I am keeping it for now while I find another board to try out Mender. And/or leave Mender for future article and focus in at least building Yocto for Rock Pi S with no Mender support so at least I can reach the end of the bitbaking =)
Creating a Yocto project for Rock Pi S with Mender.io integration for full Linux system OTA updates.
- Development Machine: Lenovo laptop with AMD Ryzen 7 4000 series + AMD Radeon Graphics
- Host OS: Bluefin Project (Fedora 42 Silverblue with GNOME 42)
- Build Environment: Distrobox container for isolation
- Target: Rock Pi S (RK3308 SoC)
- Storage Requirements: 50GB+ free space
- RAM: 8GB+ recommended
Using Bluefin (immutable OS) provides excellent isolation between the base system and development environments. Distrobox allows us to create a traditional mutable Linux environment specifically for Yocto builds without affecting the host system.
For this project, we'll use Ubuntu 24.04:
distrobox create --name yocto-dev --image quay.io/toolbx/ubuntu-toolbox:24.04
distrobox enter yocto-devsudo apt update
sudo apt install -y gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 libegl1-mesa-dev libsdl1.2-dev pylint \
xterm python3-subunit mesa-common-dev zstd liblz4-tool file coreutilsmkdir -p ~/Code/yopime && cd ~/Code/yopimeProject name "yopime" is a tribute to the indigenous Yopime people from the Guerrero region of Mexico.
cd ~/Code/yopime
git clone git://git.yoctoproject.org/poky && cd poky && git checkout scarthgap && cd ..cd ~/Code/yopime
git clone git://git.openembedded.org/meta-openembedded && cd meta-openembedded && git checkout scarthgap && cd ..
git clone https://github.com/JeffyCN/meta-rockchip.git && cd meta-rockchip && git checkout scarthgap && cd ..
git clone https://github.com/mendersoftware/meta-mender.git && cd meta-mender && git checkout scarthgap && cd ..It's a best practice to create a custom layer for our project-specific changes. This keeps the project clean and manageable.
# First, source the build environment to get access to helper scripts
source poky/oe-init-build-env build
# Now, create our custom layer
bitbake-layers create-layer ../meta-yopimeIf you haven't already, source the build environment script. This will move you into the build directory.
cd ~/Code/yopime
source poky/oe-init-build-env buildAdd our new meta-yopime layer to conf/bblayers.conf. Replace the entire content of the file with the following:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/var/home/aviler/Code/yopime/poky/meta \
/var/home/aviler/Code/yopime/poky/meta-poky \
/var/home/aviler/Code/yopime/poky/meta-yocto-bsp \
/var/home/aviler/Code/yopime/meta-openembedded/meta-oe \
/var/home/aviler/Code/yopime/meta-openembedded/meta-python \
/var/home/aviler/Code/yopime/meta-openembedded/meta-networking \
/var/home/aviler/Code/yopime/meta-rockchip \
/var/home/aviler/Code/yopime/meta-mender/meta-mender-core \
/var/home/aviler/Code/yopime/meta-yopime \
"Add the following lines to the end of your conf/local.conf file. The comments highlight common issues and their solutions.
# Machine configuration (for Yocto build)
# Note: The machine name for Rock Pi S in meta-rockchip (scarthgap) is 'rockchip-rk3308-evb', not 'rock-pi-s'.
MACHINE = "rockchip-rk3308-evb"
# Mender configuration
INHERIT += "mender-full"
MENDER_FEATURES_ENABLE:append = " mender-uboot"
MENDER_ARTIFACT_NAME = "release-1"
# Device identifier for the Mender server. We use 'yopime' for our project.
MENDER_DEVICE_TYPE = "yopime"
# Mender storage configuration for a 32GB SD card
# Note: Yocto's parser requires comments to be on separate lines from variable assignments.
MENDER_STORAGE_TOTAL_SIZE_MB = "32768"
MENDER_BOOT_PART_SIZE_MB = "64"
MENDER_DATA_PART_SIZE_MB = "512"
# Network configuration
MENDER_SERVER_URL = "https://hosted.mender.io"
# Features: Enable systemd as the init manager
# Note: Explicitly set all three systemd variables to avoid common build errors with mender-systemd.
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
INIT_MANAGER = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
# Image features
IMAGE_FEATURES += "ssh-server-openssh"During the build, you might encounter an error: ERROR: Nothing PROVIDES 'u-boot'. This happens because meta-mender depends on a recipe named u-boot, but meta-rockchip provides it as u-boot-rockchip. We fix this by creating a .bbappend file in our custom layer to tell Yocto that u-boot-rockchip also provides u-boot.
Create the required directory structure and the .bbappend file:
mkdir -p ../meta-yopime/recipes-bsp/u-boot
touch ../meta-yopime/recipes-bsp/u-boot/u-boot-rockchip.bbappendNow, add the following content to the newly created u-boot-rockchip.bbappend file:
# Let the build system know that this recipe provides the 'u-boot' dependency
# required by the meta-mender layer.
PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"
With all configurations and patches in place, you are ready to build the image.
bitbake core-image-baseStatus: ✅ Build successful!
- Flash the generated
.sdimgto an SD card. The image will be located attmp/deploy/images/rockchip-rk3308-evb/core-image-base-rockchip-rk3308-evb.sdimg. - Boot the device and accept it in the Mender UI.
- Create a second release and deploy an OTA update.