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

Ulf Samuelsson ulf at atmel.com
Wed Feb 20 22:30:02 CET 2008


>> >
>> > After a longish  discussion  with  Detlev  we  came  up  with  a  new
>> > proposal,  which  hopefully  is  acceptable  to all. We agreed that a
>> > command name like "clearenv" or "scrubenv" or similar (which  doesn't
>> > require  any  arguments) might be too dangerous for the unexperienced
>> > user why randomly types commands "just  to  see  what  happens".  For
>> > example,  even  if you type "erase" it will not do any damage because
>> > arguments are missing - but "erase all" will blow away most  of  your
>> > flash content without asking.
>> >
>> > So the idea is to call the new command "environment" (or short "env");
>> > usage would be then:
>> >
>> > => env clear
>> >
>> > to clear the envrionment (except read-only variables); thsi also
>> > allows for pretty useful additional functionality like this:
>> >
>> > => env default
>> >
>> > to reset the environment to the (compiled in) default settings.
>> >

I see this as essential and have implemented this in my own u-boot.
I call it "defenv".

It is a little different though, It will reinitialize the predefined environment
variables to default settings but will not touch the other.

If "env default" is implemented the same way, then you could get a 
100% clean environment by:

env clear ; env default

What will "env" do without parameters?




Best Regards
Ulf Samuelsson






More information about the U-Boot mailing list