diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2020-07-28 11:51:20 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-07-31 10:13:00 -0400 |
commit | 0115dd3a6a144e9c974e00a9f3f41c5bb053236e (patch) | |
tree | b493f2af6ae993f3fe319d5f97c3833d160041af /cmd/nvedit.c | |
parent | 466d9855d4ee828c998ee3ea29e5685e38d3064e (diff) | |
download | u-boot-0115dd3a6a144e9c974e00a9f3f41c5bb053236e.tar.gz u-boot-0115dd3a6a144e9c974e00a9f3f41c5bb053236e.tar.bz2 u-boot-0115dd3a6a144e9c974e00a9f3f41c5bb053236e.zip |
cmd: env: add env load command
Add the new command env load to load the environment from
the current location gd->env_load_prio.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r-- | cmd/nvedit.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index acd9f82667..f730e2e754 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -794,6 +794,14 @@ U_BOOT_CMD( ); #endif #endif + +#if defined(CONFIG_CMD_NVEDIT_LOAD) +static int do_env_load(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + return env_reload() ? 1 : 0; +} +#endif #endif /* CONFIG_SPL_BUILD */ int env_match(uchar *s1, int i2) @@ -1347,6 +1355,9 @@ static struct cmd_tbl cmd_env_sub[] = { #if defined(CONFIG_CMD_NVEDIT_INFO) U_BOOT_CMD_MKENT(info, 3, 0, do_env_info, "", ""), #endif +#if defined(CONFIG_CMD_NVEDIT_LOAD) + U_BOOT_CMD_MKENT(load, 1, 0, do_env_load, "", ""), +#endif U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""), #if defined(CONFIG_CMD_RUN) U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""), @@ -1442,6 +1453,9 @@ static char env_help_text[] = "env erase - erase environment\n" #endif #endif +#if defined(CONFIG_CMD_NVEDIT_LOAD) + "env load - load environment\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" |