U-boot environment: Difference between revisions

From embeddedTS Manuals
(Cleaned up formatting)
No edit summary
Line 23: Line 23:
# Remove a variable
# Remove a variable
env delete emmcboot
env delete emmcboot
</source>
For example, a to add a custom kernel cmdline option like "debug":
<source lang=bash>
env set cmdline_append 'console=ttymxc0,115200 ro init=/sbin/init debug'
env save
</source>
</source>

Revision as of 16:03, 22 February 2017

The SPI flash contains both the U-Boot executable binary and U-Boot environment. Our default build has 8KB of environment space which can be used for variables and boot scripts. The following commands are relevant to manipulating the environment:

# Print all environment variables
env print -a

# Sets the variable bootdelay to 5 seconds
env set bootdelay 5;

# Variables can also contain commands
env set hellocmd 'led red on; echo Hello world; led green on;'

# Execute commands saved in a variable
env run hellocmd;

# Commit env changes to the spi flash
# Otherwise changes are lost
env save

# Restore env to default
env default -a

# Remove a variable
env delete emmcboot