Firmware formats
NervesHub picks an update tool for each file from the file’s contents, not its name.
The three experimental formats need NervesHub 2.5.0 or later. Each has to be enabled for the instance and then allowed for the product. See feature prerequisites.
The rest of this section describes fwup firmware on a Nerves device running
nerves_hub_link.
The path of an update
1
You upload signed firmware
You build a
.fw file, sign it, and upload it to a product. NervesHub verifies the signature against your organization’s signing keys. It reads the firmware’s metadata: product, version, platform, architecture and UUID. NervesHub 2.5.0 and later also store a SHA-256 checksum of the file and one of each 1 MiB part.2
A release makes it the target
You create a release in a deployment group. Devices in the group that are not on that firmware become due for it. You can also send one device a specific version from its page in the web UI.If the group has delta updates on, NervesHub first builds deltas from the firmware its devices are running.
3
NervesHub offers the update
NervesHub offers the update to connected devices at the pace the group’s rollout controls allow. A device that connects later is offered it then.The offer is an
update message on the device’s WebSocket. It carries a signed, time-limited URL for the file, the target firmware’s metadata, and, from NervesHub 2.5.0, the file’s size and checksums. The URL points at the delta when the device qualifies for one, and at the full file otherwise.A device in device-managed mode is not sent the offer. It asks for it instead.4
The device decides
nerves_hub_link first checks that it holds a public key to verify the firmware with. If it has none, it refuses the update.It then calls update_available/1 on your Client module. Your code returns :apply, :ignore, or a request to be asked again later. The default applies every update.5
The device downloads and applies
The configured updater downloads the file over HTTPS and hands it to
fwup, which verifies the signature and writes the firmware to the inactive slot. The default updater streams the download straight into fwup.The device reports download and install progress to NervesHub as it goes, and passes each fwup message to your Client.6
The device reboots and reports back
When
fwup finishes, the device reports the update as completed and reboots. After it reconnects, it reports the firmware it is now running and whether that firmware has been validated.If the device reverted to the previous firmware, it reports that too.What you configure on the device
All of these are optional. A device with only connection settings takes every update it is offered.How fwup is invoked
nerves_hub_link runs fwup with the upgrade task against the device’s firmware block device. These settings change that:
The block device is read from the
nerves_fw_devpath key in the device’s Nerves key-value store when nerves_hub_link starts.

