public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: heinrich.schuchardt@canonical.com
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Weizhao Ouyang <o451686892@gmail.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v2] efi_loader: change the error message when storing EFI variables
Date: Fri, 19 Apr 2024 12:49:45 +0300	[thread overview]
Message-ID: <ZiI-ObOgxMWreq_V@hera> (raw)
In-Reply-To: <20240419094546.12653-1-ilias.apalodimas@linaro.org>

Heinrich

Please ignore this, I missed that we already report that in
efi_set_blk_dev_to_system_partition()

Apologies for the noise
/Ilias
On Fri, Apr 19, 2024 at 12:45:45PM +0300, Ilias Apalodimas wrote:
> When we try to store EFI variables on a file, we need to use an ESP.
> if an ESP is not found, variables will change in memory, but U-Boot
> won't be able to restore them across reboots.
>
> Adjust the error message so users can understand what's going on
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
> Changes since v1:
> - print different messages if ESP is missing or write to file failed
>
>  lib/efi_loader/efi_var_file.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c
> index 413e1794e88c..d5d347d50f8d 100644
> --- a/lib/efi_loader/efi_var_file.c
> +++ b/lib/efi_loader/efi_var_file.c
> @@ -73,16 +73,20 @@ efi_status_t efi_var_to_file(void)
>  		goto error;
>
>  	ret = efi_set_blk_dev_to_system_partition();
> -	if (ret != EFI_SUCCESS)
> +	if (ret != EFI_SUCCESS) {
> +		log_err("ESP not found.");
>  		goto error;
> +	}
>
>  	r = fs_write(EFI_VAR_FILE_NAME, map_to_sysmem(buf), 0, len, &actlen);
> -	if (r || len != actlen)
> +	if (r || len != actlen) {
> +		log_err("Failed to store variables.");
>  		ret = EFI_DEVICE_ERROR;
> +	}
>
>  error:
>  	if (ret != EFI_SUCCESS)
> -		log_err("Failed to persist EFI variables\n");
> +		log_err(" UEFI variables won't persist reboot\n");
>  	free(buf);
>  	return ret;
>  #else
> --
> 2.43.0
>

      reply	other threads:[~2024-04-19  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  9:45 [PATCH v2] efi_loader: change the error message when storing EFI variables Ilias Apalodimas
2024-04-19  9:49 ` Ilias Apalodimas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZiI-ObOgxMWreq_V@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=o451686892@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox