From: Wolfgang Denk Date: Wed, 13 Feb 2008 23:38:28 +0100 Subject: [U-Boot-Users] Delete all env vars except read onlys In-Reply-To: Your message of "Wed, 13 Feb 2008 09:21:38 +0100." <200802130921.38894.matthias.fuchs@esd-electronics.com> Message-ID: <20080213223828.EA17524050@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <200802130921.38894.matthias.fuchs@esd-electronics.com> you wrote: > > what about a 'scrubenv' or 'cleanenv' command that tries to unset all > variables leaving readonlys untouched. Make this "clearenv", please. > The command could request a confirmation: No. > => scrubenv > Do you really want to do this ('yes' or 'no')? yes No. Such code will not go into U-Boot. "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn > Can't overwrite "serial#" > Can't overwrite "ethaddr" I would not print such messages, especially since you aren't overwriting these. If you want, print a similar warning as used by the "erase" command for protected flash sectors, i. e. something like: => cleanenv Warning: 5 protected variables will not be cleared => > What do you think? Looks good to me... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Voodoo Programming: Things programmers do that they know shouldn't work but they try anyway, and which sometimes actually work, such as recompiling everything. - Karl Lehenbauer