nerves_runtime v0.9.0 Nerves.Runtime
Nerves.Runtime contains functions useful for almost all Nerves-based devices.
Link to this section Summary
Types
Options for Nerves.Runtime.revert/1
Functions
Run system command and log output into logger
Halt the device (meaning hang, not power off, nor reboot)
Power off the device
Reboot the device and gracefully shutdown the Erlang VM
Revert the device to running the previous firmware
Link to this section Types
revert_options()
revert_options() :: {:reboot, boolean()}
revert_options() :: {:reboot, boolean()}
Options for Nerves.Runtime.revert/1.
:reboot- CallNerves.Runtime.reboot/0after reverting (defaults totrue)
Link to this section Functions
cmd(cmd, params, out)
cmd(binary(), [binary()], :debug | :info | :warn | :error | :return) ::
{Collectable.t(), exit_status :: non_neg_integer()}
cmd(binary(), [binary()], :debug | :info | :warn | :error | :return) :: {Collectable.t(), exit_status :: non_neg_integer()}
Run system command and log output into logger.
halt()
halt() :: no_return()
halt() :: no_return()
Halt the device (meaning hang, not power off, nor reboot).
Note: this is different than :erlang.halt(), which exits BEAM, and may end up
rebooting the device if erlinit.config settings allow reboot on exit.
poweroff()
poweroff() :: no_return()
poweroff() :: no_return()
Power off the device.
This calls :init.stop/0 internally. If :init.stop/0 takes longer than the
erlinit.config's --graceful-powerdown setting (likely 10 seconds) then
the system will be hard rebooted.
reboot()
reboot() :: no_return()
reboot() :: no_return()
Reboot the device and gracefully shutdown the Erlang VM.
This calls :init.stop/0 internally. If :init.stop/0 takes longer than the
erlinit.config's --graceful-powerdown setting (likely 10 seconds) then
the system will be hard rebooted.
revert(opts \\ [])
revert([revert_options()]) :: :ok | {:error, reason :: any()}
revert([revert_options()]) :: :ok | {:error, reason :: any()}
Revert the device to running the previous firmware.
This requires a specially constructed fw file.