U-boot env in binary format

Simon Glass sjg at chromium.org
Wed Nov 1 21:22:11 CET 2023


Hi Simon,

On Tue, 31 Oct 2023 at 17:07, SIMON BABY <simonkbaby at gmail.com> wrote:
>
> Hello ,
> Can I know if I could generate uboot env file in binary format as part of my build process ?
> Currently it generate as a text file .

There is the tools/mkenvimage program:

mkenvimage [-h] [-r] [-b] [-p <byte>] -s <environment partition size>
-o <output> <input file>

This tool takes a key=value input file (same as would a `printenv'
show) and generates the corresponding environment image, ready to be
flashed.

The input file is in format:
key1=value1
key2=value2
...
Empty lines are skipped, and lines with a # in the first
column are treated as comments (also skipped).
-r : the environment has multiple copies in flash
-b : the target is big endian (default is little endian)
-p <byte> : fill the image with <byte> bytes instead of 0xff bytes
-V : print version information and exit

If the input file is "-", data is read from standard input

You can build with 'make u-boot-initial-env' to get a tool called
printinitialenv to run, which emits the environment. Or you can look
in include/generated/ to see the env files from the build.

If you would like to send a documentation patch, it could go here:

https://u-boot.readthedocs.io/en/latest/usage/environment.html

(in the source tree this is doc/usage/environment.html)

Regards,
Simon


More information about the U-Boot mailing list