Skip to content

env: Add support for environment files

Wolfgang Denk u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest3 of 5 patches 0 repliesNew

3 of 5 patches are in this archive. The cover letter announces 5.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
3/5Allow U-Boot scripts to be placed in a .env file+0 -01 reply
3/5Allow U-Boot scripts to be placed in a .env file+0 -01 reply
3/5Allow U-Boot scripts to be placed in a .env file+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 0/5] env: Add support for environment files

Dear Simon,

Quoted 9 lines · In message <[email protected]> you wrote:

(Note that Wolfgang is looking at a way of adjusting the environment within a U-Boot binary - this series could fit with that but aims to improve the creation of the initial default environment).

At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot.

I think we need to be very clear hear about what these patches are actually doing. Many users might easily confise the default environment that gets statically built into the U-Boot binary (and that cannot be changed at runtime) with the working environment that gets saved to some persistent storage and is loaded when booting.

This is especially important as there are boards where, depending on which state of the boot process you are in, one or the other mightbe in effect (there used to be boards, and probably still are, where full environment access was not possible in the SPL [or whatever it was named then], so you were using the default settings initially, and the real environment only later - which can be extremely confusing - just think of thigs like console baudrate settings etc.

Quoted 4 lines

This series adds a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/<vendor>/env directory called <board>.env (or common.env if you want the same environment for all boards for that vendor).

I understand these patches are trying to improve the way how we initialize the CONFIG_EXTRA_ENV_SETTINGS setting in the _default_ environment _at build time_, right? I feel this should be made really clear in both the Subject: and in the commit message.

Hm... what was your reason for stopping half-way? Setting only CONFIG_EXTRA_ENV_SETTINGS this way seems inconsequent to me. Why do we not initialize the whole default environment like this?

Quoted 3 lines

The environment variables should be of the form "var=value". Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example.

I am afraid I dislike the current proposal - see comments to that patch.

Quoted 2 lines

After discussion on the mailing list the .emv file was moved from include/configs to board/. See here:

".emv"? Guess this is a typo?

Quoted 3 lines

Another discussion was compatibility with the environment commands 'env export -t' and 'env import -t'. This series permits these to be used and the environment is exported and imported as expected. I have dropped

I can't see how this would work - the examples given in yout README patch definitely cannot be imported using "env import -t", which is the reason why I dislike the proposed format.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"In Christianity neither morality nor religion come into contact with
reality at any point."                          - Friedrich Nietzsche