diff options
author | Tom Rini <trini@konsulko.com> | 2022-12-29 13:32:50 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-12-29 13:32:50 -0500 |
commit | d36bc89be2793a03da151f067d4889d9a32d3908 (patch) | |
tree | 7fde10a06c430caf0ae0db3a44fc3ef06506f313 /lib | |
parent | 6f975524cbf7d39c925cb101be9ff09b5e70dbbe (diff) | |
parent | f557cf08b974c359ad3c53a87297d19fe13ff4f0 (diff) |
Merge tag 'efi-2023-01-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2023-01-rc5-2
Documentation:
* Reorganize existing TI docs and add K3 generation page
* Add texinfodocs and infodocs targets
* Update qemu-ppce500 documentation
* Use "changesets" not "csets" in statistics pages
UEFI
* Fix merging of preseeded non-volatile variables
* Fix a return value in the EFI_HII_DATABASE_PROTOCOL
* Set UEFI specification version to 2.10
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_hii.c | 2 | ||||
-rw-r--r-- | lib/efi_loader/efi_var_file.c | 4 | ||||
-rw-r--r-- | lib/efi_loader/efi_var_mem.c | 4 | ||||
-rw-r--r-- | lib/efi_loader/efi_variable.c | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c index 75ff58aafa..27db3be6a1 100644 --- a/lib/efi_loader/efi_hii.c +++ b/lib/efi_loader/efi_hii.c @@ -780,7 +780,7 @@ get_package_list_handle(const struct efi_hii_database_protocol *this, } } - return EFI_EXIT(EFI_NOT_FOUND); + return EFI_EXIT(EFI_INVALID_PARAMETER); } const struct efi_hii_database_protocol efi_hii_database = { diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c index 3d58caa13d..62e071bd83 100644 --- a/lib/efi_loader/efi_var_file.c +++ b/lib/efi_loader/efi_var_file.c @@ -176,7 +176,7 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe) data = var->name + u16_strlen(var->name) + 1; /* - * Secure boot related and non-volatile variables shall only be + * Secure boot related and volatile variables shall only be * restored from U-Boot's preseed. */ if (!safe && @@ -187,6 +187,8 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe) continue; if (!var->length) continue; + if (efi_var_mem_find(&var->guid, var->name, NULL)) + continue; ret = efi_var_mem_ins(var->name, &var->guid, var->attr, var->length, data, 0, NULL, var->time); diff --git a/lib/efi_loader/efi_var_mem.c b/lib/efi_loader/efi_var_mem.c index 0bac594e00..e1058e3c6a 100644 --- a/lib/efi_loader/efi_var_mem.c +++ b/lib/efi_loader/efi_var_mem.c @@ -146,9 +146,7 @@ efi_status_t __efi_runtime efi_var_mem_ins( var = (struct efi_var_entry *) ((uintptr_t)efi_var_buf + efi_var_buf->length); - for (var_name_len = 0; variable_name[var_name_len]; ++var_name_len) - ; - ++var_name_len; + var_name_len = u16_strlen(variable_name) + 1; data = var->name + var_name_len; if ((uintptr_t)data - (uintptr_t)efi_var_buf + size1 + size2 > diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 8ca2d85694..503a33ed65 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -425,6 +425,9 @@ efi_status_t efi_init_variables(void) if (ret != EFI_SUCCESS) return ret; + ret = efi_var_from_file(); + if (ret != EFI_SUCCESS) + return ret; if (IS_ENABLED(CONFIG_EFI_VARIABLES_PRESEED)) { ret = efi_var_restore((struct efi_var_file *) __efi_var_file_begin, true); @@ -432,9 +435,6 @@ efi_status_t efi_init_variables(void) log_err("Invalid EFI variable seed\n"); } - ret = efi_var_from_file(); - if (ret != EFI_SUCCESS) - return ret; return efi_init_secure_state(); } |