SlideShare a Scribd company logo
A/B Linux updates with RAUC and meta-
rauc-community: now & in the future
Leon Anavi
Konsulko Group
leon.anavi@konsulko.com
leon@anavi.org
Yocto Project Summit 2021.11
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Konsulko Group
 Services company specializing in Embedded Linux and Open Source Software
 Hardware/software build, design, development, and training services
 Based in San Jose, CA with an engineering presence worldwide
 http://konsulko.com/
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Agenda
 What is RAUC?
 Integrating RAUC on new hardware
 Yocto/OE layer meta-rauc-community
 Examples
 Conclusions
 Q&A
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
What is RAUC?
 A lightweight update client that runs on an Embedded Linux device and reliably
controls the procedure of A/B updating the device with a new firmware revision
 Provides tool for the build system to create, inspect and modify update bundles
 Uses X.509 cryptography to sign update bundles
 Compatible with the Yocto Project and OpenEmbedded, PTXdist and Buildroot
 Started by Pengutronix in 2015, adopted by the community and the industry
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
How Does RAUC Work?
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Licenses
 RAUC – LGPLv2.1
https://github.com/rauc/rauc
 meta-rauc - MIT
https://github.com/rauc/meta-rauc
 meta-rauc-community – MIT
https://github.com/rauc/meta-rauc-community
 rauc-hawkbit – LGPLv2.1
https://github.com/rauc/rauc-hawkbit
 rauc-hawkbit-updater – LGPLv2.1
https://github.com/rauc/rauc-hawkbit-updater
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Eclipse hawkBit
 Domain independent back-end framework for rolling out software updates to
constrained edge devices as well as more powerful controllers and gateways
connected to IP based networking infrastructure
 Written in Java
 Available in GitHub under EPL-1.0 License
 Compatible with RAUC and SWUpdate
 https://www.eclipse.org/hawkbit/
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Are there any RAUC open source alternatives?
 Mender
 SWUpdate
 Swupd
 UpdateHub
 Balena
 Snap
 OSTree
 Aktualizr
 Aktualizr-lite
 QtOTA
 Torizon
 FullMetalUpdate
 Rpm-ostree (used in Project Atomic)
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Common Embedded Linux Update Strategies
 A/B updates with dual redundant scheme (for example: RAUC)
 Delta updates
 Container-based updates
 Combined strategies
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Combined Update Strategies
 Container technology has changed the way application developers interact with the
cloud and some of the good practices are nowadays applied to the development
workflow for embedded devices and IoT
 Containers make applications faster to deploy, easier to update and more secure
through isolation
 Yocto/OE layer meta-virtualization provides support for building Xen, KVM, Libvirt,
docker and associated packages necessary for constructing OE-based virtualized
solutions
 There are use cases on powerful embedded devices where containers are
combined with RAUC A/B updates of the base Linux distribution built with Yocto/OE
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
 Yocto/OpenEmbedded Layers for RAUC
 meta-rauc
Layer for RAUC, the embedded Linux update framework
 meta-rauc-community
Layer with examples for integration of RAUC, the embedded Linux A/B update
framework
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
meta-rauc
 Yocto/OpenEmbedded meta layer for RAUC
 Supports releases Honister, Gatesgarth, Dunfell, Zeus, Warrior, Thud, Sumo,
Morty, Pyro and Krogoth
 Available under MIT license in GitHub: https://github.com/rauc/meta-rauc
 33 contributors, the RAUC co-maintainer Enrico Jörns from Pengutronix is the
leading contributor
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
meta-rauc-community
Yocto/OpenEmbedded meta layer with demo examples for integration of RAUC,
the embedded Linux A/B update framework:
 meta-rauc-raspberrypi: for Raspberry Pi
 meta-rauc-qemux86: for QEMU (qemux86-64)
 meta-rauc-sunxi: for Allwinner sunxi SoCs
 meta-rauc-tegra: for NVIDIA Jetson platforms, based on L4T
https://github.com/rauc/meta-rauc-community
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Contributors
 meta-rauc-community started in 2020
 Moved to RAUC GitHub organization in 2021
 5 contributors
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Notable Contributions
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Integration Steps
 Select an appropriate bootloader
 Enable SquashFS in the Linux kernel configurations
 ext4 root file system (RAUC does not have an ext2 / ext3 file type)
 Create specific partitions that match the RAUC slots
 Configure Bootloader environment and create a script to switch RAUC slots
 Create a certificate and a keyring to RAUC’s system.conf
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Example with Raspberry Pi 4
 Download Poky, meta-openembedded and meta-raspberrypi:
git clone -b dunfell git://git.yoctoproject.org/poky poky-rpi-rauc
cd poky-rpi-rauc
git clone -b dunfell git://git.openembedded.org/meta-openembedded
git clone -b dunfell git://git.yoctoproject.org/meta-raspberrypi
 Download RAUC related layers:
git clone -b dunfell https://github.com/rauc/meta-rauc.git
git clone -b dunfell https://github.com/rauc/meta-rauc-community.git
 Initialize the build environment:
source oe-init-build-env
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Example with Raspberry Pi 4
 Add layers:
bitbake-layers add-layer ../meta-openembedded/meta-oe/
bitbake-layers add-layer ../meta-openembedded/meta-python/
bitbake-layers add-layer ../meta-openembedded/meta-networking/
bitbake-layers add-layer ../meta-openembedded/meta-multimedia/
bitbake-layers add-layer ../meta-raspberrypi/
bitbake-layers add-layer ../meta-rauc
bitbake-layers add-layer ../meta-rauc-community/meta-rauc-raspberrypi/
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Example with Raspberry Pi 4
 Add to local.conf:
MACHINE = "raspberrypi4"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
IMAGE_INSTALL_append = " rauc"
IMAGE_FSTYPES="tar.bz2 ext4 wic.bz2 wic.bmap"
SDIMG_ROOTFS_TYPE="ext4"
ENABLE_UART = "1"
RPI_USE_U_BOOT = "1"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
WKS_FILE = "sdimage-dual-raspberrypi.wks.in"
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Example with Raspberry Pi 4
 Build a minimal bootable image:
bitbake core-image-minimal
 Flash the image to a microSD card and boot it on Raspberry Pi 4:
sudo umount /dev/sdX*
bzcat tmp/deploy/images/raspberrypi4/core-image-minimal-raspberrypi4.wic.bz2 | sudo dd of=/dev/sdX
sync
 Attach USB to UART debug cable to Raspberry Pi 4, plug Ethernet cable and the microSD card.
Turn on Raspberry Pi 4. Verify that the system boots successfully.
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Update Bundle
 Add to conf/local.conf:
IMAGE_INSTALL_append = " nano"
 Build a RAUC bundle:
bitbake update-bundle
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Manual RAUC Update of Raspberry Pi 4
 On the build system:
cd tmp/deploy/images/raspberrypi4/
python3 -m http.server
 On the embedded device, in this case Raspberry Pi 4:
wget http://example.com:8000/update-bundle-raspberrypi4.raucb -P /tmp
rauc install /tmp/update-bundle-raspberrypi4.raucb
reboot
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Check RAUC Status After Update
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
U-Boot Environment for RAUC
RAUC relies on the following U-Boot environment variables:
 BOOT_ORDER - a space-separated list of boot targets in the order they should be
tried
 BOOT_<bootname>_LEFT - contains the number of remaining boot attempts to
perform for the respective slot
 For details:
https://rauc.readthedocs.io/en/latest/integration.html#set-up-u-boot-environment-for-rauc
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
boot.cmd.in for RAUC & Raspberry Pi
fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
test -n "${BOOT_DEV}" || setenv BOOT_DEV "mmc 0:1"
setenv bootpart
setenv raucslot
for BOOT_SLOT in "${BOOT_ORDER}"; do
if test "x${bootpart}" != "x"; then
# skip remaining slots
elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} – 1
echo "Found valid RAUC slot A"
setenv bootpart "/dev/mmcblk0p2"
setenv raucslot "A"
setenv BOOT_DEV "mmc 0:2"
fi
elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} – 1
echo "Found valid RAUC slot B"
setenv bootpart "/dev/mmcblk0p3"
setenv raucslot "B"
setenv BOOT_DEV "mmc 0:3"
fi
fi
done
if test -n "${bootpart}"; then
setenv bootargs "${bootargs} root=${bootpart} rauc.slot=${raucslot}"
saveenv
else
echo "No valid RAUC slot found. Resetting tries to 3"
setenv BOOT_A_LEFT 3
setenv BOOT_B_LEFT 3
saveenv
reset
fi
fatload mmc 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@
if test ! -e mmc 0:1 uboot.env; then saveenv; fi;
@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Generate RAUC Certificate
Use script openssl-ca.sh from meta-rauc to to create a certificate and a key:
 The target RAUC package must use the generated keyring file
 RAUC bundle recipe must use the generated key and certificate
 For details:
https://github.com/rauc/meta-rauc/blob/master/scripts/README
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC Bundle Generator update-bundle.bb
DESCRIPTION = "RAUC bundle generator"
inherit bundle
RAUC_BUNDLE_COMPATIBLE = "RaspberryPi4"
RAUC_BUNDLE_VERSION = "v20200703"
RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle"
RAUC_BUNDLE_SLOTS = "rootfs"
RAUC_SLOT_rootfs = "core-image-minimal"
RAUC_SLOT_rootfs[fstype] = "ext4"
RAUC_KEY_FILE = "${THISDIR}/files/development-1.key.pem"
RAUC_CERT_FILE = "${THISDIR}/files/development-1.cert.pem"
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
The New Kid on the Block: NVIDIA Jetson TX2
 An example RAUC integration has been added for NVIDIA Jetson TX2:
https://github.com/rauc/meta-rauc-community/tree/master/meta-rauc-tegra
 Based on Yocto/OE BSP meta-tegra: https://github.com/OE4T/meta-tegra
 Boot flow: Cboot > U-Boot > Kernel
 Patched include/configs/p2771-0000.h through u-boot-tegra to enable RAUC
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
RAUC on NVIDIA Jetson TX2
 For the demo the U-Boot env is saved to MMC
beware of conflicts for atomic bootloader updates
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
SquashFS & Loopback Device Support
 To install RAUC bundles the kernel used on the embedded device must support
both loop block devices and the SquashFS file system
 For example in linux-tegra_%.bbappend with a kernel configuration fragment:
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://rauc.cfg"
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_DM_VERITY=y
CONFIG_SQUASHFS=y
CONFIG_CRYPTO_SHA256=y
CONFIG_SQUASHFS_FILE_DIRECT=y
SQUASHFS_DECOMP_MULTI=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Conclusions
 RAUC is a secure, reliable, free and open source framework for A/B software
updates of embedded Linux devices
 meta-rauc-community is the Yocto/OpenEmbedded layer providing RAUC
example integration on popular embedded devices
 As of the moment meta-rauc-community provides examples for Raspberry Pi,
QEMU x86-64, Allwinner (SunXi) and NVIDIA Jetson Tegra TX2
 More contributors wanted to extend the examples on more embedded devices
Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community
Thank You!
Useful links
 Software Updates with RAUC, the Yocto Project and OpenEmbedded,
Leon Anavi Yocto Project Summit 2020
https://pretalx.com/yocto-project-summit-2020/talk/JJYPH3/
 Getting Started with RAUC on Raspberry Pi, an article at konsulko.com
https://www.konsulko.com/getting-started-with-rauc-on-raspberry-pi-2/
 Behind the Scenes of an Update Framework: RAUC, Enrico Jörns, ELCE 2019
https://www.youtube.com/watch?v=ZkumnNsWczM
 Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and
Barebox
https://www.youtube.com/watch?v=hS3Fjf7fuHM
 Secure and Safe Updates for Your Embedded Device, Enrico Jörns, FOSDEM
2017
https://archive.fosdem.org/2017/schedule/event/secure_safe_embedded_updates/

More Related Content

PDF
Jenkins
PPTX
Docker 基礎介紹與實戰
PDF
Jenkins tutorial
PDF
How to Choose a Software Update Mechanism for Embedded Linux Devices
PPTX
PPTX
Introduction to jenkins
PDF
Introduction to GitHub Actions
PDF
Jenkins Pipelines
Jenkins
Docker 基礎介紹與實戰
Jenkins tutorial
How to Choose a Software Update Mechanism for Embedded Linux Devices
Introduction to jenkins
Introduction to GitHub Actions
Jenkins Pipelines

What's hot (20)

PDF
Jenkins CI
PPTX
Jenkins CI
PDF
WTF is GitOps and Why You Should Care?
PDF
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
PPTX
Jenkins presentation
PPT
Jenkins Overview
PPTX
Jenkins tutorial
PPTX
Docker introduction (1)
PDF
Docker multi-stage build
PDF
Continuous Delivery in the Cloud with Bitbucket Pipelines
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PDF
Docker Introduction
PPTX
Jenkins tutorial for beginners
PPTX
CI-Jenkins.pptx
PPTX
BitBucket presentation
PDF
Gitlab CI : Integration et Déploiement Continue
PPTX
PDF
[232] 성능어디까지쥐어짜봤니 송태웅
ODP
An Introduction To Jenkins
PDF
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
Jenkins CI
Jenkins CI
WTF is GitOps and Why You Should Care?
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
Jenkins presentation
Jenkins Overview
Jenkins tutorial
Docker introduction (1)
Docker multi-stage build
Continuous Delivery in the Cloud with Bitbucket Pipelines
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Docker Introduction
Jenkins tutorial for beginners
CI-Jenkins.pptx
BitBucket presentation
Gitlab CI : Integration et Déploiement Continue
[232] 성능어디까지쥐어짜봤니 송태웅
An Introduction To Jenkins
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
Ad

Similar to A/B Linux updates with RAUC and meta-rauc-community: now & in the future (20)

PDF
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
PDF
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
 
PDF
Why the yocto project for my io t project elc_edinburgh_2018
PPTX
Yocto Project introduction
PDF
The Yocto Project
PDF
An Introduction to the Yocto Embedded Framework 2018
 
PDF
Side by Side Comparison of Dual A/B Update Solutions with the Yocto Project
PDF
yocto_scale_handout-with-notes
PDF
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
PDF
The ultimate guide to software updates on embedded linux devices
PDF
iot_9Yocto Project getting started,,.pdf
PDF
IoT: Contrasting Yocto/Buildroot to binary OSes
PDF
[Webinar] An Introduction to the Yocto Embedded Framework
 
PDF
Exploring Open Source Dual A/B Update Solutions for Embedded Linux
PDF
Yocto Project : Custom Embedded Linux Distribution
PDF
Strategies for developing and deploying your embedded applications and images
PDF
Yocto Project Kernel Lab, Hands-On
PDF
Yocto - Embedded Linux Distribution Maker
PDF
Yocto and IoT - a retrospective
PDF
Embedded Linux Build Systems - Texas Linux Fest 2018
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
 
Why the yocto project for my io t project elc_edinburgh_2018
Yocto Project introduction
The Yocto Project
An Introduction to the Yocto Embedded Framework 2018
 
Side by Side Comparison of Dual A/B Update Solutions with the Yocto Project
yocto_scale_handout-with-notes
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
The ultimate guide to software updates on embedded linux devices
iot_9Yocto Project getting started,,.pdf
IoT: Contrasting Yocto/Buildroot to binary OSes
[Webinar] An Introduction to the Yocto Embedded Framework
 
Exploring Open Source Dual A/B Update Solutions for Embedded Linux
Yocto Project : Custom Embedded Linux Distribution
Strategies for developing and deploying your embedded applications and images
Yocto Project Kernel Lab, Hands-On
Yocto - Embedded Linux Distribution Maker
Yocto and IoT - a retrospective
Embedded Linux Build Systems - Texas Linux Fest 2018
Ad

More from Leon Anavi (20)

PDF
What Makes the Raspberry Pi 5 So Special?
PDF
Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yoc...
PDF
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
PDF
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
PDF
Как да убием и последната дискета с Open Source технологии?
PDF
Linux обновления с RAUC и Docker
PDF
Open Hardware Makers
PDF
Open Source Tools for Making Open Source Hardware
PDF
Surfing on an Interactive Kiosk
PDF
Linux дистрибуции и софтуерни обновления за вградени устройства
PDF
Getting started with AGL using a Raspberry Pi
PDF
Automotive Grade Linux on Raspberry Pi: How Does It Work?
PDF
Comparison of Open Source Software Home Automation Tools
PDF
Практични примери за device tree overlays на Raspberry Pi
PDF
The Software Developer’s Guide to Open Source Hardware
PDF
Making Open Source Hardware for Retrogaming on Raspberry Pi
PDF
Вграждане на умни гласови асистенти в устройства с Linux
PDF
Comparison of Voice Assistant SDKs for Embedded Linux Devices
PDF
Open Source MQTT Brokers
ODP
Въведение в RetroPie за Raspberry Pi
What Makes the Raspberry Pi 5 So Special?
Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yoc...
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
Как да убием и последната дискета с Open Source технологии?
Linux обновления с RAUC и Docker
Open Hardware Makers
Open Source Tools for Making Open Source Hardware
Surfing on an Interactive Kiosk
Linux дистрибуции и софтуерни обновления за вградени устройства
Getting started with AGL using a Raspberry Pi
Automotive Grade Linux on Raspberry Pi: How Does It Work?
Comparison of Open Source Software Home Automation Tools
Практични примери за device tree overlays на Raspberry Pi
The Software Developer’s Guide to Open Source Hardware
Making Open Source Hardware for Retrogaming on Raspberry Pi
Вграждане на умни гласови асистенти в устройства с Linux
Comparison of Voice Assistant SDKs for Embedded Linux Devices
Open Source MQTT Brokers
Въведение в RetroPie за Raspberry Pi

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.

A/B Linux updates with RAUC and meta-rauc-community: now & in the future

  • 1. A/B Linux updates with RAUC and meta- rauc-community: now & in the future Leon Anavi Konsulko Group leon.anavi@konsulko.com leon@anavi.org Yocto Project Summit 2021.11
  • 2. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Konsulko Group  Services company specializing in Embedded Linux and Open Source Software  Hardware/software build, design, development, and training services  Based in San Jose, CA with an engineering presence worldwide  http://konsulko.com/
  • 3. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Agenda  What is RAUC?  Integrating RAUC on new hardware  Yocto/OE layer meta-rauc-community  Examples  Conclusions  Q&A
  • 4. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community What is RAUC?  A lightweight update client that runs on an Embedded Linux device and reliably controls the procedure of A/B updating the device with a new firmware revision  Provides tool for the build system to create, inspect and modify update bundles  Uses X.509 cryptography to sign update bundles  Compatible with the Yocto Project and OpenEmbedded, PTXdist and Buildroot  Started by Pengutronix in 2015, adopted by the community and the industry
  • 5. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community How Does RAUC Work?
  • 6. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Licenses  RAUC – LGPLv2.1 https://github.com/rauc/rauc  meta-rauc - MIT https://github.com/rauc/meta-rauc  meta-rauc-community – MIT https://github.com/rauc/meta-rauc-community  rauc-hawkbit – LGPLv2.1 https://github.com/rauc/rauc-hawkbit  rauc-hawkbit-updater – LGPLv2.1 https://github.com/rauc/rauc-hawkbit-updater
  • 7. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Eclipse hawkBit  Domain independent back-end framework for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure  Written in Java  Available in GitHub under EPL-1.0 License  Compatible with RAUC and SWUpdate  https://www.eclipse.org/hawkbit/
  • 8. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Are there any RAUC open source alternatives?  Mender  SWUpdate  Swupd  UpdateHub  Balena  Snap  OSTree  Aktualizr  Aktualizr-lite  QtOTA  Torizon  FullMetalUpdate  Rpm-ostree (used in Project Atomic)
  • 9. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Common Embedded Linux Update Strategies  A/B updates with dual redundant scheme (for example: RAUC)  Delta updates  Container-based updates  Combined strategies
  • 10. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Combined Update Strategies  Container technology has changed the way application developers interact with the cloud and some of the good practices are nowadays applied to the development workflow for embedded devices and IoT  Containers make applications faster to deploy, easier to update and more secure through isolation  Yocto/OE layer meta-virtualization provides support for building Xen, KVM, Libvirt, docker and associated packages necessary for constructing OE-based virtualized solutions  There are use cases on powerful embedded devices where containers are combined with RAUC A/B updates of the base Linux distribution built with Yocto/OE
  • 11. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community  Yocto/OpenEmbedded Layers for RAUC  meta-rauc Layer for RAUC, the embedded Linux update framework  meta-rauc-community Layer with examples for integration of RAUC, the embedded Linux A/B update framework
  • 12. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community meta-rauc  Yocto/OpenEmbedded meta layer for RAUC  Supports releases Honister, Gatesgarth, Dunfell, Zeus, Warrior, Thud, Sumo, Morty, Pyro and Krogoth  Available under MIT license in GitHub: https://github.com/rauc/meta-rauc  33 contributors, the RAUC co-maintainer Enrico Jörns from Pengutronix is the leading contributor
  • 13. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community meta-rauc-community Yocto/OpenEmbedded meta layer with demo examples for integration of RAUC, the embedded Linux A/B update framework:  meta-rauc-raspberrypi: for Raspberry Pi  meta-rauc-qemux86: for QEMU (qemux86-64)  meta-rauc-sunxi: for Allwinner sunxi SoCs  meta-rauc-tegra: for NVIDIA Jetson platforms, based on L4T https://github.com/rauc/meta-rauc-community
  • 14. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Contributors  meta-rauc-community started in 2020  Moved to RAUC GitHub organization in 2021  5 contributors
  • 15. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Notable Contributions
  • 16. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Integration Steps  Select an appropriate bootloader  Enable SquashFS in the Linux kernel configurations  ext4 root file system (RAUC does not have an ext2 / ext3 file type)  Create specific partitions that match the RAUC slots  Configure Bootloader environment and create a script to switch RAUC slots  Create a certificate and a keyring to RAUC’s system.conf
  • 17. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Example with Raspberry Pi 4  Download Poky, meta-openembedded and meta-raspberrypi: git clone -b dunfell git://git.yoctoproject.org/poky poky-rpi-rauc cd poky-rpi-rauc git clone -b dunfell git://git.openembedded.org/meta-openembedded git clone -b dunfell git://git.yoctoproject.org/meta-raspberrypi  Download RAUC related layers: git clone -b dunfell https://github.com/rauc/meta-rauc.git git clone -b dunfell https://github.com/rauc/meta-rauc-community.git  Initialize the build environment: source oe-init-build-env
  • 18. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Example with Raspberry Pi 4  Add layers: bitbake-layers add-layer ../meta-openembedded/meta-oe/ bitbake-layers add-layer ../meta-openembedded/meta-python/ bitbake-layers add-layer ../meta-openembedded/meta-networking/ bitbake-layers add-layer ../meta-openembedded/meta-multimedia/ bitbake-layers add-layer ../meta-raspberrypi/ bitbake-layers add-layer ../meta-rauc bitbake-layers add-layer ../meta-rauc-community/meta-rauc-raspberrypi/
  • 19. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Example with Raspberry Pi 4  Add to local.conf: MACHINE = "raspberrypi4" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" VIRTUAL-RUNTIME_initscripts = "" IMAGE_INSTALL_append = " rauc" IMAGE_FSTYPES="tar.bz2 ext4 wic.bz2 wic.bmap" SDIMG_ROOTFS_TYPE="ext4" ENABLE_UART = "1" RPI_USE_U_BOOT = "1" PREFERRED_PROVIDER_virtual/bootloader = "u-boot" WKS_FILE = "sdimage-dual-raspberrypi.wks.in"
  • 20. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Example with Raspberry Pi 4  Build a minimal bootable image: bitbake core-image-minimal  Flash the image to a microSD card and boot it on Raspberry Pi 4: sudo umount /dev/sdX* bzcat tmp/deploy/images/raspberrypi4/core-image-minimal-raspberrypi4.wic.bz2 | sudo dd of=/dev/sdX sync  Attach USB to UART debug cable to Raspberry Pi 4, plug Ethernet cable and the microSD card. Turn on Raspberry Pi 4. Verify that the system boots successfully.
  • 21. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Update Bundle  Add to conf/local.conf: IMAGE_INSTALL_append = " nano"  Build a RAUC bundle: bitbake update-bundle
  • 22. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Manual RAUC Update of Raspberry Pi 4  On the build system: cd tmp/deploy/images/raspberrypi4/ python3 -m http.server  On the embedded device, in this case Raspberry Pi 4: wget http://example.com:8000/update-bundle-raspberrypi4.raucb -P /tmp rauc install /tmp/update-bundle-raspberrypi4.raucb reboot
  • 23. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Check RAUC Status After Update
  • 24. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community U-Boot Environment for RAUC RAUC relies on the following U-Boot environment variables:  BOOT_ORDER - a space-separated list of boot targets in the order they should be tried  BOOT_<bootname>_LEFT - contains the number of remaining boot attempts to perform for the respective slot  For details: https://rauc.readthedocs.io/en/latest/integration.html#set-up-u-boot-environment-for-rauc
  • 25. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community boot.cmd.in for RAUC & Raspberry Pi fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 test -n "${BOOT_DEV}" || setenv BOOT_DEV "mmc 0:1" setenv bootpart setenv raucslot for BOOT_SLOT in "${BOOT_ORDER}"; do if test "x${bootpart}" != "x"; then # skip remaining slots elif test "x${BOOT_SLOT}" = "xA"; then if test ${BOOT_A_LEFT} -gt 0; then setexpr BOOT_A_LEFT ${BOOT_A_LEFT} – 1 echo "Found valid RAUC slot A" setenv bootpart "/dev/mmcblk0p2" setenv raucslot "A" setenv BOOT_DEV "mmc 0:2" fi elif test "x${BOOT_SLOT}" = "xB"; then if test ${BOOT_B_LEFT} -gt 0; then setexpr BOOT_B_LEFT ${BOOT_B_LEFT} – 1 echo "Found valid RAUC slot B" setenv bootpart "/dev/mmcblk0p3" setenv raucslot "B" setenv BOOT_DEV "mmc 0:3" fi fi done if test -n "${bootpart}"; then setenv bootargs "${bootargs} root=${bootpart} rauc.slot=${raucslot}" saveenv else echo "No valid RAUC slot found. Resetting tries to 3" setenv BOOT_A_LEFT 3 setenv BOOT_B_LEFT 3 saveenv reset fi fatload mmc 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@ if test ! -e mmc 0:1 uboot.env; then saveenv; fi; @@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
  • 26. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Generate RAUC Certificate Use script openssl-ca.sh from meta-rauc to to create a certificate and a key:  The target RAUC package must use the generated keyring file  RAUC bundle recipe must use the generated key and certificate  For details: https://github.com/rauc/meta-rauc/blob/master/scripts/README
  • 27. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC Bundle Generator update-bundle.bb DESCRIPTION = "RAUC bundle generator" inherit bundle RAUC_BUNDLE_COMPATIBLE = "RaspberryPi4" RAUC_BUNDLE_VERSION = "v20200703" RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle" RAUC_BUNDLE_SLOTS = "rootfs" RAUC_SLOT_rootfs = "core-image-minimal" RAUC_SLOT_rootfs[fstype] = "ext4" RAUC_KEY_FILE = "${THISDIR}/files/development-1.key.pem" RAUC_CERT_FILE = "${THISDIR}/files/development-1.cert.pem"
  • 28. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community The New Kid on the Block: NVIDIA Jetson TX2  An example RAUC integration has been added for NVIDIA Jetson TX2: https://github.com/rauc/meta-rauc-community/tree/master/meta-rauc-tegra  Based on Yocto/OE BSP meta-tegra: https://github.com/OE4T/meta-tegra  Boot flow: Cboot > U-Boot > Kernel  Patched include/configs/p2771-0000.h through u-boot-tegra to enable RAUC
  • 29. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community RAUC on NVIDIA Jetson TX2  For the demo the U-Boot env is saved to MMC beware of conflicts for atomic bootloader updates
  • 30. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community SquashFS & Loopback Device Support  To install RAUC bundles the kernel used on the embedded device must support both loop block devices and the SquashFS file system  For example in linux-tegra_%.bbappend with a kernel configuration fragment: FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI += "file://rauc.cfg" CONFIG_MD=y CONFIG_BLK_DEV_DM=y CONFIG_BLK_DEV_LOOP=y CONFIG_DM_VERITY=y CONFIG_SQUASHFS=y CONFIG_CRYPTO_SHA256=y CONFIG_SQUASHFS_FILE_DIRECT=y SQUASHFS_DECOMP_MULTI=y CONFIG_SQUASHFS_ZLIB=y CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
  • 31. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Conclusions  RAUC is a secure, reliable, free and open source framework for A/B software updates of embedded Linux devices  meta-rauc-community is the Yocto/OpenEmbedded layer providing RAUC example integration on popular embedded devices  As of the moment meta-rauc-community provides examples for Raspberry Pi, QEMU x86-64, Allwinner (SunXi) and NVIDIA Jetson Tegra TX2  More contributors wanted to extend the examples on more embedded devices
  • 32. Yocto Project Summit 2021.11, Leon Anavi, RAUC and meta-rauc-community Thank You! Useful links  Software Updates with RAUC, the Yocto Project and OpenEmbedded, Leon Anavi Yocto Project Summit 2020 https://pretalx.com/yocto-project-summit-2020/talk/JJYPH3/  Getting Started with RAUC on Raspberry Pi, an article at konsulko.com https://www.konsulko.com/getting-started-with-rauc-on-raspberry-pi-2/  Behind the Scenes of an Update Framework: RAUC, Enrico Jörns, ELCE 2019 https://www.youtube.com/watch?v=ZkumnNsWczM  Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox https://www.youtube.com/watch?v=hS3Fjf7fuHM  Secure and Safe Updates for Your Embedded Device, Enrico Jörns, FOSDEM 2017 https://archive.fosdem.org/2017/schedule/event/secure_safe_embedded_updates/