Environment

U-Boot configuration and startup behaviour is defined in its environment and therein held variables. While the environment’s default values are pre-defined in source, these setteings and values can be overwritten by editing the respecitive variables, either for short term till the next reboot or permantly by writing the changed values into area in the permanent memory (NVM: NAND or eMMC). Which in turn will loaded at boot time.

Comprehensive description of these features is available in the The U-Boot Documentation, there specifically in the Environment Variables section.

Reset of Variables

Users can reset the environment as a whole, or can reset just specific variables. Selectively resetting variables can be used to access variables or environment settings that have been updated or added between releases.

To unset an environment variable the same common procedure as setting is used; but instead setting it to an empty string.

Warning

As long as the command saveenv is not executed, changes to the environment will be lost with the next reset. In development this should be the preferred method.

Examples:

  • Unset variable

    unset apppend_bootargs (set empty string)

    setenv apppend_bootargs
    saveenv
    
  • Reset whole environment

    env default -a
    saveenv
    
  • Reset specific variable

    env default <*variable*>
    saveenv
    

    e.g. resetting fdtsave

    env default fdtsave
    save
    

    Note

    Resetting a variable that’s not part of the compiled in default environment will be deleted, accompanied by the following message: WARNING: '<variable>' not in imported env, deleting it!