[U-Boot-Users] Delete all env vars except read onlys

Detlev Zundel dzu at denx.de
Wed Feb 13 12:13:08 CET 2008


Hi,

> Stefan Roese <sr at denx.de> writes:
>
>> On Wednesday 13 February 2008, Markus Klotzbücher wrote:
>>> > => scrubenv
>>> > Do you really want to do this ('yes' or 'no')? yes
>>>
>>> Such a confirmation is not very Unix-like and will prevent this command
>>> to be used in scripts. I like the idea of a scrubenv/resetenv command
>>> but vote for leaving out the confirmation.
>>>
>>> U-Boot provides many, much more serious ways to blow you foot off which
>>> don't ask such questions.
>>
>> Sure. But not by "just" typing one command. Or at least I don't know those 
>> kind of destructive commands.
>
> It need not be a single one, it could be a script. For instance, I once
> ran an "update" script without checking that _my_ version of U-Boot
> would be used. It used some ancient version which turned the board
> (temporarily) into a doorstop.
>
> Stupid? Yes! But would such checks (e.g. to "mw") have avoided the
> problem?  I doubt it. Probably I'd just have typed "yes" without
> checking.
>
> BTW, after accidentally erasing the environment variables U-Boot will
> (likely) still start up, so it's really not that critical, is it?

Why not do both?  Unix untilities do it sometimes this way: Use an
interactive check for "scrubenv" but allow "scrubenv -force" not to
ask.  As many of the U-Boot users know Unix, this would follow from the
"principle of least surprise"...

Cheers
  Detlev

-- 
Progress in  mathematics comes from  repeated acts of generalization.
If mathematics is anything, it is the art of chosing the most elegant
generalization for some abstract pattern.  Thus esthetics is central.
                                     -- Douglas Hofstadter
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de




More information about the U-Boot mailing list