[U-Boot] [PATCH] env: common: load read-only variables after reset

Wolfgang Denk wd at denx.de
Sat Jul 28 12:56:03 UTC 2018


Dear Yaniv,

In message <20180727153444.5602-1-yaniv.levinsky at compulab.co.il> you wrote:
> U-Boot fails to load read-only variables from storage after a reset. It
> happens because the environment hash table prevents creating read-only
> variables unless the H_FORCE flag is passed.

This is NOT a good idea.  "env import" should respect read-only
settings in exactly the same way as "env set" does.  Please keep in
minf that the user my set a variable to read-only exactly just to
prevent if from bein (accidentially) overwritten when importing an
(not exactly know) set of environment settings.  Your patch would
kill any such protection.

IMO the correct approach would be to add a "-f" flag to "env import"
and the, and ONLY then, also set the H_FORCE flag.

Naked-by: Wolfgang Denk <wd at denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
I'm a programmer: I don't buy software, I write it.
                                                  -- Tom Christiansen


More information about the U-Boot mailing list