Skip to content

teach 'env default' to optionally keep runtime variables

Rasmus Villemoes u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cmd/nvedit.c: teach 'env default' to optionally keep runtime variablescmd/nvedit.c+6 -20 replies
2/3test: env: check that non-mentioned variables to "env default" are preservedtest/env/cmd_ut_env.c+3 -40 replies
3/3test: env: add some test cases for new "env default -k" flagtest/env/cmd_ut_env.c+40 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] teach 'env default' to optionally keep runtime variables

Doing bringup of a board, part of my bootstrap logic is in U-Boot. So when tweaking that logic, I was bitten by a previous completed bootstrap having left a copy of the environment on the device, which was imported and thus overrided the new logic.

So I thought, "ok, I'll just make sure to put 'env default -a' as the first part of the bootstrap logic so I'm not bitten again". Alas, my logic also relies on certain variables that are set by C code (e.g. for detecting board variant), and doing 'env default -a' also eliminates those.

Looking around, the hashtab code already supports a flag that does exactly what I need, and exposing that is (morally) a one-liner.

Rasmus Villemoes (3):
cmd/nvedit.c: teach 'env default' to optionally keep runtime variables
test: env: check that non-mentioned variables to "env default" are
preserved
test: env: add some test cases for new "env default -k" flag

 cmd/nvedit.c          |  8 ++++++--
 test/env/cmd_ut_env.c | 45 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 5 deletions(-)
Signature · 1 line
2.47.0