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.
This commit is contained in:
@@ -558,6 +558,7 @@ static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
|
||||
}
|
||||
|
||||
ret = EFI_CALL(RT->set_variable(var_name16, &guid,
|
||||
EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
size, data));
|
||||
@@ -909,6 +910,7 @@ static int do_efi_boot_next(cmd_tbl_t *cmdtp, int flag,
|
||||
guid = efi_global_variable_guid;
|
||||
size = sizeof(u16);
|
||||
ret = EFI_CALL(RT->set_variable(L"BootNext", &guid,
|
||||
EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
size, &bootnext));
|
||||
@@ -964,6 +966,7 @@ static int do_efi_boot_order(cmd_tbl_t *cmdtp, int flag,
|
||||
|
||||
guid = efi_global_variable_guid;
|
||||
ret = EFI_CALL(RT->set_variable(L"BootOrder", &guid,
|
||||
EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
size, bootorder));
|
||||
|
||||
@@ -1344,8 +1344,9 @@ U_BOOT_CMD_COMPLETE(
|
||||
setenv, CONFIG_SYS_MAXARGS, 0, do_env_set,
|
||||
"set environment variables",
|
||||
#if defined(CONFIG_CMD_NVEDIT_EFI)
|
||||
"-e name [value ...]\n"
|
||||
"-e [-nv] name [value ...]\n"
|
||||
" - set UEFI variable 'name' to 'value' ...'\n"
|
||||
" 'nv' option makes the variable non-volatile\n"
|
||||
" - delete UEFI variable 'name' if 'value' not specified\n"
|
||||
#endif
|
||||
"setenv [-f] name value ...\n"
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user