aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-19 14:49:33 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-20 16:38:52 +0100
commit90c420509ed66ef4cb8453b7e388beb168c34a97 (patch)
tree62c20d56da763a8253124ec33db70ed02c651e7a
parente585b79ee4b1424f43dc7dbf66fc4f054255cb57 (diff)
downloadu-boot-90c420509ed66ef4cb8453b7e388beb168c34a97.zip
u-boot-90c420509ed66ef4cb8453b7e388beb168c34a97.tar.gz
u-boot-90c420509ed66ef4cb8453b7e388beb168c34a97.tar.bz2
efi_loader: ensure that file ubootefi.var is created
Currently file ubootefi.var is only created if the user sets a non-volatile EFI variable. If the file is missing, a warning is written. With the change PlatformLang is always persisted. So the file will exist on second boot. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--lib/efi_loader/efi_variable.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index 503a33e..7c32adf 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -334,9 +334,11 @@ efi_status_t efi_set_variable_int(const u16 *variable_name,
else
ret = EFI_SUCCESS;
- /* Write non-volatile EFI variables to file */
- if (attributes & EFI_VARIABLE_NON_VOLATILE &&
- ret == EFI_SUCCESS && efi_obj_list_initialized == EFI_SUCCESS)
+ /*
+ * Write non-volatile EFI variables to file
+ * TODO: check if a value change has occured to avoid superfluous writes
+ */
+ if (attributes & EFI_VARIABLE_NON_VOLATILE)
efi_var_to_file();
return EFI_SUCCESS;