summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-09-21 09:13:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 10:10:18 +0200
commitc42e8262c827d267be9529da1373efeaf535ec6b (patch)
tree901308f551b01cbe2526bc44879a71bf064d4e18
parentd549e5d498bd3124cd490ea3cba3919b9779d181 (diff)
downloadbarebox-c42e8262c827d267be9529da1373efeaf535ec6b.tar.gz
barebox-c42e8262c827d267be9529da1373efeaf535ec6b.tar.xz
nv: Fix variable removal in nvvar_save()
When nv variables are removed during runtime then they are present again when saved with nvvar_save(). This is because nvvar_save() does not delete variables that exist on the saved environment. Delete /nv on the saved environment before saving the new variables. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/globalvar.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/globalvar.c b/common/globalvar.c
index 44e6528f6c..9d6734854e 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -471,6 +471,7 @@ int nvvar_save(void)
defaultenv_load(TMPDIR, 0);
envfs_load(env, TMPDIR, 0);
+ unlink_recursive(TMPDIR "/nv", NULL);
list_for_each_entry(param, &nv_device.parameters, list) {
ret = __nv_save(TMPDIR "/nv", param->name,