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

Wolfgang Denk wd at denx.de
Mon Apr 23 23:51:58 CEST 2007


In message <462D1703.9000907 at freescale.com> you wrote:
>
> > 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.

What would be bad about this? If I want to know the format, I just
look it up in the source code. You cannot hide that.

> > * 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.

So why making it unnecessarily complicated?

> 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.

There are many ways to break a board. If you feel that this is a
likely case, you should try and make sure you either not chage the
format or only in compatible ways.

But seriously: if youy write in the docs: Don't  mess  with  variable
XXX,  and  they  do, is their fault in exactly the same way like when
they mess with the source code. Where's the difference?

> 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?

Yes. Because you cannot stop idiots anyway. So please do't make  life
harder than absolutely necessary for clever users.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
This cultural mystique surrounding the  biological  function  --  you
realize humans are overly preoccupied with the subject.
	-- Kelinda the Kelvan, "By Any Other Name", stardate 4658.9




More information about the U-Boot mailing list