[U-Boot-Users] RFC: hidden environment variables

Scott Wood scottwood at freescale.com
Mon Apr 23 22:28:51 CEST 2007


Wolfgang Denk wrote:
> In message <462CE302.7030302 at freescale.com> you wrote:
> 
>>I'd like to propose a new feature for U-Boot: hidden environment variables.  These are 
>>variables that are stored in environment but are normally not visible to the user. 
>>Specifically, a hidden environment variable would have these properties:
> 
> 
> Why would you want to hide them?

To provide internal storage for functionality (in this case, a command 
to manage non-probeable jumpers and such) without exposing the storage 
format.

> * You cannot really "hide" information; for example, I often use the
>   "md" command to dump the environmentsector(s).

We're not trying to hide information; it'll all be available through the 
hwoption command anyway.

> * Your users would probably just change the code to unhide these
>   variables. Speaking for me - if I was running such a system that
>   would be one of the first things I'd change.

Sure, but then it'd be their fault if we need/want to change the storage 
format and their scripts were directly accessing the environment 
variable, and break.

It's not hugely necessary, but in general it's nicer to expose an API 
rather than a data structure where practical.  If we were to instead 
document the variable as being for internal use only (possibly 
emphasizing it with a name such as hwoptions_internal_dont_touch or 
something), would that be considered a sufficient warning that we 
wouldn't have to maintain compatibility at the environment level in the 
future, and wouldn't have to hook into setenv to make the resulting 
device tree changes if the user ignored the warning and did a setenv anyway?

> If you think about dynamically configuring U-Boot, there is  probably
> another  route  to  go  -  device  trees.  Did you happen to read the
> related discussion on #mklinux a few days ago?

Indeed, that's a potential reason to change the storage format, if we 
end up wanting to move the data into a dtb instead.

-Scott




More information about the U-Boot mailing list