[PATCH] nv: Fix variable removal in nvvar_save()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux