The Thistle Update Client fully supports A/B full filesystem updates. We abstracted the interaction with different bootloader through 2 simple scripts - one is used to tell the bootloader to attempt a boot on the newly updated partition, and another one to confirm that the boot was successful (latch-in update).
In order for the Update Client to integrate with the full filesystem update, it is required to configure the two partitions that will be used in the context of A/B update.In addition, 2 scripts are needed. One script will be used to switch the root filesystem partition to the newly updated one upon reboot. The other script will be used to lock-in the update once the device has booted successfully.
The Raspberry Pi bootloader supports A/B updates through the use of the “try_cmdline” parameter in the kernel command line. Here is an example of the 2 scripts used to integrate with the Raspberry Pi bootloader. Note that these two scripts need to be executable.This first script switches the root filesystem partition to the other one once the update is applied. It also reboots the device to apply the change.
Copy
Ask AI
#!/bin/bashTARGET_PART=$1cd /boot/firmware# amend cmdline to switch root partitionsudo cp cmdline.txt try_cmdline.txtsudo sed -i "s|root=[^ ]*|root=${TARGET_PART}|" try_cmdline.txt# set set try_cmdline in tryboot.txt configsudo cp config.txt tryboot.txtif grep -q "^cmdline=" tryboot.txt; then sudo sed -i 's/^cmdline=.*/cmdline=try_cmdline.txt/' tryboot.txtelse echo "cmdline=try_cmdline.txt" >> tryboot.txtfisudo reboot "0 tryboot"
The second script confirms that the boot was successful by copying back the original command line file.
If you need assistance with bootloader integration or have questions about your specific setup, please don’t hesitate to reach out in our discord channel - we would be more than happy to hear about your bootloader setup and help with integration!