From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bmz5j-0000oo-7M for barebox@lists.infradead.org; Thu, 22 Sep 2016 08:10:47 +0000 From: Sascha Hauer Date: Thu, 22 Sep 2016 10:10:24 +0200 Message-Id: <1474531824-23375-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] nv: Fix variable removal in nvvar_save() To: Barebox List 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 --- 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