* [U-Boot-Users] Delete all env vars except read onlys @ 2008-02-12 8:44 Matthias Fuchs 2008-02-12 14:49 ` Stefan Roese 2008-02-12 22:38 ` Wolfgang Denk 0 siblings, 2 replies; 36+ messages in thread From: Matthias Fuchs @ 2008-02-12 8:44 UTC (permalink / raw) To: u-boot Hi, 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? Matthias ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-12 8:44 [U-Boot-Users] Delete all env vars except read onlys Matthias Fuchs @ 2008-02-12 14:49 ` Stefan Roese 2008-02-12 22:55 ` Wolfgang Denk 2008-02-13 8:21 ` Matthias Fuchs 2008-02-12 22:38 ` Wolfgang Denk 1 sibling, 2 replies; 36+ messages in thread From: Stefan Roese @ 2008-02-12 14:49 UTC (permalink / raw) To: u-boot 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 ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-12 14:49 ` Stefan Roese @ 2008-02-12 22:55 ` Wolfgang Denk 2008-02-13 8:21 ` Matthias Fuchs 1 sibling, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-12 22:55 UTC (permalink / raw) To: u-boot In message <200802121549.49402.sr@denx.de> you wrote: > > 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. Please don't do passwords in U-Boot (btw - it might be difficult, as the logical way to store these would be in the environment :-) 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 Conscious is when you are aware of something, and conscience is when you wish you weren't. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-12 14:49 ` Stefan Roese 2008-02-12 22:55 ` Wolfgang Denk @ 2008-02-13 8:21 ` Matthias Fuchs 2008-02-13 8:56 ` Stefan Roese ` (2 more replies) 1 sibling, 3 replies; 36+ messages in thread From: Matthias Fuchs @ 2008-02-13 8:21 UTC (permalink / raw) To: u-boot 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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 8:21 ` Matthias Fuchs @ 2008-02-13 8:56 ` Stefan Roese 2008-02-13 9:18 ` Matthias Fuchs 2008-02-13 10:02 ` Markus Klotzbücher 2008-02-13 22:38 ` Wolfgang Denk 2 siblings, 1 reply; 36+ messages in thread From: Stefan Roese @ 2008-02-13 8:56 UTC (permalink / raw) To: u-boot Hi Matthias, On Wednesday 13 February 2008, Matthias Fuchs wrote: > what about a 'scrubenv' or 'cleanenv' command that tries to unset all > variables leaving readonlys untouched. Or 'resetenv'? > 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 Yes, I was just thinking (while showering, no joke) about this and had the same idea with an 'yes' check. :) > The above output is faked. So I did not start coding :-) > > What do you think? Looks good to me. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 8:56 ` Stefan Roese @ 2008-02-13 9:18 ` Matthias Fuchs 0 siblings, 0 replies; 36+ messages in thread From: Matthias Fuchs @ 2008-02-13 9:18 UTC (permalink / raw) To: u-boot Hi Stefan, On Wednesday 13 February 2008 09:56, Stefan Roese wrote: > Hi Matthias, > > On Wednesday 13 February 2008, Matthias Fuchs wrote: > > what about a 'scrubenv' or 'cleanenv' command that tries to unset all > > variables leaving readonlys untouched. > > Or 'resetenv'? All the same to me with the name. As always it will be the most complicated part. I have to remember the 'ethrotate' variable :-) > > > 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 > > Yes, I was just thinking (while showering, no joke) about this and had the > same idea with an 'yes' check. :) Do not get into details :-) > > > The above output is faked. So I did not start coding :-) > > > > What do you think? > > Looks good to me. I put it on my list. Matthias ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 8:21 ` Matthias Fuchs 2008-02-13 8:56 ` Stefan Roese @ 2008-02-13 10:02 ` Markus Klotzbücher 2008-02-13 10:13 ` Stefan Roese 2008-02-13 22:38 ` Wolfgang Denk 2 siblings, 1 reply; 36+ messages in thread From: Markus Klotzbücher @ 2008-02-13 10:02 UTC (permalink / raw) To: u-boot Matthias Fuchs <matthias.fuchs@esd-electronics.com> writes: > 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 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. Best regards Markus Klotzbuecher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 10:02 ` Markus Klotzbücher @ 2008-02-13 10:13 ` Stefan Roese 2008-02-13 10:33 ` Markus Klotzbücher 2008-02-13 22:40 ` Wolfgang Denk 0 siblings, 2 replies; 36+ messages in thread From: Stefan Roese @ 2008-02-13 10:13 UTC (permalink / raw) To: u-boot 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. So I still would like to see the extra check. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 10:13 ` Stefan Roese @ 2008-02-13 10:33 ` Markus Klotzbücher 2008-02-13 11:13 ` Detlev Zundel 2008-02-13 22:40 ` Wolfgang Denk 1 sibling, 1 reply; 36+ messages in thread From: Markus Klotzbücher @ 2008-02-13 10:33 UTC (permalink / raw) To: u-boot Stefan Roese <sr@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? Just my 2c. Best regards Markus -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 10:33 ` Markus Klotzbücher @ 2008-02-13 11:13 ` Detlev Zundel 2008-02-13 12:55 ` Markus Klotzbücher 2008-02-13 22:43 ` Wolfgang Denk 0 siblings, 2 replies; 36+ messages in thread From: Detlev Zundel @ 2008-02-13 11:13 UTC (permalink / raw) To: u-boot Hi, > Stefan Roese <sr@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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 11:13 ` Detlev Zundel @ 2008-02-13 12:55 ` Markus Klotzbücher 2008-02-13 12:58 ` Stefan Roese 2008-02-13 22:43 ` Wolfgang Denk 1 sibling, 1 reply; 36+ messages in thread From: Markus Klotzbücher @ 2008-02-13 12:55 UTC (permalink / raw) To: u-boot Detlev Zundel <dzu@denx.de> writes: >> Stefan Roese <sr@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"... Yeah, why not both. That's fine with me! Best regards Markus Klotzb?cher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 12:55 ` Markus Klotzbücher @ 2008-02-13 12:58 ` Stefan Roese 0 siblings, 0 replies; 36+ messages in thread From: Stefan Roese @ 2008-02-13 12:58 UTC (permalink / raw) To: u-boot On Wednesday 13 February 2008, Markus Klotzb?cher wrote: > > 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"... > > Yeah, why not both. That's fine with me! Yes, I like it too. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 11:13 ` Detlev Zundel 2008-02-13 12:55 ` Markus Klotzbücher @ 2008-02-13 22:43 ` Wolfgang Denk 2008-02-13 22:49 ` Scott Wood 1 sibling, 1 reply; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 22:43 UTC (permalink / raw) To: u-boot In message <m23arxun23.fsf@ohwell.denx.de> you wrote: > > 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"... That would be exactly the other way round, i. e. provide an optional "-i" argument like "rm *" is doing in Unix. The default shall be not to ask any questions. 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 They say, well, meybe it _is_ smelly, maybe it _is_ overcrowded, may- be it _is_ a bit like Hell would be if they shut the fires off and stabled a herd of incontinent cows there for a year, but you must admit that it is full of sheer, vibrant, dynamic _life_. - Terry Pratchett, _Moving Pictures_ ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 22:43 ` Wolfgang Denk @ 2008-02-13 22:49 ` Scott Wood 2008-02-13 23:03 ` Wolfgang Denk 0 siblings, 1 reply; 36+ messages in thread From: Scott Wood @ 2008-02-13 22:49 UTC (permalink / raw) To: u-boot Wolfgang Denk wrote: > In message <m23arxun23.fsf@ohwell.denx.de> you wrote: >> 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"... > > That would be exactly the other way round, i. e. provide an optional > "-i" argument like "rm *" is doing in Unix. > > The default shall be not to ask any questions. rm defaults to not asking questions in *some* cases, but to asking in others. Hence the -f flag to rm. -Scott ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 22:49 ` Scott Wood @ 2008-02-13 23:03 ` Wolfgang Denk 2008-02-13 23:04 ` Scott Wood 0 siblings, 1 reply; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 23:03 UTC (permalink / raw) To: u-boot In message <47B37416.8090708@freescale.com> you wrote: > > > That would be exactly the other way round, i. e. provide an optional > > "-i" argument like "rm *" is doing in Unix. > > > > The default shall be not to ask any questions. > > rm defaults to not asking questions in *some* cases, but to asking in > others. Hence the -f flag to rm. Oops??? "rm" never asks unless you ask it to ask. 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 Q: How do you play religious roulette? A: You stand around in a circle and blaspheme and see who gets struck by lightning first. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 23:03 ` Wolfgang Denk @ 2008-02-13 23:04 ` Scott Wood 2008-02-13 23:11 ` Wolfgang Denk 0 siblings, 1 reply; 36+ messages in thread From: Scott Wood @ 2008-02-13 23:04 UTC (permalink / raw) To: u-boot Wolfgang Denk wrote: > In message <47B37416.8090708@freescale.com> you wrote: >>> That would be exactly the other way round, i. e. provide an optional >>> "-i" argument like "rm *" is doing in Unix. >>> >>> The default shall be not to ask any questions. >> rm defaults to not asking questions in *some* cases, but to asking in >> others. Hence the -f flag to rm. > > Oops??? "rm" never asks unless you ask it to ask. Not true. It will ask if you don't have write permission to the file, even if you are able to delete because you have write permission to the directory. The -f flag wouldn't be there if it were a no-op... -Scott ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 23:04 ` Scott Wood @ 2008-02-13 23:11 ` Wolfgang Denk 2008-02-15 15:37 ` Detlev Zundel 0 siblings, 1 reply; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 23:11 UTC (permalink / raw) To: u-boot In message <47B37791.3010109@freescale.com> you wrote: > > > Oops??? "rm" never asks unless you ask it to ask. > > Not true. It will ask if you don't have write permission to the file, > even if you are able to delete because you have write permission to the > directory. Does it? Indeed. Must be a GNUism. I bet this was't there in Unix v6 when I learned it ;-) You are right, but this is still a special case where another, explicit protection is being overwritten. 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 You got to learn three things. What's real, what's not real, and what's the difference." - Terry Pratchett, _Witches Abroad_ ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 23:11 ` Wolfgang Denk @ 2008-02-15 15:37 ` Detlev Zundel 0 siblings, 0 replies; 36+ messages in thread From: Detlev Zundel @ 2008-02-15 15:37 UTC (permalink / raw) To: u-boot Hi, > In message <47B37791.3010109@freescale.com> you wrote: >> >> > Oops??? "rm" never asks unless you ask it to ask. >> >> Not true. It will ask if you don't have write permission to the file, >> even if you are able to delete because you have write permission to the >> directory. > > Does it? Indeed. Must be a GNUism. I bet this was't there in Unix v6 > when I learned it ;-) > > > You are right, but this is still a special case where another, > explicit protection is being overwritten. * mkfs.ext2 on a file, needs -F package managers with unfulfilled * dependencies always ask and need a "--force-xxx" to go ahead whatsoever. * bzip2, bunzip2, bzcat, gzip, gzcat, gunzip -f to overwrite files * git-checkout-index needs -f to overwrite files * git-push needs -f to push non-linear head * git-fetch needs -f in same situtation * rsync -force to force deletion of dirs even if not empty .... I'll stop here. It seems the unix commandline tilted to a behaviour where interactive commands tend to ask in dangerous situations but scripts can explicitely override it - which is definitely what I prefer. Cheers Detlev -- Woman who seek to be equal with men lack ambition -- Timothy Leary -- 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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 10:13 ` Stefan Roese 2008-02-13 10:33 ` Markus Klotzbücher @ 2008-02-13 22:40 ` Wolfgang Denk 2008-02-13 22:50 ` Scott Wood 1 sibling, 1 reply; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 22:40 UTC (permalink / raw) To: u-boot In message <200802131113.08367.sr@denx.de> you wrote: > > > 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. => prot off all; era all > So I still would like to see the extra check. Nope. I will NAK it. Markus is absolutley right. 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 Let the programmers be many and the managers few -- then all will be productive. -- Geoffrey James, "The Tao of Programming" ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 22:40 ` Wolfgang Denk @ 2008-02-13 22:50 ` Scott Wood 2008-02-13 23:05 ` Wolfgang Denk 2008-02-14 5:20 ` Stefan Roese 0 siblings, 2 replies; 36+ messages in thread From: Scott Wood @ 2008-02-13 22:50 UTC (permalink / raw) To: u-boot Wolfgang Denk wrote: > In message <200802131113.08367.sr@denx.de> you wrote: >>> 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. > > => prot off all; era all There's a slight difference between two commands with arguments versus one command with none. -Scott ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 22:50 ` Scott Wood @ 2008-02-13 23:05 ` Wolfgang Denk 2008-02-14 5:20 ` Stefan Roese 1 sibling, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 23:05 UTC (permalink / raw) To: u-boot In message <47B37430.8070008@freescale.com> you wrote: > > > => prot off all; era all > > There's a slight difference between two commands with arguments versus > one command with none. Well, as Markus already wote, there are so many ways to kill yourself. If you don't accept the line above, just try "run update" without loading a (valid) image first. 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 One essential to success is that you desire be an all-obsessing one, your thoughts and aims be co-ordinated, and your energy be concentra- ted and applied without letup. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 22:50 ` Scott Wood 2008-02-13 23:05 ` Wolfgang Denk @ 2008-02-14 5:20 ` Stefan Roese 2008-02-14 7:44 ` Wolfgang Denk 1 sibling, 1 reply; 36+ messages in thread From: Stefan Roese @ 2008-02-14 5:20 UTC (permalink / raw) To: u-boot On Wednesday 13 February 2008, Scott Wood wrote: > Wolfgang Denk wrote: > > In message <200802131113.08367.sr@denx.de> you wrote: > >>> 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. > > > > => prot off all; era all > > There's a slight difference between two commands with arguments versus > one command with none. Yes, there is a big difference for my taste. I would still prefer the version with the '--force' parameter. Just my 2 cents. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-14 5:20 ` Stefan Roese @ 2008-02-14 7:44 ` Wolfgang Denk 2008-02-15 15:52 ` Detlev Zundel 0 siblings, 1 reply; 36+ messages in thread From: Wolfgang Denk @ 2008-02-14 7:44 UTC (permalink / raw) To: u-boot In message <200802140620.15102.sr@denx.de> you wrote: > > I would still prefer the version with the '--force' parameter. Just my 2 > cents. I really don't want to have this, for two reasons: 1) U-Boot doesn't do "Do you really want to" confirmations, because these don't fit into the Unix design philisophy; 2) U-Boot doesn't do GNU style long command line switches (for several reasons, memory footprint being one of them). 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 Quantum Mechanics is God's version of "Trust me." ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-14 7:44 ` Wolfgang Denk @ 2008-02-15 15:52 ` Detlev Zundel 2008-02-15 16:11 ` Wolfgang Denk 2008-02-15 16:40 ` Wolfgang Denk 0 siblings, 2 replies; 36+ messages in thread From: Detlev Zundel @ 2008-02-15 15:52 UTC (permalink / raw) To: u-boot Hi Wolfgang, > In message <200802140620.15102.sr@denx.de> you wrote: >> >> I would still prefer the version with the '--force' parameter. Just my 2 >> cents. > > I really don't want to have this, for two reasons: 1) U-Boot doesn't > do "Do you really want to" confirmations, because these don't fit into > the Unix design philisophy; 2) U-Boot doesn't do GNU style long > command line switches (for several reasons, memory footprint being one > of them). As I hinted at in my other mail, git is my prime example of living up to the spirit of unix - and still many commands there, e.g. git-push need a '-f' to prevent clobbering costly changes inadvertently. In my opinion your argument 1) is not true as it stands. Unix wants its users to be as productive as possible and typing two extra characters when ommitting them can cause hours of work is definitely in this spirit. Exaggerating your argument I would ask why you do not work only as root on your machine. In U-Boot we do not have this "user" level of protection so IMHO it makes sense to have at least a bit of it. It is true however that we don't have any kind of option processing, so probably '-force' wasn't a good choice to begin with. What about only using "all" as a "conformative" option? Cheers Detlev -- Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away. -- Antoine de Saint-Exupery -- 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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 15:52 ` Detlev Zundel @ 2008-02-15 16:11 ` Wolfgang Denk 2008-02-15 16:40 ` Wolfgang Denk 1 sibling, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-15 16:11 UTC (permalink / raw) To: u-boot In message <m27ih6p68o.fsf@ohwell.denx.de> you wrote: > > As I hinted at in my other mail, git is my prime example of living up to > the spirit of unix - and still many commands there, e.g. git-push need a > '-f' to prevent clobbering costly changes inadvertently. The important point is the "inadvertently". It is OK if you need an overwrite flag for commands that in the normal course of action are non-destructive, but in special situations are. However, commands which are designed to cause "destructive" actions don't ask: * rm does not ask by default. Not even for "rm -r *" * mkfs does not ask normally - it will happily kill the whole partition's content * cp or mv will happily overwrite target files (assuming sufficient permissions) etc. The "clearenv" command has a well-defined purpose: clear the environment. Similar like "erase" will clear the flash. Or "cp" or "mw" will overwrite even vital parts of the RAM. No questions being asked. 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 Bus error -- please leave by the rear door. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 15:52 ` Detlev Zundel 2008-02-15 16:11 ` Wolfgang Denk @ 2008-02-15 16:40 ` Wolfgang Denk 2008-02-15 17:12 ` Markus Klotzbücher ` (3 more replies) 1 sibling, 4 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-15 16:40 UTC (permalink / raw) To: u-boot Uff.... 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. One might even consider something like => env clear all to blow away the whole env, including the read-only variables. Would that be acceptable to everybody? 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 "There is such a fine line between genius and stupidity." - David St. Hubbins, "Spinal Tap" ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 16:40 ` Wolfgang Denk @ 2008-02-15 17:12 ` Markus Klotzbücher 2008-02-15 20:27 ` Jean-Christophe PLAGNIOL-VILLARD ` (2 subsequent siblings) 3 siblings, 0 replies; 36+ messages in thread From: Markus Klotzbücher @ 2008-02-15 17:12 UTC (permalink / raw) To: u-boot Wolfgang Denk <wd@denx.de> writes: > 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. [...] > Would that be acceptable to everybody? Sounds good! Best regards Markus Klotzb?cher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 16:40 ` Wolfgang Denk 2008-02-15 17:12 ` Markus Klotzbücher @ 2008-02-15 20:27 ` Jean-Christophe PLAGNIOL-VILLARD 2008-02-20 21:17 ` Matthias Fuchs 2008-02-18 9:41 ` Martin Krause 2008-03-25 21:10 ` Wolfgang Denk 3 siblings, 1 reply; 36+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-02-15 20:27 UTC (permalink / raw) To: u-boot On 17:40 Fri 15 Feb , Wolfgang Denk wrote: > Uff.... > > 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. > > One might even consider something like > > => env clear all > > to blow away the whole env, including the read-only variables. > > > Would that be acceptable to everybody? > > Ack-By : Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Best Regards, J. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 20:27 ` Jean-Christophe PLAGNIOL-VILLARD @ 2008-02-20 21:17 ` Matthias Fuchs 2008-02-20 21:30 ` Ulf Samuelsson 2008-02-22 12:00 ` Wolfgang Denk 0 siblings, 2 replies; 36+ messages in thread From: Matthias Fuchs @ 2008-02-20 21:17 UTC (permalink / raw) To: u-boot Hi, yes, I can live with the 'env' command, too. Sound's good to me. Matthias On Friday 15 February 2008 21:27:20 Jean-Christophe PLAGNIOL-VILLARD wrote: > On 17:40 Fri 15 Feb , Wolfgang Denk wrote: > > Uff.... > > > > 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. > > > > One might even consider something like > > > > => env clear all > > > > to blow away the whole env, including the read-only variables. > > > > > > Would that be acceptable to everybody? > > Ack-By : Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > > Best Regards, > J. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-20 21:17 ` Matthias Fuchs @ 2008-02-20 21:30 ` Ulf Samuelsson 2008-02-21 0:04 ` Wolfgang Denk 2008-02-22 12:00 ` Wolfgang Denk 1 sibling, 1 reply; 36+ messages in thread From: Ulf Samuelsson @ 2008-02-20 21:30 UTC (permalink / raw) To: u-boot >> > >> > 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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-20 21:30 ` Ulf Samuelsson @ 2008-02-21 0:04 ` Wolfgang Denk 0 siblings, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-21 0:04 UTC (permalink / raw) To: u-boot In message <00ca01c8740c$5a7b9fe0$c3031c0a@atmel.com> you wrote: > > It is a little different though, It will reinitialize the predefined > environment > variables to default settings but will not touch the other. Makes sense. > If "env default" is implemented the same way, then you could get a > 100% clean environment by: > > env clear ; env default I see. > What will "env" do without parameters? As usual: it will print it's "usage" message and return an error code. 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 "If you are afraid of loneliness, don't marry." - Chekhov ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-20 21:17 ` Matthias Fuchs 2008-02-20 21:30 ` Ulf Samuelsson @ 2008-02-22 12:00 ` Wolfgang Denk 1 sibling, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-22 12:00 UTC (permalink / raw) To: u-boot In message <200802202217.58210.matthias.fuchs@esd-electronics.com> you wrote: > > yes, I can live with the 'env' command, too. Sound's good to me. Hm... and who will submit the patch? 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 A bore is someone who persists in holding his own views after we have enlightened him with ours. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 16:40 ` Wolfgang Denk 2008-02-15 17:12 ` Markus Klotzbücher 2008-02-15 20:27 ` Jean-Christophe PLAGNIOL-VILLARD @ 2008-02-18 9:41 ` Martin Krause 2008-03-25 21:10 ` Wolfgang Denk 3 siblings, 0 replies; 36+ messages in thread From: Martin Krause @ 2008-02-18 9:41 UTC (permalink / raw) To: u-boot u-boot-users-bounces at lists.sourceforge.net wrote on : > Uff.... > > 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 This would be a very nice feature. With this command no knowledge is needed in which sector(s) the environment is stored. This would be very convenient in our production or service department, because all our different boards could be reseted to a known state with the same command. > > to reset the environment to the (compiled in) default settings. > > One might even consider something like > > => env clear all > > to blow away the whole env, including the read-only variables. > > > Would that be acceptable to everybody? No objections! Best Regards, Martin Krause -- TQ-Systems GmbH Muehlstrasse 2, Gut Delling, D-82229 Seefeld Amtsgericht Muenchen, HRB 105 018, UST-IdNr. DE 811 607 913 Geschaeftsfuehrer: Dipl.-Ing. (FH) Detlef Schneider, Dipl.-Ing. (FH) Ruediger Stahl http://www.tq-group.com ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-15 16:40 ` Wolfgang Denk ` (2 preceding siblings ...) 2008-02-18 9:41 ` Martin Krause @ 2008-03-25 21:10 ` Wolfgang Denk 3 siblings, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-03-25 21:10 UTC (permalink / raw) To: u-boot In message <20080215164010.2944E24D11@gemini.denx.de> I wrote: > > 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. > > One might even consider something like > > => env clear all > > to blow away the whole env, including the read-only variables. > > > Would that be acceptable to everybody? There was general agreement that this was a good thing, but I haven't seen any actual code yet. I anybody working on this? 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 Q: Do you know what the death rate around here is? A: One per person. ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-13 8:21 ` Matthias Fuchs 2008-02-13 8:56 ` Stefan Roese 2008-02-13 10:02 ` Markus Klotzbücher @ 2008-02-13 22:38 ` Wolfgang Denk 2 siblings, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-13 22:38 UTC (permalink / raw) To: u-boot 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 ^ permalink raw reply [flat|nested] 36+ messages in thread
* [U-Boot-Users] Delete all env vars except read onlys 2008-02-12 8:44 [U-Boot-Users] Delete all env vars except read onlys Matthias Fuchs 2008-02-12 14:49 ` Stefan Roese @ 2008-02-12 22:38 ` Wolfgang Denk 1 sibling, 0 replies; 36+ messages in thread From: Wolfgang Denk @ 2008-02-12 22:38 UTC (permalink / raw) To: u-boot In message <200802120944.42632.matthias.fuchs@esd-electronics.com> you 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? There is no direct way; you may write a small standalone application... 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 Extended Epstein-Heisenberg Principle: In an R & D orbit, only 2 of the existing 3 parameters can be defined simultaneously. The parame- ters are: task, time and resources ($). ^ permalink raw reply [flat|nested] 36+ messages in thread
end of thread, other threads:[~2008-03-25 21:10 UTC | newest] Thread overview: 36+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-12 8:44 [U-Boot-Users] Delete all env vars except read onlys Matthias Fuchs 2008-02-12 14:49 ` Stefan Roese 2008-02-12 22:55 ` Wolfgang Denk 2008-02-13 8:21 ` Matthias Fuchs 2008-02-13 8:56 ` Stefan Roese 2008-02-13 9:18 ` Matthias Fuchs 2008-02-13 10:02 ` Markus Klotzbücher 2008-02-13 10:13 ` Stefan Roese 2008-02-13 10:33 ` Markus Klotzbücher 2008-02-13 11:13 ` Detlev Zundel 2008-02-13 12:55 ` Markus Klotzbücher 2008-02-13 12:58 ` Stefan Roese 2008-02-13 22:43 ` Wolfgang Denk 2008-02-13 22:49 ` Scott Wood 2008-02-13 23:03 ` Wolfgang Denk 2008-02-13 23:04 ` Scott Wood 2008-02-13 23:11 ` Wolfgang Denk 2008-02-15 15:37 ` Detlev Zundel 2008-02-13 22:40 ` Wolfgang Denk 2008-02-13 22:50 ` Scott Wood 2008-02-13 23:05 ` Wolfgang Denk 2008-02-14 5:20 ` Stefan Roese 2008-02-14 7:44 ` Wolfgang Denk 2008-02-15 15:52 ` Detlev Zundel 2008-02-15 16:11 ` Wolfgang Denk 2008-02-15 16:40 ` Wolfgang Denk 2008-02-15 17:12 ` Markus Klotzbücher 2008-02-15 20:27 ` Jean-Christophe PLAGNIOL-VILLARD 2008-02-20 21:17 ` Matthias Fuchs 2008-02-20 21:30 ` Ulf Samuelsson 2008-02-21 0:04 ` Wolfgang Denk 2008-02-22 12:00 ` Wolfgang Denk 2008-02-18 9:41 ` Martin Krause 2008-03-25 21:10 ` Wolfgang Denk 2008-02-13 22:38 ` Wolfgang Denk 2008-02-12 22:38 ` Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox