diff mbox series

[v2,12/21] efi_firmware: fwu: do not read FWU metadata on sandbox

Message ID 20240212074712.3657076-13-sughosh.ganu@linaro.org
State New
Headers show
Series FWU: Migrate FWU metadata to version 2 | expand

Commit Message

Sughosh Ganu Feb. 12, 2024, 7:47 a.m. UTC
The FWU metadata is being read for populating the firmware image's
version information. The sandbox platform does not have the FWU
metadata on any of it's storage devices. Skip attempting to read the
FWU metadata on the sandbox platform.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---

Changes since V1: None

 lib/efi_loader/efi_firmware.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index ba5aba098c..c742e23268 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -223,7 +223,8 @@  void efi_firmware_fill_version_info(struct efi_firmware_image_descriptor *image_
 	/* get the fw_version */
 	efi_create_indexed_name(varname, sizeof(varname), "FmpState",
 				fw_array->image_index);
-	if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) {
+	if (!IS_ENABLED(CONFIG_SANDBOX) &&
+	    IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) {
 		ret = fwu_get_active_index(&active_index);
 		if (ret)
 			return;
@@ -391,7 +392,8 @@  efi_status_t efi_firmware_set_fmp_state_var(struct fmp_state *state, u8 image_in
 	efi_create_indexed_name(varname, sizeof(varname), "FmpState",
 				image_index);
 
-	if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) {
+	if (!IS_ENABLED(CONFIG_SANDBOX) &&
+	    IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) {
 		ret = fwu_plat_get_update_index(&update_bank);
 		if (ret)
 			return EFI_INVALID_PARAMETER;