From: Matthias Fuchs Date: Wed, 13 Feb 2008 09:21:38 +0100 Subject: [U-Boot-Users] Delete all env vars except read onlys In-Reply-To: <200802121549.49402.sr@denx.de> References: <200802120944.42632.matthias.fuchs@esd-electronics.com> <200802121549.49402.sr@denx.de> Message-ID: <200802130921.38894.matthias.fuchs@esd-electronics.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefan, what about a 'scrubenv' or 'cleanenv' command that tries to unset all variables leaving readonlys untouched. The command could request a confirmation: => scrubenv Do you really want to do this ('yes' or 'no')? yes Can't overwrite "serial#" Can't overwrite "ethaddr" => saveenv The above output is faked. So I did not start coding :-) What do you think? Matthias On Tuesday 12 February 2008 15:49, Stefan Roese wrote: > Hi Matthias, > > On Tuesday 12 February 2008, Matthias Fuchs wrote: > > I am wondering if there is a way to delete all environment variables > > but not the readonly ones. The common way to delete all variables > > is to make the environment CRC invalid an do a reset. After reset > > a saveenv saves a default environment. > > > > What I want to do is to delete all variables (preferable from an autoscr > > script) but not the vendor variables like serial# and eth?addr. > > > > Wildcards in the setenv parameters would solve this issue, > > but chars like '*' or '?' are valid chars for environment variables. > > > > Any idea? > > I don't know of such a solution. But such a "feature" would be handy > sometimes. So perhaps this needs to get implemented as a new U-Boot command. > But you should be careful. Such a command should require probably a password, > to that users don't unintentionally erase their environment. > > Best regards, > Stefan