[PATCH 1/2] efi_loader: Avoid using efi_update_capsule() from update capsule on disk
Heinrich Schuchardt
xypron.glpk at gmx.de
Mon Jan 31 20:26:01 CET 2022
On 1/31/22 10:18, Masami Hiramatsu wrote:
> 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(). To keep the consistency
> ESRT also will be updated after all capsule updates are completed.
>
> Suggested-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu at linaro.org>
> ---
> lib/efi_loader/efi_capsule.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> index 4463ae00fd..98dab1c6f5 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);
Thanks for the patch. This look better.
> if (ret != EFI_SUCCESS)
> log_err("Applying capsule %ls failed\n",
> files[i]);
> @@ -1142,6 +1142,13 @@ efi_status_t efi_launch_capsules(void)
> free(files[i]);
> free(files);
>
> + if (IS_ENABLED(CONFIG_EFI_ESRT)) {
> + /* Rebuild the ESRT to reflect any updated FW images. */
> + ret = efi_esrt_populate();
> + if (ret != EFI_SUCCESS)
> + log_warning("ESRT update failed\n");
> + }
> +
This is not needed as you want to reboot.
Best regards
Heinrich
> return ret;
> }
> #endif /* CONFIG_EFI_CAPSULE_ON_DISK */
>
More information about the U-Boot
mailing list