mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] efi: loader: keep booting when the runtime variable store is unavailable
Date: Wed, 26 Aug 2026 11:47:58 +0200	[thread overview]
Message-ID: <20260826094800.2564299-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260826094800.2564299-1-a.fatoum@pengutronix.de>

efi_init_runtime_variable_supported() creates the two variables the OS
needs to write the variable file itself: RTStorageVolatile names the file
on the ESP and VarToFile hands out its contents. Both are inserted into
the same 128 KiB in-memory store as every other variable, so both fail
with EFI_OUT_OF_RESOURCES once that store is full.

The loader itself does not need those variables, only runtime
SetVariable() does. Warn and clear EFI_RT_SUPPORTED_SET_VARIABLE in the
runtime properties table instead, so the OS is told that persisting
variables at runtime is not available, and boot on.

Assisted-by: Claude:opus-5
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 efi/loader/runtime.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/efi/loader/runtime.c b/efi/loader/runtime.c
index f0fbd263fe55..a33db166d064 100644
--- a/efi/loader/runtime.c
+++ b/efi/loader/runtime.c
@@ -72,8 +72,10 @@ efi_status_t efi_init_runtime_supported(void)
 		CHECK_RT_FLAG(QUERY_VARIABLE_INFO);
 
 	ret = efi_init_runtime_variable_supported();
-	if (ret != EFI_SUCCESS)
-		return ret;
+	if (ret != EFI_SUCCESS) {
+		pr_warn("no runtime variable store: %s\n", efi_strerror(ret));
+		rt_table->runtime_services_supported &= ~EFI_RT_SUPPORTED_SET_VARIABLE;
+	}
 
 	return efi_install_configuration_table(&efi_rt_properties_table_guid, rt_table);
 }
-- 
2.47.3




  reply	other threads:[~2026-08-26  9:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  9:47 [PATCH 1/2] efi: loader: don't let VarToFile stop the variable file from being written Ahmad Fatoum
2026-08-26  9:47 ` Ahmad Fatoum [this message]
2026-08-28 13:07 ` Sascha Hauer

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=20260826094800.2564299-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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