lawik

lawik

Nerves Core Team

Nerves, fwup and NervesHub have had delta updates as a feature on the checklist for a long time. A delta update being essentially a patch you send to update the binary data on a device instead of sending all the desired data. It can be way more efficient in terms of bandwidth. We use xdelta3 for the binary diffing.

The delta support has been kind of gnarly though. In several important ways they were best-effort and whether they worked or not was dependent on what fwup features you used and how you used them. If you used disk encryption it was a no-go.

Thanks to work at SmartRent we now get fully functional delta updates that understand way more about what the heck you are doing with your firmware. And you don’t really need to think about it very much. Just turn on Delta updates for your deployment and if you have a compatible setup you should get the advantages. This is all on main in nerves_hub and you get it if you run the latest tag for the container or similar.

There are still updates we can do to Nerves systems to make delta updates apply to a larger part of the system. Currently they tend to apply to the rootfs.

A bunch of things needed to be lined up to make this happen:

  • NervesHub needed to get smarter about generating the delta packages to understand whether an update was possible. Is the version of fwup high enough? Does this archive have support for deltas at all? Does it use disk encryption and does the delta update respect that?
  • fwup needed to provide a combination of the disk encryption feature and the delta update feature. Awesome job by @fhunleth :sparkles:

fwup uses the libconfuse format for config files so as part of this I made a kind of rough library for dealing with those files, I call it confuse. A bunch of nimble_parsec and then some really helpful functionality to interpret the structure based on fwup usage and conventions. Most of the smarts around deltas for NervesHub live in confuse.

fwup itself does not know how to create a delta firmware archive, maybe it should but currently it does not. So NervesHub becomes the reference implementation so even if you want to use another delivery mechanism you can yoink the functionality out of it.

NervesHub will create deltas for the files that have the relevant delta options applied and other files will be provided in full.

For an extreme case where we just bumped the version number we actually saw a delta update down in the kilobytes for a firmware that was 90Mb. In reality it will vary significantly. One usually mild trade-off is that applying the firmware will likely take longer due to compression and the procedure of reading and patching the existing data to write to the new partition.

You can try this on NervesCloud already as we run very recent versions. Feel free to weigh in with questions in this thread or elsewhere.

Where Next? Top

Trending in News & Updates Top

sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
kip
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
bartblast
I’ll be using this thread to share Hologram patch release announcements. Minor releases will continue to get dedicated threads with blog ...
New
bartblast
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now,...
New
nseaSeb
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex. What’s new: synonyms You can now declare a synonym dictionary per lang...
New
mudasobwa
MdexMultilineCells is an MDEx plugin enabling multi-line cells in Markdown tables with full inline/block Markdown rendering and automati...
New
sorenone
This release unifies configuration for queues, repos, and services, swaps opaque timing integers for readable durations, and backports pe...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews