[U-Boot-Users] RFC: hidden environment variables
Scott Wood
scottwood at freescale.com
Mon Apr 23 21:49:38 CEST 2007
On Mon, Apr 23, 2007 at 03:28:12PM -0400, Ben Warren wrote:
> On Mon, 2007-04-23 at 11:46 -0500, Timur Tabi wrote:
> > The only drawback to this plan is that, after modifying a hidden environment variable, the
> > user would need to be told to issue "saveenv" if he wants his changes saved permanently.
> >
> This is a pretty serious drawback.
In the use case we're thinking of (non-probeable jumper/dip-switch/etc.
settings that are managed through a "hwoption" command), I don't think
it's that unreasonable to require the user to saveenv after making
changes if they want the change to persist across a reset.
> If you really want to have persistent storage for autonomous code,
> maybe we should look at a way of allocating a block of persistent
> storage (either flash or serial EEPROM) outside of ENV that gets saved
> when modified.
Possibly, though whatever form it takes should be createable by build
scripts the way an environment is.
> > One advantage of this feature is that we can develop new commands
> > that store data permanently without having to add hooks into
> > _do_setenv().
> >
> I guess I don't see why anything needs to be hidden. If somebody has
> access to the U-boot prompt, they control the board anyway. From my
> perspective, it's for expert use only.
It's not a security mechanism; it's to emphasize that the public
interface to the functionality is the command, not the variable. That
way, people don't access the variable directly from scripts, and complain
that it breaks if the storage format changes.
All the information in the variable can be viewed and/or modified by
going through the command that uses it.
-Scott
More information about the U-Boot
mailing list