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.ha...@pengutronix.de>
---
 common/globalvar.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/globalvar.c b/common/globalvar.c
index 44e6528..9d67348 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,
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to