Skip to content

env: reworking + default/import individual vars

Wolfgang Denk u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v0 Latest4 patches 0 repliesNew

Patches in v0 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Groundwork for generalization of env interface+0 -09 replies
1/4Groundwork for generalization of env interface+0 -00 replies
2/4env: check and apply changes on delete/destroy+0 -00 replies
3/4env: implement selective "env default"+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v0 yet.

Read the v0 thread

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

Dear Gerlando Falauto,

Quoted 21 lines · In message <[email protected]>…

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.

Quoted 3 lines

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).

Would you please also update the help messages for the respective commands so we can see their correct (new) usage there?

Thanks.

Wolfgang Denk

Signature · 5 lines
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"