Raspberry Pi 4
Getting started with Thistle OTA Update on Raspberry Pi 4
This guide will show you how to get started on the Raspberry Pi 4 platform to perform a rootfs update. This guide uses an image directly generated by Thistle Yocto Build. You can follow along with our video guide as well.
Tools needed
To get started you need to obtain:
- The Thistle Release Helper to help packaging your updates
- A project access token from the Thistle App
- A Raspberry Pi 4 and an SD card (> 4GB)
- Our full disk image as well as the update disk image
sudo rpi-eeprom-update -a
using the official rpios image.Raspberry Pi setup
To get started simply download and copy the full image onto the SD card - for instance using dd
or using the Raspberry Pi imager tool. Once the copy is performed, insert the SD card on the Raspberry Pi and test it’s functional. The user is thistle
and the password is raspberry
.
thistle
and the password is raspberry
.Create an update bundle
For the purpose of this example, we will release the update image as an update. This image will be deployed with the Release Helper, and will be installed on the target automatically by the Update Client.
Let’s start with packaging the update:
Signing an update bundle with a key in KMS
If one does not want to manage a local signing key, a Thistle-managed, Cloud
KMS-backed
ECDSA-P256 key can be used to sign OTA update bundles. Add option
--signing-method="remote"
to all the above trh
commands to use this remotely
managed signing key. For example,
Amend device configuration for bootloader
The Thistle Update Client natively supports the Raspberry Pi
bootloader. The only step required is to specify the
bootloader as RaspberryPi
and the two partitions that will be used as root
filesystem alternatively. Amend your configuration using the snippet below as
the SD card partitions were specified during the image generation.
It is now required to push config.json
onto the Raspberry Pi, this can be done
using scp
or using a USB key. This is necessary so that we can run the update
client on the Raspberry Pi. Under normal circumstances, this operation will be
performed automatically during e.g. the image personalization step of a deploy
pipeline.
Test deployed release
We can now test our deployed release. Note that as the assets will be downloaded from the Thistle Backend Server, an internet connection is required.
Let’s apply the update and see the result.
The Raspberry Pi will now reboot. Login again and confirm that the appropriate partition is now the root partition.
More options
This tutorial shows how to manually perform an update on the Raspberry Pi. This process can be automated to update a fleet of devices. In this regards, we support different enrollment setups, either based on Trust On First Use (TOFU), or only accepting pre-enrolled devices.
- Support for pre & post install scripts
- Incremental updates via file updates
- OTA bundle signing using external signing tools