
Dear Rasmus,
In message 2676be2b-2e4f-7aba-14e6-5659174ad011@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