diff options
author | Tom Rini <trini@konsulko.com> | 2019-06-05 15:53:18 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-06-05 15:53:18 -0400 |
commit | dbbb1c43f26cb28b64df80b72fffbaf2801e8a30 (patch) | |
tree | 6f60c48458e4fb975b0e602cff637c2e65a270cf /cmd/nvedit_efi.c | |
parent | 2253e40caef5b45bcae2ccdb238f9cf037eefc0b (diff) | |
parent | 4b27a761321fd17536e02644d0ec0373150eb570 (diff) |
Merge tag 'efi-2019-07-rc4-2' of git://git.denx.de/u-boot-efi
Pull request for UEFI sub-system for v2019.07-rc4-2
Support for managing the non-volatile attribute of UEFI variables
is added though we do not have a backend for persistence yet.
Error messages for changes of UEFI variables are provided.
UEFI boottime service implementations are corrected.
Diffstat (limited to 'cmd/nvedit_efi.c')
-rw-r--r-- | cmd/nvedit_efi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c index ff8eaa1aad2..60a8ac84c81 100644 --- a/cmd/nvedit_efi.c +++ b/cmd/nvedit_efi.c @@ -349,6 +349,7 @@ int do_env_set_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) u16 *var_name16 = NULL, *p; size_t len; efi_guid_t guid; + u32 attributes; efi_status_t ret; if (argc == 1) @@ -362,6 +363,16 @@ int do_env_set_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_FAILURE; } + attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS; + if (!strcmp(argv[1], "-nv")) { + attributes |= EFI_VARIABLE_NON_VOLATILE; + argc--; + argv++; + if (argc == 1) + return CMD_RET_SUCCESS; + } + var_name = argv[1]; if (argc == 2) { /* delete */ @@ -391,9 +402,7 @@ int do_env_set_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) utf8_utf16_strncpy(&p, var_name, len + 1); guid = efi_global_variable_guid; - ret = EFI_CALL(efi_set_variable(var_name16, &guid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | - EFI_VARIABLE_RUNTIME_ACCESS, + ret = EFI_CALL(efi_set_variable(var_name16, &guid, attributes, size, value)); if (ret == EFI_SUCCESS) { ret = CMD_RET_SUCCESS; |