aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-13 15:50:16 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-20 19:06:22 +0100
commitce68a254483817f86f92ffef7c7bc44fee318fb5 (patch)
tree342c9d759d9e77fa6544c91110364661ff297420 /lib
parent229f9e77fe46efb2516b7cfdc60db1d92721eac5 (diff)
downloadu-boot-ce68a254483817f86f92ffef7c7bc44fee318fb5.zip
u-boot-ce68a254483817f86f92ffef7c7bc44fee318fb5.tar.gz
u-boot-ce68a254483817f86f92ffef7c7bc44fee318fb5.tar.bz2
efi_loader: improve efi_var_from_file() description
It is unclear to developers why efi_var_from_file() returns EFI_SUCCESS if file ubootefi.var is missing or corrupted. Improve the description. Reported-by: Weizhao Ouyang <o451686892@gmail.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Weizhao Ouyang <o451686892@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_var_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c
index 62e071b..d7dba05 100644
--- a/lib/efi_loader/efi_var_file.c
+++ b/lib/efi_loader/efi_var_file.c
@@ -204,8 +204,11 @@ efi_status_t efi_var_restore(struct efi_var_file *buf, bool safe)
* File ubootefi.var is read from the EFI system partitions and the variables
* stored in the file are created.
*
- * In case the file does not exist yet or a variable cannot be set EFI_SUCCESS
- * is returned.
+ * On first boot the file ubootefi.var does not exist yet. This is why we must
+ * return EFI_SUCCESS in this case.
+ *
+ * If the variable file is corrupted, e.g. incorrect CRC32, we do not want to
+ * stop the boot process. We deliberately return EFI_SUCCESS in this case, too.
*
* Return: status code
*/