U-boot env in binary format

Simon Glass sjg at chromium.org
Sat Nov 4 20:44:09 CET 2023


On Wed, 1 Nov 2023 at 18:58, SIMON BABY <simonkbaby at gmail.com> wrote:
>
> Thanks Simon.
> I will try this command. By any chance how do I find the environment partition size in my target?

(please do try to avoid top-posting on the ML, and keep the ML copied)

I think this depends on your platform, but you might find the
information in the fixed-partitions node in the devicetree?


- Simon

>
> Regards
> Simon
>
> On Wed, Nov 1, 2023 at 1:22 PM Simon Glass <sjg at chromium.org> wrote:
>>
>> 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