efi_loader: set OsIndicationsSupported at init
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Wed, 24 Apr 2019 06:30:38 +0000 (15:30 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 2 May 2019 16:17:49 +0000 (18:17 +0200)
UEFI variables should be installed using well-defined API.
Currently we don't support much, but the value of OsIndicationsSupported
will be updated once some features are added in the future.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Add comments. Rename a variable.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/bootefi.c
lib/efi_loader/efi_setup.c

index efaa548be4d84dd41bf7f4ee3ef78baf03e66ca3..b93d8c6a32cd306f56a72fa0ddf28fbfe2e8c9a6 100644 (file)
@@ -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));
 
index b32a7b3f9346637d2719251aefafad683dd36982..87db51cbb74fa58c67fd5462e22ce67ca4b55afd 100644 (file)
@@ -79,6 +79,7 @@ out:
  */
 efi_status_t efi_init_obj_list(void)
 {
+       u64 os_indications_supported = 0; /* None */
        efi_status_t ret = EFI_SUCCESS;
 
        /* Initialize once only */
@@ -90,6 +91,16 @@ efi_status_t efi_init_obj_list(void)
        if (ret != EFI_SUCCESS)
                goto out;
 
+       /* Indicate supported features */
+       ret = EFI_CALL(efi_set_variable(L"OsIndicationsSupported",
+                                       &efi_global_variable_guid,
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       sizeof(os_indications_supported),
+                                       &os_indications_supported));
+       if (ret != EFI_SUCCESS)
+               goto out;
+
        /* Initialize system table */
        ret = efi_initialize_system_table();
        if (ret != EFI_SUCCESS)