diff mbox series

[U-Boot,v2,04/11] efi_loader: set OsIndicationsSupported at init

Message ID 20190424063045.14443-5-takahiro.akashi@linaro.org
State Superseded, archived
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: non-volatile variables support | expand

Commit Message

AKASHI Takahiro April 24, 2019, 6:30 a.m. UTC
UEFI variable should be installed using well-defined API.
Currently we don't support much, but the value fo OsIndicationsSupported
will be updated once some features are added in the future.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 cmd/bootefi.c              | 4 ----
 lib/efi_loader/efi_setup.c | 9 +++++++++
 2 files changed, 9 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index efaa548be4d8..b93d8c6a32cd 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -303,10 +303,6 @@  static efi_status_t do_bootefi_exec(efi_handle_t handle)
 	if (ret != EFI_SUCCESS)
 		return ret;
 
-	/* we don't support much: */
-	env_set("efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported",
-		"{ro,boot}(blob)0000000000000000");
-
 	/* Call our payload! */
 	ret = EFI_CALL(efi_start_image(handle, NULL, NULL));
 
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 7d67a5506335..05d8d754f4c7 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -89,6 +89,7 @@  out:
  */
 efi_status_t efi_init_obj_list(void)
 {
+	u64 val = 0;
 	efi_status_t ret = EFI_SUCCESS;
 
 	/* Initialize once only */
@@ -100,6 +101,14 @@  efi_status_t efi_init_obj_list(void)
 	if (ret != EFI_SUCCESS)
 		goto out;
 
+	ret = EFI_CALL(efi_set_variable(L"OsIndicationsSupported",
+					&efi_global_variable_guid,
+					EFI_VARIABLE_BOOTSERVICE_ACCESS |
+					EFI_VARIABLE_RUNTIME_ACCESS,
+					sizeof(val), &val));
+	if (ret != EFI_SUCCESS)
+		goto out;
+
 	/* Initialize system table */
 	ret = efi_initialize_system_table();
 	if (ret != EFI_SUCCESS)