
erase also the redundant environment location if offset is defined
this is a possible implementation without adding additional parameter to env erase command
Signed-off-by: Frank Wunderlich frank-w@public-files.de --- cmd/nvedit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 2071bcf443..f11972e8f1 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -766,8 +766,15 @@ U_BOOT_CMD( static int do_env_erase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - return env_erase(false) ? 1 : 0; + int ret; + + ret = env_erase(false) ? 1 : 0; + #ifdef CONFIG_ENV_OFFSET_REDUND + ret = ret || (env_erase(true) ? 1 : 0); + #endif + return ret; } + U_BOOT_CMD( eraseenv, 1, 0, do_env_erase, "erase environment variables from persistent storage", -- 2.17.1