Firmware deltas
How NervesHub delivers bandwidth-efficient partial firmware updates: what a delta is, how it's generated, and what devices need to use them.
Written By Josh Kalderimis
Last updated About 2 months ago
A firmware delta is a partial update containing only the difference between two firmware versions, instead of a full image. Devices download far less data, which matters a lot on cellular and other constrained or metered networks.
Why deltas
A full .fw image can be tens of megabytes. If a release only changes part of the system, most of that download is bytes the device already has. A delta ships just the changed blocks, so a small change becomes a small download. Nothing about the safety guarantees changes: the resulting firmware is still signed and verified the same way.
How they're generated
When a device is due to update from a known source firmware to a target firmware, NervesHub can generate a delta between the two using fwup and xdelta3:
A delta is tied to a specific source β target pair.
Generation happens on the server. Each delta has a status while it's produced:
processing, thencompleted,failed, ortimed_out.NervesHub tracks each delta's size against the source and target so you can see the savings.
If a delta can't be produced for a given pair, NervesHub falls back to sending the full firmware, so updates still succeed.
What's required
Deltas need cooperation from a few places:
The firmware must be delta-updatable. This is a property of how the firmware is built; NervesHub records whether a given firmware supports deltas.
The device's tooling must support it. Applying a delta needs a compatible
fwupon the device. NervesHub tracks the tool version a delta requires.The deployment group must allow deltas. Deployment groups have a delta updatable setting (on by default). See Deployment groups & releases.
When all three line up, matching devices receive a delta; otherwise they receive the full image.
Trade-offs
Big win: much smaller downloads, especially for incremental releases over expensive networks.
Cost: deltas are generated per source/target pair and take server-side work to produce. The first device updating from a new source may wait for generation; later devices on the same pair reuse the completed delta.