NAME¶
apex-env - user-mode access to APEX flash environment
SYNOPSIS¶
apex-env COMMAND [
ARGS ... ]
DESCRIPTION¶
apex-env is a utility for viewing and modifying the environment used by
the APEX Boot Loader to define how the system will boot. APEX has a predefined
set of environment variables, determined by the build-time configuration, that
control operation of the boot loader.
Embedded in the APEX image is a linking structure that
apex-env uses to
identify the boot loader image and to locate information about the environment
variables as well as the flash region that holds the user-modified values. If
APEX is built without enabling this user-modifiable flash region,
apex-env will only allow the user to browse the variables and the
default values.
apex-env depends on the
/dev/mtd driver to locate the APEX. It
first looks for a partition named 'Loader', but it will also check the first
partition in case APEX is used as the primary boot loader.
The user may need root privileges to run
apex-env, even when only reading
the environment.
COMMANDS¶
- describe [KEY]
- Displays a description of KEY or descriptions of every environment
variable is KEY is omitted.
- dump
- Displays the contents of the flash environment region in a
hexadecimal/ASCII format useful for troubleshooting.
- eraseenv
- Clears the environment region by setting all of the bytes to 0xff. Use
this command with care. Assuming that APEX was properly built for your
system, it still relies on the caching feature of the MTD block driver to
modify only a portion of a flash eraseblock. Be mindful that interrupting
this command after the block is erased and before the important data has
been restored could render the system unbootable.
- printenv [KEY]
- Displays the value of KEY or the values of every environment
variable if KEY is omitted. The separator between the key and the
value is =* for default values or just = when the default value has been
overridden by a value saved in the flash environment.
- setenv KEY VALUE
- Overrides the default value of KEY with VALUE. Use quoting
to prevent the shell from splitting VALUE into separate words and
from interpolation.
- unsetenv KEY
- Restores the default value of KEY by marking any value stored in
flash as deleted.
EXAMPLES¶
- apex-env printenv
- Show all of the environment variables and the current values for each.
- apex-env setenv startup 'copy $kernelsrc $bootaddr ; boot'
- Change the startup variable to copy the kernel and immediately boot.
- apex-env dump | head
- Examine the first few bytes of the environment data.
AUTHOR¶
Marc Singer <elf@debian.org>