View Source Nerves.Runtime.Init (nerves_runtime v0.13.3)

GenServer that handles device initialization.

Initialization currently consists of:

  1. Mounting the application partition
  2. If the application partition can't be mounted, format it, and then mount it.

Device initialization is usually a first boot only operation. It's possible that device filesystems get corrupt enough to cause them to be reinitialized. Since corruption should be rare, Nerves systems create firmware images without formatting the application partition. This has the benefit of exercising the corruption repair code. It's also required since some filesystem types can only be formatted on device.

Long format times can be problematic in manufacturing. If this is an issue, see if you can use F2FS since it formats much faster than ext4. Some devices have also had stalls when formatting while waiting for enough entropy to generate a UUID. Look into hardcoding UUIDs or enabling a hw random number generator to increase entropy.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

init_application_partition()

View Source
@spec init_application_partition() ::
  :mounted | :mounted_with_error | :noop | :unmounted
@spec start_link(any()) :: GenServer.on_start()