summaryrefslogtreecommitdiff
path: root/cmd/nvedit.c
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2019-10-24 15:17:13 +0900
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-10-30 17:49:41 +0100
commit051aa89f46ca2412e91555df7a60a8bb604c5e29 (patch)
treeac17c543ee2156a0f27cc6064223265c651e38f4 /cmd/nvedit.c
parentee5041451e467711b9a4b0e679ba9cc18d93400e (diff)
downloadu-boot-051aa89f46ca2412e91555df7a60a8bb604c5e29.tar.gz
u-boot-051aa89f46ca2412e91555df7a60a8bb604c5e29.tar.bz2
u-boot-051aa89f46ca2412e91555df7a60a8bb604c5e29.zip
cmd: env: extend "env [set|print] -e" to manage UEFI variables
With this patch, when setting UEFI variable with "env set -e" command, we will be able to - specify vendor guid with "-guid guid", - specify variable attributes, BOOTSERVICE_ACCESS, RUNTIME_ACCESS, respectively with "-bs" and "-rt", - append a value instead of overwriting with "-a", - use memory as variable's value instead of explicit values given at the command line with "-i address,size" If guid is not explicitly given, default value will be used. Meanwhile, "env print -e," will be modified so that it will NOT dump a variable's value if '-n' is specified. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r--cmd/nvedit.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 1cb0bc1460..99a3bc57b1 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -1387,7 +1387,7 @@ static char env_help_text[] =
#endif
"env print [-a | name ...] - print environment\n"
#if defined(CONFIG_CMD_NVEDIT_EFI)
- "env print -e [name ...] - print UEFI environment\n"
+ "env print -e [-guid guid|-all][-n] [name ...] - print UEFI environment\n"
#endif
#if defined(CONFIG_CMD_RUN)
"env run var [...] - run commands in an environment variable\n"
@@ -1399,7 +1399,8 @@ static char env_help_text[] =
#endif
#endif
#if defined(CONFIG_CMD_NVEDIT_EFI)
- "env set -e name [arg ...] - set UEFI variable; unset if 'arg' not specified\n"
+ "env set -e [-nv][-bs][-rt][-a][-i addr,size][-v] name [arg ...]\n"
+ " - set UEFI variable; unset if '-i' or 'arg' not specified\n"
#endif
"env set [-f] name [arg ...]\n";
#endif
@@ -1428,8 +1429,9 @@ U_BOOT_CMD_COMPLETE(
"print environment variables",
"[-a]\n - print [all] values of all environment variables\n"
#if defined(CONFIG_CMD_NVEDIT_EFI)
- "printenv -e [name ...]\n"
+ "printenv -e [-guid guid|-all][-n] [name ...]\n"
" - print UEFI variable 'name' or all the variables\n"
+ " \"-n\": suppress dumping variable's value\n"
#endif
"printenv name ...\n"
" - print value of environment variable 'name'",
@@ -1459,9 +1461,16 @@ U_BOOT_CMD_COMPLETE(
setenv, CONFIG_SYS_MAXARGS, 0, do_env_set,
"set environment variables",
#if defined(CONFIG_CMD_NVEDIT_EFI)
- "-e [-nv] name [value ...]\n"
+ "-e [-guid guid][-nv][-bs][-rt][-a][-v]\n"
+ " [-i addr,size name], or [name [value ...]]\n"
" - set UEFI variable 'name' to 'value' ...'\n"
- " 'nv' option makes the variable non-volatile\n"
+ " \"-guid\": set vendor guid\n"
+ " \"-nv\": set non-volatile attribute\n"
+ " \"-bs\": set boot-service attribute\n"
+ " \"-rt\": set runtime attribute\n"
+ " \"-a\": append-write\n"
+ " \"-i addr,size\": use <addr,size> as variable's value\n"
+ " \"-v\": verbose message\n"
" - delete UEFI variable 'name' if 'value' not specified\n"
#endif
"setenv [-f] name value ...\n"