Skip to contentSkip to conversation

efi_loader: Improve EFI variable load message

PATCH In review Pranav Tilak 3 participants 3 messages Feb 2 – Feb 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: Improve EFI variable load message

Change the EFI variable load message from log_err() to log_info() with neutral wording. The previous "Failed to load" message caused customer confusion as it appeared to indicate an error condition.

The efi_var_from_file() function deliberately returns EFI_SUCCESS in this case to allow the boot process to continue normally. This is documented in the function's comment block but was not reflected in the log message level or content.

The message now uses informational wording to reflect that this is normal behavior when the ubootefi.var file does not yet exist.

---
 lib/efi_loader/efi_var_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_var_file.c +1 -1
index ba0bf33ffbd..f23a964a418 100644
@@ -173,7 +173,7 @@ efi_status_t efi_var_from_file(void)
 	r = fs_read(EFI_VAR_FILE_NAME, map_to_sysmem(buf), 0, EFI_VAR_BUF_SIZE,
 		    &len);
 	if (r || len < sizeof(struct efi_var_file)) {
-		log_err("Failed to load EFI variables\n");
+		log_info("No EFI variables loaded\n");
 		goto error;
 	}
 	if (buf->length != len || efi_var_restore(buf, false) != EFI_SUCCESS)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Pranav Tilak

Change the EFI variable load message from log_err() to log_info() with neutral wording. The previous "Failed to load" message caused customer confusion as it appeared to indicate an error condition.

The efi_var_from_file() function deliberately returns EFI_SUCCESS in this case to allow the boot process to continue normally. This is documented in the function's comment block but was not reflected in the log message level or content.

Quoted 4 lines

The message now uses informational wording to reflect that this is normal behavior when the ubootefi.var file does not yet exist.

Hello Pranav,

Thank you for the patch.

Please, use scripts/get_maintainer.pl to determine the addressees for your patches to avoid future review delays.

Quoted 17 lines
---
  lib/efi_loader/efi_var_file.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_var_file.c +1 -1
index ba0bf33ffbd..f23a964a418 100644
@@ -173,7 +173,7 @@ efi_status_t efi_var_from_file(void)
  	r = fs_read(EFI_VAR_FILE_NAME, map_to_sysmem(buf), 0, EFI_VAR_BUF_SIZE,
  		    &len);
  	if (r || len < sizeof(struct efi_var_file)) {
-		log_err("Failed to load EFI variables\n");
+		log_info("No EFI variables loaded\n");
  		goto error;
  	}
  	if (buf->length != len || efi_var_restore(buf, false) != EFI_SUCCESS)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Pranav Tilak
Quoted 10 lines · Pranav Tilak

Change the EFI variable load message from log_err() to log_info() with neutral wording. The previous "Failed to load" message caused customer confusion as it appeared to indicate an error condition.

The efi_var_from_file() function deliberately returns EFI_SUCCESS in this case to allow the boot process to continue normally. This is documented in the function's comment block but was not reflected in the log message level or content.

Quoted 5 lines

The message now uses informational wording to reflect that this is normal behavior when the ubootefi.var file does not yet exist.

---

Quoted 19 lines
 lib/efi_loader/efi_var_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_var_file.c +1 -2
index ba0bf33ffbd..f23a964a418 100644
@@ -173,7 +173,7 @@ efi_status_t efi_var_from_file(void)
        r = fs_read(EFI_VAR_FILE_NAME, map_to_sysmem(buf), 0, EFI_VAR_BUF_SIZE,
                    &len);
        if (r || len < sizeof(struct efi_var_file)) {
-               log_err("Failed to load EFI variables\n");
+               log_info("No EFI variables loaded\n");
                goto error;
        }
        if (buf->length != len || efi_var_restore(buf, false) != EFI_SUCCESS)
--

2.34.1