[PATCH v2 1/2] efi_loader: Avoid using efi_update_capsule() from update capsule on disk

Masami Hiramatsu masami.hiramatsu at linaro.org
Tue Feb 1 09:32:59 CET 2022


The efi_update_capsule() may have to handle the capsule flags as an UEFI
runtime and boottime service, but the capsule-on-disk process doesn't.
Thus, the capsule-on-disk should use the efi_capsule_update_firmware()
directly instead of efi_update_capsule().

Suggested-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu at linaro.org>
---
 Changes in v2:
  - Fix to pass correct pointer to efi_capsule_update_firmware
  - Remove ESRT generation, because this part anyway will be removed
    next patch.
---
 lib/efi_loader/efi_capsule.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 4463ae00fd..1ec7ea29ff 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -1118,7 +1118,7 @@ efi_status_t efi_launch_capsules(void)
 			index = 0;
 		ret = efi_capsule_read_file(files[i], &capsule);
 		if (ret == EFI_SUCCESS) {
-			ret = EFI_CALL(efi_update_capsule(&capsule, 1, 0));
+			ret = efi_capsule_update_firmware(capsule);
 			if (ret != EFI_SUCCESS)
 				log_err("Applying capsule %ls failed\n",
 					files[i]);



More information about the U-Boot mailing list