View Source Nerves.Runtime.Init (nerves_runtime v0.13.7)
GenServer that handles device initialization.
Initialization currently consists of:
- Mounting the application partition
- 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.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec init_application_partition() ::
:mounted | :mounted_with_error | :noop | :unmounted
@spec start_link(any()) :: GenServer.on_start()