Skip to contentSkip to conversation

Package to manage multiple buildroot filesystem "versions"?

Buildroot Tudor Holton 2 participants 2 messages Aug 25, 2021

lore
Share & tools
lore
#0 lore raw

Hi all,

I understand that buildroot is for building root filesystems and not really outside that, but...

Is there a package that can manage the partition layout, and buildroot filesystem "versions", for upgrade and fallback?

For example, something like:

1) During build, allocate space for 2 or more partitions, the first partition is the running buildroot filesystem
2) When the buildroot filesystem is running, download a newer version of the filesystem, verify it, and dd it to the second partition
3) Tell grub/EFI to boot the newer partition and reboot
BUT
4a) It doesn't complete the startup for some reason (like there's a kernel panic, or something doesn't start properly triggering the watchdog) SO
5a) It reboots again, calling the previous version (e.g. using grub fallback or fallback.efi)
OR
4b) It does complete the startup, but some important service doesn't work (like it can't connect to the internet) so we presume we need to roll back 5B) It rolls back to the previous version with some kind of failure flag to tell the server that it failed the upgrade

I can see that this could be fairly easily written, but I was wondering if there was a buildroot package or environment that does this kind of behaviour already?

Cheers,
Tudor.
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#1 lore raw

Hello Tudor,

Quoted 27 lines · On Wed, 25 Aug 2021 17:08:16 +1000 Tudor Holton <[email protected]> wrote:

I understand that buildroot is for building root filesystems and not really outside that, but...

Is there a package that can manage the partition layout, and buildroot filesystem "versions", for upgrade and fallback?

For example, something like:

1) During build, allocate space for 2 or more partitions, the first partition is the running buildroot filesystem
2) When the buildroot filesystem is running, download a newer version of the filesystem, verify it, and dd it to the second partition
3) Tell grub/EFI to boot the newer partition and reboot
BUT
4a) It doesn't complete the startup for some reason (like there's a kernel panic, or something doesn't start properly triggering the watchdog)
SO
5a) It reboots again, calling the previous version (e.g. using grub fallback or fallback.efi)
OR
4b) It does complete the startup, but some important service doesn't work (like it can't connect to the internet) so we presume we need to roll back
5B) It rolls back to the previous version with some kind of failure flag to tell the server that it failed the upgrade

Quoted 3 lines

I can see that this could be fairly easily written, but I was wondering if there was a buildroot package or environment that does this kind of behaviour already?

You are re-inventing the concept of OTA update systems. Check out:

* swupdate, https://sbabic.github.io/swupdate/

* RAUC, https://rauc.readthedocs.io/en/latest/

* Mender, https://mender.io/

All three are packaged in Buildroot.

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot