[PATCH 0/2] bootstd: New bootmeth for RAUC A/B systems

Martin Schwan m.schwan at phytec.de
Wed Jan 29 15:25:24 CET 2025


This series implements a new bootmeth for RAUC A/B systems. RAUC (Robust
Auto Update Controller) is a lightweight update client, providing "Safe
and Secure OTA Updates for Embedded Linux". See the following links for
more information about RAUC:

  https://rauc.io/
  https://rauc.readthedocs.io/en/latest/

PHYTEC uses RAUC in its Yocto based distribution "Ampliphy" as the
default way of updating embedded devices based on PHYTEC hardware. So
far, the logic selecting the correct partitions and files to boot was
being implemented in the U-Boot environment. While this is a
straightforward way to do it, adding and supporting new platforms became
somewhat tedious and is platform-specific. The introduction of U-Boot's
"Standard Boot" provided a convincing alternative, promising a simpler
and more portable way of booting, even for RAUC systems. This led me to
implement a new bootmeth supporting RAUC A/B systems. Note, that this
new bootmeth is not proprietary to PHYTEC products and is designed to
work on other hardware with a RAUC A/B system, too.

The bootmeth currently only supports symmetric A/B partitioning layouts.
E.g. A/rescue is not (yet) supported. The partition indexes and default
slot tries can be specified via environment variables, so that these
settings can be changed on a running system, in case they may change in
the future for that individual target, without needing to update the
U-Boot proper.

For now, the bootmeth_rauc uses a similar approach for loading the
Kernel and device tree as the bootmeth_script, in that it requires a FIT
containing a U-Boot script loading the desired distro. It could be
possible to support booting without a script and load the Kernel and DT
directly with this bootmeth, but I found the script method to be very
flexible for now, in letting the distro decide what to load.

The bootmeth_rauc was tested on a phyBOARD-Pollux i.MX8M Plus [1] with
BSP-Yocto-Ampliphy-i.MX8MP-PD24.1.2 [2] and the following changes in the
U-Boot environment:

  BOOT_ORDER=system0 system1
  rauc_slots=system0 system1
  rauc_partitions=1,5 2,6
  rauc_slot_default_tries=3

Supported boot devices are currently only MMC devices, but it should be
possible to add SPI flashes in the future.

To test this patch stack with PHYTEC's phyBOARD-Pollux i.MX8M Plus
board, you need to adjust the boot files to include the boot.scr.uimg
containing the distro's boot script and set "optargs" to "${raucargs}"
in it. Also disable any legacyboot in the U-Boot environment and simply
boot with Standard Boot:

  bootmeth order rauc
  bootflow scan -lb

Regards,
Martin

[1]: https://www.phytec.eu/en/produkte/single-board-computer/phyboard-pollux/
[2]: https://download.phytec.de/Software/Linux/BSP-Yocto-i.MX8MP/BSP-Yocto-Ampliphy-i.MX8MP-PD24.1.2/

---
Martin Schwan (2):
      bootstd: Add implementation for bootmeth rauc
      doc: Add description for bootmeth rauc

 boot/Kconfig                     |  11 ++
 boot/Makefile                    |   1 +
 boot/bootmeth_rauc.c             | 408 +++++++++++++++++++++++++++++++++++++++
 doc/develop/bootstd/index.rst    |   1 +
 doc/develop/bootstd/overview.rst |   1 +
 doc/develop/bootstd/rauc.rst     |  55 ++++++
 6 files changed, 477 insertions(+)
---
base-commit: a2b489b170f8382f746202c36616eaf2bc38fe86
change-id: 20250129-wip-bootmeth-rauc-03b5e2dd88f4

Best regards,
-- 
Martin Schwan <m.schwan at phytec.de>



More information about the U-Boot mailing list