summaryrefslogtreecommitdiff
path: root/cmd/nvedit.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-07-28 12:51:21 +0300
committerTom Rini <trini@konsulko.com>2020-07-31 17:13:00 +0300
commita97d22ebba2305f2d0aee714544c72c6a53026d9 (patch)
tree11c843faeaeb7a2bdd1e180e2e135b11cf5817da /cmd/nvedit.c
parent0115dd3a6a144e9c974e00a9f3f41c5bb053236e (diff)
downloadu-boot-a97d22ebba2305f2d0aee714544c72c6a53026d9.tar.xz
cmd: env: add env select command
Add the new command 'env select' to force the persistent storage of environment, saved in gd->env_load_prio. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r--cmd/nvedit.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index f730e2e754..d188c6aa6b 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -802,6 +802,15 @@ static int do_env_load(struct cmd_tbl *cmdtp, int flag, int argc,
return env_reload() ? 1 : 0;
}
#endif
+
+#if defined(CONFIG_CMD_NVEDIT_SELECT)
+static int do_env_select(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ return env_select(argv[1]) ? 1 : 0;
+}
+#endif
+
#endif /* CONFIG_SPL_BUILD */
int env_match(uchar *s1, int i2)
@@ -1368,6 +1377,9 @@ static struct cmd_tbl cmd_env_sub[] = {
U_BOOT_CMD_MKENT(erase, 1, 0, do_env_erase, "", ""),
#endif
#endif
+#if defined(CONFIG_CMD_NVEDIT_SELECT)
+ U_BOOT_CMD_MKENT(select, 2, 0, do_env_select, "", ""),
+#endif
U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""),
#if defined(CONFIG_CMD_ENV_EXISTS)
U_BOOT_CMD_MKENT(exists, 2, 0, do_env_exists, "", ""),
@@ -1456,6 +1468,9 @@ static char env_help_text[] =
#if defined(CONFIG_CMD_NVEDIT_LOAD)
"env load - load environment\n"
#endif
+#if defined(CONFIG_CMD_NVEDIT_SELECT)
+ "env select [target] - select environment target\n"
+#endif
#if defined(CONFIG_CMD_NVEDIT_EFI)
"env set -e [-nv][-bs][-rt][-at][-a][-i addr,size][-v] name [arg ...]\n"
" - set UEFI variable; unset if '-i' or 'arg' not specified\n"