SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
How to Choose a Software Update
Mechanism for Embedded Linux Devices
Leon Anavi
Konsulko Group
leon.anavi@konsulko.com
leon@anavi.org
Embedded Linux Conference North America 2022
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
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/
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Agenda
 Things to consider
 Common embedded Linux update strategies
 Open source solutions
 Practical examples with Yocto/OpenEmbedded
 Conclusions
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Things to Consider: Update Size
 Are there any limitations of the disk space?
 Are there any limitations of the network bandwidth for the data transfer?
 According to cable.co.uk in the US
the average cost of mobile data is
$3.33 per 1GB
https://www.cable.co.uk/mobiles/worldwide-data-pricing/
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Things to Consider: Data Transfer
What are the different ways of transferring data for the updates?
 Over the air using WiFi or cellular data
 Ethernet cable
 USB stick
 Something else
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Things to Consider: Managing Devices
 Do you need to update a single device or multiple devices?
 Are all of devices using the same software stack?
 Are all devices online and do you need to monitor the update of the devices?
 Do you need to update different devices at different times?
 How to update fleet of devices?
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Things to Consider: Building Images
 What distribution and build system do you use?
 Is there a BSP for the hardware you use?
 Is the software update technology compatible with the build system and the BSP?
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Build Frameworks for Embedded Linux Distro
Popular open source build systems for custom embedded Linux distributions:
 Yocto/OpenEmbedded
 Buildroot
 PTXdist
 OpenWRT
 Other
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Can I just use Debian?
 Debian is a stable full distribution with tens of thousands of packages available as
binary files for installation without the need to cross-compile from source
 Numerous Debian derivatives exist for embedded devices
 Debian or Yocto Project? Which is the Best for your Embedded Linux Project?
Chris Simmonds, Embedded Linux Conference Europe 2019
https://www.youtube.com/watch?v=iDllXa8SzUgr
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
The Yocto Project
 Open source collaborative project of the Linux foundation for creating custom
Linux-based systems for embedded devices using the OpenEmbedded Build
System
 OpenEmbedded Build System includes BitBake and OpenEmbedded Core
 Poky is a reference distribution of the Yocto Project provided as metadata, without
binary files, to bootstrap your own distribution for embedded devices
 Bi-annual release cycle
 Long term support (LTS) release covering two-year period
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Common Embedded Linux Update Strategies
 A/B updates (dual redundant scheme)
 Delta updates
 Container-based updates
 Combined strategies
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
A/B Upgrades
 Dual A/B identical rootfs partitions
 Data partition for storing any persistent data which is left unchanged during the
update process
 Typically a client application runs on the embedded device and periodically
connects to a server to check for updates
 If a new software update is available, the client downloads and installs it on the
other partition
 Fallback in case of update failure
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Delta Updates
 Only the binary delta between the difference is sent to the embedded device
 Works in a Git-like model for filesystem trees
 Saves storage space and connection bandwidth
 Rollback of the system to a previous state
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
A/B vs Delta Updates
Update
Strategy
Storage Space Update Size Rollback to a
Previous Stage
Fallback to a
Back-up Image
on separate
partition
A/B Updates Large Large Yes Yes
Delta Updates Small Small Yes No
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Container-based Updates
 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 Linux devices and Internet of Things
 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
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Combined Strategies
Multiple combinations exist for more complicated use cases, for example:
 A/B updates with delta updates
 Containers with A/B updates of the base custom embedded Linux distribution
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Popular open source solution for updates
 Mender
 RAUC
 SWUpdate
 Swupd
 UpdateHub
 Balena
 Snap
 libostree (OSTree)
 Aktualizr
 Aktualizr-lite
 QtOTA
 Torizon
 FullMetalUpdate
 Rpm-ostree (used in Project Atomic)
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender
 Available as a free open source or paid commercial/enterprise plans
 A/B update scheme for open source and all plans as well as delta updates for
professional and enterprise plans
 Back-end services (Hosted Mender)
 Written in Go, Python, JavaScript
 Yocto/OE integration through meta-mender and extra BSP layers:
https://github.com/mendersoftware/meta-mender
 Source code in GitHub under Apache 2.0
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender Supported Devices
The following hardware platforms and development boards are supported:
 Raspberry Pi
 BeagleBone
 Intel x86-64
 Rockchip
 Allwinner
 NXP
 And more in: https://github.com/mendersoftware/meta-mender-community
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
meta-mender-community
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
RAUC
 A lightweight update client that runs on an Embedded Linux device and reliably
controls the procedure of updating the device with a new firmware revision
 Supports multiple update scenarios
 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, PTXdist and Buildroot
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
RAUC Licenses
 RAUC – LGPLv2.1
https://github.com/rauc/rauc
 meta-rauc - MIT
https://github.com/rauc/meta-rauc
 rauc-hawkbit – LGPLv2.1
https://github.com/rauc/rauc-hawkbit
 rauc-hawkbit-updater – LGPLv2.1
https://github.com/rauc/rauc-hawkbit-updater
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
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 matches 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
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
RAUC Data Partition
 Supports single and redundant data partitions
 For redundant data partitions the active rootfs slot has to mount the correct data
partition dynamically, for example with a udev rule
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
meta-rauc-community
 Yocto/OE layer with examples how to integrate RAUC on various machines
 Started in 2020
 Moved to the RAUC organization in GitHub in 2021
 Currently supports x86-64, QEMU, Raspberry Pi through meta-raspberrypi, Sunxi
(Allwinner) devices through meta-sunxi, NVIDIA Jetson TX2 through meta-tegra
 https://github.com/rauc/meta-rauc-community/
Contributions are always welcome as GitHub pull requests!
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
RAUC Example with Raspberry Pi 4
 Integration layer (branch Dunfell):
https://github.com/rauc/meta-rauc-community/tree/master/meta-rauc-raspberrypi
 Add layers to bblayers.conf and add the following configuration 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"
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Manual RAUC Update of Raspberry Pi 4
 On the build system:
cd tmp/deploy/images/raspberrypi4/
python3 -m http.server
 On the embedded device:
wget http://example.com:8000/update-bundle-raspberrypi4.raucb -P /tmp
rauc install /tmp/update-bundle-raspberrypi4.raucb
reboot
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
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/
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender
Mender A/B updates supports two client modes:
 Managed (default) - client running as a daemon polls the server for updates
 Standalone - updates are triggered locally which is suitable for physical media or
any network update in pull mode
SYSTEMD_AUTO_ENABLE_pn-mender = "disable"
$ cd tmp/deploy/images/raspberrypi4
$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
$ mender -install http://example.com:8000/core-image-base-raspberrypi4.mender
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender Data Partition
 Mender creates a /data partition to store persistent data, preserved during
Mender updates. Supports ext4, Btrfs and F2FS file systems.
 The Mender client on the embedded devices uses /data/mender to preserve data
and state across updates
 Variable MENDER_DATA_PART_SIZE_MB configures the size of the /data
partition. By default it is 128 MB. If enabled, mender feature mender-growfs-
data which relies on systemd-growfs tries to resize on first boot with the
remaining free space
 It is possible to create an image for the data partition in advance with bitbake:
IMAGE_FSTYPES:append = " dataimg"
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender
Steps to install Mender A/B update on embedded Device:
 Apply update
 Reboot
 On the first boot after a successful update, though the Mender client a commit
must be performed to accept the update (otherwise the system will roll-back
on next reboot)
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender Single File Artifact
 Deployment of a single file, directory or even a container image is possible
through “Application updates”
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender add-ons
Mender supports several add-ons:
 Remote Terminal - interactive shell sessions with full terminal emulation
 File Transfer - upload and download files to and from a device
 Port Forward - forward any local port to a port on a device without opening
ports on the device
 Configure - apply configuration to your devices through a uniform interface
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender with x86-64 support
 Mender added support for x86-64 machines through GRUB in 2018
 Initial installation of the distribution is most commonly done using a live image on
a USB stick
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Mender Delta Updates
 Mender offers robust delta update rootfs as a module for the commercial Mender
plan (closed source implementation)
 Requires reboot to apply the update
 Supports rollback
 Tool mender-binary-delta create a binary delta by comparing 2 different Mender
artifacts
 Mandatory requirement for the implementation is a read-only root file system
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Read-only Root Filesystem
Yocto and OpenEmbedded offer two options to create a read-only root filesystem:
 Thought the image’s recipe file:
IMAGE_FEATURES += "read-only-rootfs"
 Alternatively, through local.conf:
EXTRA_IMAGE_FEATURES = "read-only-rootfs"
 Beware, there might be packages in the image that expect the root filesystem to
be writable and might not function properly. A solution is to move these files and
directories to the data partition.
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Combined Strategies with Containers
 Yocto/OE layer meta-virtualization provides support for building Xen, KVM,
Libvirt, docker and associated packages necessary for constructing OE-based
virtualized solutions
 virtualization has to be added to the DISTRO_FEATURES:
DISTRO_FEATURES:append = " virtualization"
 For example adding Docker to the embedded Linux distribution is easy:
IMAGE_INSTALL:append = " docker-ce"
 There are use cases on powerful embedded devices where containers are
combined with A/B updates of the base Linux distribution built with Yocto/OE, for
example with RAUC or Mender
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
libostree
 Libostree (previously known as “OSTree”), is a shared library and tools for
distributing and deploying file system images as atomic upgrades of the whole file
system tree
 Provides a suite of command line tools that combines a “git-like” model for
committing and downloading bootable filesystem trees, along with a layer for
deploying them and managing the bootloader configuration.
 Effective with respect to disk space and connection bandwidth
 Supports rollback of the system to a previous state
 Used in many embedded Linux solutions: Fedora IoT, Torizon, Aktualizr, Aktualizr-
lite and QtOTA
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
libostree
 libostree encourages systems to implement UsrMove
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
 libostree comes with optional dracut+systemd integration:
https://ostreedev.github.io/ostree/adapting-existing/
 libostree only preserves /var across upgrades
 /var is empty by default and the operating system needs to dynamically create the
targets of these at boot, for example with systemd-tmpfiles (if using systemd)
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Aktualizr and Aktualizr-lite with libostree
 Aktualizr is a C++ application that implements the client-side functionality for OTA
Connect according to the Uptane security framework
 libaktualizr provides API calls to perform the various steps that are necessary for
checking for updates, validating the files downloaded, etc
https://github.com/advancedtelematic/aktualizr
 Aktualizr-lite is a C++ implementation of TUF OTA update client based on aktualizr
without the complexity of Uptane
https://github.com/foundriesio/aktualizr-lite
 Yocto/OE integration:
https://github.com/advancedtelematic/meta-updater
https://github.com/foundriesio/meta-lmp
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Conclusion
 There are numerous things to consider when implementing an upgrade
mechanism for an embedded Linux device
 There are many reliable open source software solutions to upgrade embedded
Linux devices to use and worth developing another proprietary homegrown
solution
 Combined update strategies such as A/B upgrades with containers for
applications are increasingly popular nowadays
 The update process implementation depends on the build system and the
bootloader
 Often real-world solutions require a persistent data partition which is left
unchanged during the update process
ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices
Thank You!
Useful links:
 https://www.yoctoproject.org/
 https://mender.io/
 https://rauc.io/
 https://ostreedev.github.io/ostree/
 https://www.konsulko.com/building-platforms-with-secure-ove
r-the-air-updating/
 https://www.konsulko.com/how-mender-works/
 https://www.konsulko.com/getting-started-with-rauc-on-raspb
erry-pi-2/

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
WebRTC と Native とそれから、それから。
WebRTC と Native とそれから、それから。 WebRTC と Native とそれから、それから。
WebRTC と Native とそれから、それから。
 
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
 
Building images efficiently and securely on Kubernetes with BuildKit
Building images efficiently and securely on Kubernetes with BuildKitBuilding images efficiently and securely on Kubernetes with BuildKit
Building images efficiently and securely on Kubernetes with BuildKit
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
GPU Virtualization in Embedded Automotive Solutions
GPU Virtualization in Embedded Automotive SolutionsGPU Virtualization in Embedded Automotive Solutions
GPU Virtualization in Embedded Automotive Solutions
 
[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?
 
Yocto Project ハンズオン プレゼン用資料
Yocto Project ハンズオン プレゼン用資料Yocto Project ハンズオン プレゼン用資料
Yocto Project ハンズオン プレゼン用資料
 
レシピの作り方入門
レシピの作り方入門レシピの作り方入門
レシピの作り方入門
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep Dive
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
最近のOpenStackを振り返ってみよう
最近のOpenStackを振り返ってみよう最近のOpenStackを振り返ってみよう
最近のOpenStackを振り返ってみよう
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 

Semelhante a How to Choose a Software Update Mechanism for Embedded Linux Devices

An Introduction To Linux Development Environment
An Introduction To Linux Development EnvironmentAn Introduction To Linux Development Environment
An Introduction To Linux Development Environment
S. M. Hossein Hamidi
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
oscon2007
 
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
Integrating VNC in Weston with the Yocto Project and OpenEmbeddedIntegrating VNC in Weston with the Yocto Project and OpenEmbedded
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
Leon Anavi
 
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
Edge AI and Vision Alliance
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community Update
Linaro
 

Semelhante a How to Choose a Software Update Mechanism for Embedded Linux Devices (20)

Dedicated embedded linux af Esben Haabendal, Prevas A/S
Dedicated embedded linux af Esben Haabendal, Prevas A/SDedicated embedded linux af Esben Haabendal, Prevas A/S
Dedicated embedded linux af Esben Haabendal, Prevas A/S
 
Modern IoT and Embedded Linux Deployment - Berlin
Modern IoT and Embedded Linux Deployment - BerlinModern IoT and Embedded Linux Deployment - Berlin
Modern IoT and Embedded Linux Deployment - Berlin
 
Linux internals v4
Linux internals v4Linux internals v4
Linux internals v4
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
Preparations for koha implementation
Preparations for koha implementationPreparations for koha implementation
Preparations for koha implementation
 
Software update for embedded systems
Software update for embedded systemsSoftware update for embedded systems
Software update for embedded systems
 
Yocto vs. Debian white paper
Yocto vs. Debian white paperYocto vs. Debian white paper
Yocto vs. Debian white paper
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
 
Online lg prodect
Online lg prodectOnline lg prodect
Online lg prodect
 
MinGw Compiler
MinGw CompilerMinGw Compiler
MinGw Compiler
 
An Introduction To Linux Development Environment
An Introduction To Linux Development EnvironmentAn Introduction To Linux Development Environment
An Introduction To Linux Development Environment
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
 
ERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projectsERTS 2008 - Using Linux for industrial projects
ERTS 2008 - Using Linux for industrial projects
 
.Net Migration
.Net Migration .Net Migration
.Net Migration
 
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
Integrating VNC in Weston with the Yocto Project and OpenEmbeddedIntegrating VNC in Weston with the Yocto Project and OpenEmbedded
Integrating VNC in Weston with the Yocto Project and OpenEmbedded
 
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community Update
 
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
 The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
 

Mais de Leon Anavi

Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства
Leon Anavi
 

Mais de Leon Anavi (20)

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

Último

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Último (20)

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 

How to Choose a Software Update Mechanism for Embedded Linux Devices

  • 1. How to Choose a Software Update Mechanism for Embedded Linux Devices Leon Anavi Konsulko Group leon.anavi@konsulko.com leon@anavi.org Embedded Linux Conference North America 2022
  • 2. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices 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. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Agenda  Things to consider  Common embedded Linux update strategies  Open source solutions  Practical examples with Yocto/OpenEmbedded  Conclusions
  • 4. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Things to Consider: Update Size  Are there any limitations of the disk space?  Are there any limitations of the network bandwidth for the data transfer?  According to cable.co.uk in the US the average cost of mobile data is $3.33 per 1GB https://www.cable.co.uk/mobiles/worldwide-data-pricing/
  • 5. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Things to Consider: Data Transfer What are the different ways of transferring data for the updates?  Over the air using WiFi or cellular data  Ethernet cable  USB stick  Something else
  • 6. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Things to Consider: Managing Devices  Do you need to update a single device or multiple devices?  Are all of devices using the same software stack?  Are all devices online and do you need to monitor the update of the devices?  Do you need to update different devices at different times?  How to update fleet of devices?
  • 7. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Things to Consider: Building Images  What distribution and build system do you use?  Is there a BSP for the hardware you use?  Is the software update technology compatible with the build system and the BSP?
  • 8. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Build Frameworks for Embedded Linux Distro Popular open source build systems for custom embedded Linux distributions:  Yocto/OpenEmbedded  Buildroot  PTXdist  OpenWRT  Other
  • 9. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Can I just use Debian?  Debian is a stable full distribution with tens of thousands of packages available as binary files for installation without the need to cross-compile from source  Numerous Debian derivatives exist for embedded devices  Debian or Yocto Project? Which is the Best for your Embedded Linux Project? Chris Simmonds, Embedded Linux Conference Europe 2019 https://www.youtube.com/watch?v=iDllXa8SzUgr
  • 10. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices The Yocto Project  Open source collaborative project of the Linux foundation for creating custom Linux-based systems for embedded devices using the OpenEmbedded Build System  OpenEmbedded Build System includes BitBake and OpenEmbedded Core  Poky is a reference distribution of the Yocto Project provided as metadata, without binary files, to bootstrap your own distribution for embedded devices  Bi-annual release cycle  Long term support (LTS) release covering two-year period
  • 11. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Common Embedded Linux Update Strategies  A/B updates (dual redundant scheme)  Delta updates  Container-based updates  Combined strategies
  • 12. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices A/B Upgrades  Dual A/B identical rootfs partitions  Data partition for storing any persistent data which is left unchanged during the update process  Typically a client application runs on the embedded device and periodically connects to a server to check for updates  If a new software update is available, the client downloads and installs it on the other partition  Fallback in case of update failure
  • 13. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Delta Updates  Only the binary delta between the difference is sent to the embedded device  Works in a Git-like model for filesystem trees  Saves storage space and connection bandwidth  Rollback of the system to a previous state
  • 14. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices A/B vs Delta Updates Update Strategy Storage Space Update Size Rollback to a Previous Stage Fallback to a Back-up Image on separate partition A/B Updates Large Large Yes Yes Delta Updates Small Small Yes No
  • 15. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Container-based Updates  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 Linux devices and Internet of Things  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
  • 16. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Combined Strategies Multiple combinations exist for more complicated use cases, for example:  A/B updates with delta updates  Containers with A/B updates of the base custom embedded Linux distribution
  • 17. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Popular open source solution for updates  Mender  RAUC  SWUpdate  Swupd  UpdateHub  Balena  Snap  libostree (OSTree)  Aktualizr  Aktualizr-lite  QtOTA  Torizon  FullMetalUpdate  Rpm-ostree (used in Project Atomic)
  • 18. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender  Available as a free open source or paid commercial/enterprise plans  A/B update scheme for open source and all plans as well as delta updates for professional and enterprise plans  Back-end services (Hosted Mender)  Written in Go, Python, JavaScript  Yocto/OE integration through meta-mender and extra BSP layers: https://github.com/mendersoftware/meta-mender  Source code in GitHub under Apache 2.0
  • 19. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Supported Devices The following hardware platforms and development boards are supported:  Raspberry Pi  BeagleBone  Intel x86-64  Rockchip  Allwinner  NXP  And more in: https://github.com/mendersoftware/meta-mender-community
  • 20. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices meta-mender-community
  • 21. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices RAUC  A lightweight update client that runs on an Embedded Linux device and reliably controls the procedure of updating the device with a new firmware revision  Supports multiple update scenarios  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, PTXdist and Buildroot
  • 22. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices RAUC Licenses  RAUC – LGPLv2.1 https://github.com/rauc/rauc  meta-rauc - MIT https://github.com/rauc/meta-rauc  rauc-hawkbit – LGPLv2.1 https://github.com/rauc/rauc-hawkbit  rauc-hawkbit-updater – LGPLv2.1 https://github.com/rauc/rauc-hawkbit-updater
  • 23. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices 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 matches 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
  • 24. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices RAUC Data Partition  Supports single and redundant data partitions  For redundant data partitions the active rootfs slot has to mount the correct data partition dynamically, for example with a udev rule
  • 25. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices meta-rauc-community  Yocto/OE layer with examples how to integrate RAUC on various machines  Started in 2020  Moved to the RAUC organization in GitHub in 2021  Currently supports x86-64, QEMU, Raspberry Pi through meta-raspberrypi, Sunxi (Allwinner) devices through meta-sunxi, NVIDIA Jetson TX2 through meta-tegra  https://github.com/rauc/meta-rauc-community/ Contributions are always welcome as GitHub pull requests!
  • 26. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices RAUC Example with Raspberry Pi 4  Integration layer (branch Dunfell): https://github.com/rauc/meta-rauc-community/tree/master/meta-rauc-raspberrypi  Add layers to bblayers.conf and add the following configuration 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"
  • 27. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Manual RAUC Update of Raspberry Pi 4  On the build system: cd tmp/deploy/images/raspberrypi4/ python3 -m http.server  On the embedded device: wget http://example.com:8000/update-bundle-raspberrypi4.raucb -P /tmp rauc install /tmp/update-bundle-raspberrypi4.raucb reboot
  • 28. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices 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/
  • 29. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Mender A/B updates supports two client modes:  Managed (default) - client running as a daemon polls the server for updates  Standalone - updates are triggered locally which is suitable for physical media or any network update in pull mode SYSTEMD_AUTO_ENABLE_pn-mender = "disable" $ cd tmp/deploy/images/raspberrypi4 $ python3 -m http.server Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... $ mender -install http://example.com:8000/core-image-base-raspberrypi4.mender
  • 30. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Data Partition  Mender creates a /data partition to store persistent data, preserved during Mender updates. Supports ext4, Btrfs and F2FS file systems.  The Mender client on the embedded devices uses /data/mender to preserve data and state across updates  Variable MENDER_DATA_PART_SIZE_MB configures the size of the /data partition. By default it is 128 MB. If enabled, mender feature mender-growfs- data which relies on systemd-growfs tries to resize on first boot with the remaining free space  It is possible to create an image for the data partition in advance with bitbake: IMAGE_FSTYPES:append = " dataimg"
  • 31. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Steps to install Mender A/B update on embedded Device:  Apply update  Reboot  On the first boot after a successful update, though the Mender client a commit must be performed to accept the update (otherwise the system will roll-back on next reboot)
  • 32. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Single File Artifact  Deployment of a single file, directory or even a container image is possible through “Application updates”
  • 33. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender add-ons Mender supports several add-ons:  Remote Terminal - interactive shell sessions with full terminal emulation  File Transfer - upload and download files to and from a device  Port Forward - forward any local port to a port on a device without opening ports on the device  Configure - apply configuration to your devices through a uniform interface
  • 34. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender with x86-64 support  Mender added support for x86-64 machines through GRUB in 2018  Initial installation of the distribution is most commonly done using a live image on a USB stick
  • 35. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Mender Delta Updates  Mender offers robust delta update rootfs as a module for the commercial Mender plan (closed source implementation)  Requires reboot to apply the update  Supports rollback  Tool mender-binary-delta create a binary delta by comparing 2 different Mender artifacts  Mandatory requirement for the implementation is a read-only root file system
  • 36. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Read-only Root Filesystem Yocto and OpenEmbedded offer two options to create a read-only root filesystem:  Thought the image’s recipe file: IMAGE_FEATURES += "read-only-rootfs"  Alternatively, through local.conf: EXTRA_IMAGE_FEATURES = "read-only-rootfs"  Beware, there might be packages in the image that expect the root filesystem to be writable and might not function properly. A solution is to move these files and directories to the data partition.
  • 37. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Combined Strategies with Containers  Yocto/OE layer meta-virtualization provides support for building Xen, KVM, Libvirt, docker and associated packages necessary for constructing OE-based virtualized solutions  virtualization has to be added to the DISTRO_FEATURES: DISTRO_FEATURES:append = " virtualization"  For example adding Docker to the embedded Linux distribution is easy: IMAGE_INSTALL:append = " docker-ce"  There are use cases on powerful embedded devices where containers are combined with A/B updates of the base Linux distribution built with Yocto/OE, for example with RAUC or Mender
  • 38. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices libostree  Libostree (previously known as “OSTree”), is a shared library and tools for distributing and deploying file system images as atomic upgrades of the whole file system tree  Provides a suite of command line tools that combines a “git-like” model for committing and downloading bootable filesystem trees, along with a layer for deploying them and managing the bootloader configuration.  Effective with respect to disk space and connection bandwidth  Supports rollback of the system to a previous state  Used in many embedded Linux solutions: Fedora IoT, Torizon, Aktualizr, Aktualizr- lite and QtOTA
  • 39. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices libostree  libostree encourages systems to implement UsrMove https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/  libostree comes with optional dracut+systemd integration: https://ostreedev.github.io/ostree/adapting-existing/  libostree only preserves /var across upgrades  /var is empty by default and the operating system needs to dynamically create the targets of these at boot, for example with systemd-tmpfiles (if using systemd)
  • 40. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Aktualizr and Aktualizr-lite with libostree  Aktualizr is a C++ application that implements the client-side functionality for OTA Connect according to the Uptane security framework  libaktualizr provides API calls to perform the various steps that are necessary for checking for updates, validating the files downloaded, etc https://github.com/advancedtelematic/aktualizr  Aktualizr-lite is a C++ implementation of TUF OTA update client based on aktualizr without the complexity of Uptane https://github.com/foundriesio/aktualizr-lite  Yocto/OE integration: https://github.com/advancedtelematic/meta-updater https://github.com/foundriesio/meta-lmp
  • 41. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Conclusion  There are numerous things to consider when implementing an upgrade mechanism for an embedded Linux device  There are many reliable open source software solutions to upgrade embedded Linux devices to use and worth developing another proprietary homegrown solution  Combined update strategies such as A/B upgrades with containers for applications are increasingly popular nowadays  The update process implementation depends on the build system and the bootloader  Often real-world solutions require a persistent data partition which is left unchanged during the update process
  • 42. ELC 2022, Leon Anavi, How to Choose a Software Update Mechanism for Embedded Linux Devices Thank You! Useful links:  https://www.yoctoproject.org/  https://mender.io/  https://rauc.io/  https://ostreedev.github.io/ostree/  https://www.konsulko.com/building-platforms-with-secure-ove r-the-air-updating/  https://www.konsulko.com/how-mender-works/  https://www.konsulko.com/getting-started-with-rauc-on-raspb erry-pi-2/