Nerves.Firmware v0.4.0 Nerves.Firmware.Fwup

A Port interface to stream firmware to fwup

Example usage file = File.read!(/path/to/my.fw) {:ok, pid} = Nerves.Firmware.Fwup.start_link([device: “/tmp/test.img”, task: “complete”]) Nerves.Firmware.Fwup.stream_chunk(pid, file, await: true) Nerves.Firmware.Fwup.stop

Summary

Functions

apply(input, device, task, args \\ [])
apply(String.t, String.t, String.t, [binary]) ::
  :ok |
  {:error, term}

Apply the firmware in to the given , executing .

args is a list of arguments to be passed to fwup.

Not implemented using ports, because ports cant send EOF, so it’s not possible to stream firmware through a port. Porcelain doesn’t work because goon isn’t easy to compile for the target in Nerves.

The simple file-based I/O allows using named pipes to solve the streaming issues.

start_link(opts \\ [])
stop(pid)
stream_chunk(pid, chunk, opts \\ [await: false])