[PATCH] env: introduce CONFIG_ENV_DOTVARS_TEMPORARY

Wolfgang Denk wd at denx.de
Tue Jan 21 18:16:26 CET 2020


Dear Rasmus,

In message <2676be2b-2e4f-7aba-14e6-5659174ad011 at prevas.dk> you wrote:
>
> > This is not a good idea. The decision whether a variable shall be
> > stored permanently or not, or wheter it is readonly or writable, and
> > other such properties should never based on their name. 
> 
> Sorry, but what other property of the variable could possibly determine
> those things, then?

Such properties are stored in the .flags settings, see env/flags.c

>  There may
> > be many good reasons that some .name variable _shall_ be persistent.
> 
> Sure, absolutely. Which is why this is entirely opt-in for those who
> know they won't need that, but do have some semi-complicated script that
> interacts with various commands that return their output via an
> environment variable.

This has been discussed several times before (for example in the
context of UEFI persistance handling); it should be implemented
using the existing .flags mechanism.

> Ah, now I see how  env_flags_varaccess is actually implemented,
> involving a .flags special variable. OK, then I can certainly see why
> one would not want that to be excluded from the environment - I just
> thought the idea behind "printenv" hiding dot-variables by default was
> that those were considered temporary, and not special in this way.

Not only that, .flags is exactly the mechanism that should be used
to implement what you want.

> So, would you accept introducing env_flags_varaccess_temporary, for
> which I could then add tmp_.*:st ?

Please look up the last discussion of this topic; see the thread
"efi_loader: implementing non-volatile UEFI variables" starting
here:

https://lists.denx.de/pipermail/u-boot/2019-June/373503.html

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
Anyone who knows history, particularly the history of Europe, will, I
think, recognize that the domination of education or of government by
any one particular religious faith is never a happy  arrangement  for
the people.                                       - Eleanor Roosevelt


More information about the U-Boot mailing list