]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: ensure that file ubootefi.var is created
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 19 Jan 2023 13:49:33 +0000 (14:49 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 20 Jan 2023 15:38:52 +0000 (16:38 +0100)
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>
lib/efi_loader/efi_variable.c

index 503a33ed65c555a69157c0b0879b1a673d77ac25..7c32adf6e5b7def8cd3f9f17c9e01c2f7698b4d3 100644 (file)
@@ -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;