[U-Boot] [PATCH v0 0/4] env: reworking + default/import individual vars

Gerlando Falauto gerlando.falauto at keymile.com
Wed Oct 26 18:37:48 CEST 2011


This is a resubmission (after removing remove checkpatch errors) of
http://lists.denx.de/pipermail/u-boot/2011-September/102875.html

Here I am proposing a set of changes in the behaviour of the environment 
import/set_to_default functions.

PATCH 1:
Add a "new" himport_ex() function (reworking of himport_r which is now a 
wrapper around it), which has 3 new arguments:

"nvars", "vars":, number and list of variables to take into account 
(0 means ALL)

"apply" callback function which is in charge of checking whether a 
variable can be overwritten, and possibly immediately apply the changes. 
This parameter would be either set to NULL (in which case nothing should 
change wrt to the past -- i.e. environment is blindly imported) or to 
"env_check_apply()" function, whose code was taken away from _do_env_set().
This would be useful, for instance, for "baudrate" or "stdin,stderr,stdout", 
whose changes would not otherwise be effective until the next reboot.

The idea is that there should be a single place where all the checks are
to be performed. So the same function env_check_apply() is called from 
_do_env_set() as well (thus keeping the previous behavior).

PATCH 2:
Add the same behaviour when deleting variables.
Not quite sure whether this makes sense or not.

PATCH 3:
Add the code for setting individual variables to default

PATCH 4:
Impolement importing of  individual variables
(also taking into account "-f" for forcing).

Gerlando Falauto (4):
  Groundwork for generalization of env interface
  env: check and apply changes on delete/destroy
  env: implement selective "env default"
  env: implement "env import -n var[,var...]"

 README                   |    2 +
 common/cmd_nvedit.c      |  231 ++++++++++++++++++++++++++++++++--------------
 common/env_common.c      |   29 ++++++-
 include/config_cmd_all.h |    1 +
 include/environment.h    |   12 +++
 include/search.h         |   19 ++++-
 lib/hashtable.c          |   68 ++++++++++++-
 7 files changed, 284 insertions(+), 78 deletions(-)



More information about the U-Boot mailing list