
Dear Gerlando Falauto,
In message 1315471768-21608-1-git-send-email-gerlando.falauto@keymile.com you wrote:
Here I am proposing an implementation for setting individual variables to their default values as outlined in http://www.denx.de/wiki/U-Boot/TaskSetEnvironmentDefaults
For instance, to reset defautl values for variables bootcmd and bootdelay: => env default bootcmd bootdelay
There are a few issues which are not fully covered. [In braces I put the behavior of this patch].
- Previous implementation of âenv defaultâ only worked for the whole
environment, and â-fâ was necessary in order to prevent the unexperienced user from messing up the environment by just typing command names. Should this behavior be kept? [Yes]
- When a variable is not defined in the default environment, should
it get deleted (if existing)? [Yes] Should a warning be issued? [No] What if it is neither defined in the current nor in the default env?
- Should it be possible to disable this feature (i.e. to save space)?
[No] Any suggestions for a meaningful configuration token? I was thinking of CONFIG_RESTORE_INDIVIDUAL_ENV_VARS.
- This implementation comes mostly from himport_r().
It crossed my mind that it might also be useful to *import* individual variables from a file (rather that the default env).
For instance: env import [flags] addr size vars...
Would only import variables "vars" and ignore all others.
With this idea in mind I kept all himport_r()'s support for external files (i.e., comments, separator other than '\0', quoting). If no one else envisions any use for such import commands, the code could obviously be much smaller and simpler.
Signed-off-by: Gerlando Falauto gerlando.falauto@keymile.com Signed-off-by: Holger Brunck holger.brunck@keymile.com cc: Wolfgang Denk wd@denx.de
common/cmd_nvedit.c | 12 +++++- common/env_common.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ include/environment.h | 3 + 3 files changed, 119 insertions(+), 2 deletions(-)
Checkpatch says:
total: 5 errors, 0 warnings, 147 lines checked
Please clean up and resubmit. Thanks.
Best regards,
Wolfgang Denk