View Source UBootEnv (uboot_env v1.0.1)

UBootEnv reads and writes U-Boot environment blocks

It's like the commandline tools fw_setenv and fw_printenv except in pure Elixir. It also uses /etc/fw_env.config by default to figure out where the environment exists so that you need not store the configuration in two places.

Link to this section Summary

Functions

Load the U-Boot environment configuration

Read the U-Boot environment into a map or key value pairs

Read the U-Boot environment into a map or key value pairs

Write a map of key value pairs to the U-Boot environment

Write a map of key-value pairs to the U-Boot environment

Link to this section Functions

@spec configuration() :: {:ok, UBootEnv.Config.t()} | {:error, atom()}

Load the U-Boot environment configuration

This is returns the default U-Boot environment configuration from "/etc/fw_env.config". If you do not want this, see UBootEnv.Config.from_file/1 or UBootEnv.Config.from_string/1 for creating or loading a custom configuration.

@spec read() :: {:ok, map()} | {:error, reason :: atom()}

Read the U-Boot environment into a map or key value pairs

The configuration from "/etc/fw_env.config" is used to find the location of the environment block. See read/1 for specifying a custom location.

@spec read(UBootEnv.Config.t()) :: {:ok, map()} | {:error, atom()}

Read the U-Boot environment into a map or key value pairs

@spec write(map()) :: :ok | {:error, reason :: atom()}

Write a map of key value pairs to the U-Boot environment

The configuration from "/etc/fw_env.config" is used to find the location of the environment block. See write/2 for specifying a custom location.

@spec write(map(), UBootEnv.Config.t()) :: :ok | {:error, atom()}

Write a map of key-value pairs to the U-Boot environment