Skip to content

Yocto integration

Overview

This documentation provides a guide to integrate Update Factory support in devices using a Yocto-based embedded Linux OS. Starting from Yocto release 4.0 (branch kirkstone) this layer implements the double copy strategy. For those looking to implement a single copy strategy, see meta-updatefactory-singlecopy.

Kynetics maintains meta-updatefactory, a layer designed to facilitate the integration of Update Factory in embedded Linux OSes built using the Yocto project. The layer provides an easy way to add support for:

This section provides guidance to set up and configure meta-updatefactory to build OS images for the following supported boards:

  1. Raspberry Pi (RPi 4B)
  2. Toradex (Verdin iMX8M Plus)

The layer makes it easy to expand support to other boards.

Required layers

Here you will find references to set up a host machine with all the required Yocto layers to build an embedded Linux OS with Update Factory support.

Poky (basic layer)

See the Yocto Quick Start documentation to setup a host machine to build an embedded Linux OS with the poky layer.

Hardware layers

All supported hardware vendors provide a Yocto BSP and guidance on how to build it. Have a look at the following links for more information:

  1. Raspberry Pi BSP
  2. Toradex BSP

meta-swupdate layer

meta-updatefactory depends on meta-swupdate. Refer to the "Building with Yocto" section in SWUpdate's documentation to customize SWUpdate configuration.

meta-updatefactory integration

Once all the required layers are in place clone meta-updatefactory alongside the other layers:

git clone https://github.com/Kynetics/meta-updatefactory.git -b <branch>
and add it to the bblayers.conf:
...
${BSPDIR}/sources/meta-swupdate \
${BSPDIR}/sources/meta-updatefactory \
...

Add the following snippet in the OS image recipe:

require <relative-path-to>/recipes-images/images/swupdate-regular.inc

Note

If you are building for Raspberry Pi, you have to enable the U-Boot support by setting RPI_USE_U_BOOT = "1" in the local.conf

Double Copy Partitioning scheme

It is possible to provide a custom .wks file (see the Yocto reference manual for the wks syntax) in your Yocto layer. The partitioning scheme requirements for meta-updatefactory are the following:

  1. two boot partitions with GPT label boot-A and boot-B to hold the boot files
  2. two root partitions with GPT label root-A and root-B for the root file system

If you are using Yocto Yocto 4.2 (Mickledore) or earlier, please apply the this patch to allow you to use correctly the --part-name parameter to define the partition name in your .wks file. To apply the patch, from your poky source directory run:

git cherry-pick 18b04f9c3fd6d4268da538c7622875f02ff59d64

We recommend using the provided .wks files:

  • for the Toradex BSP: uf-doublecopy-boot-root.wks
  • for the Raspberry Pi: uf-doublecopy-rpi-boot-root.wks

When using those .wks, partition size for boot and root can be customized with the following bitbake variables:

UF_BOOT_PART_SIZE
UF_ROOT_PART_SIZE

Single Copy Partitioning scheme

It is possible to provide a custom .wks file (see the Yocto reference manual for the wks syntax) in your Yocto layer. The partitioning scheme requirements for meta-updatefactory are the following:

  1. a recovery partition that holds a minimal "recovery OS" to install the updates in single copy mode
  2. an updates partition that holds the .swu update files that will be installed by SWUpdate.

Variables in /etc/swupdate/swupdate.env allow customizing names and directories, if needed:

  SWUPDATE_UPDATES_DIR=/updates
  UPDATES_PART_LABEL=updates
  UPDATES_MOUNTPOINT=/updates

We recommend using the provided .wks files to begin with:

  • For all supported boards except the Raspberry Pi: uf-boot-root-recovery-updates.wks
  • For the Raspberry Pi: uf-rpi-boot-root-recovery-updates.wks

When using those .wks, partition size for boot, root and updates can be customized with the following bitbake variables:

UF_BOOT_PART_SIZE
UF_ROOT_PART_SIZE
UF_UPDATES_PART_SIZE