efi_loader: assign HII protocols to root node
We should not install the HII protocols on every loaded image. It is sufficient to install them once on the root node. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
@@ -1569,26 +1569,6 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
|
|||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(EFI_LOADER_HII)
|
|
||||||
ret = efi_add_protocol(&obj->header,
|
|
||||||
&efi_guid_hii_string_protocol,
|
|
||||||
(void *)&efi_hii_string);
|
|
||||||
if (ret != EFI_SUCCESS)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
ret = efi_add_protocol(&obj->header,
|
|
||||||
&efi_guid_hii_database_protocol,
|
|
||||||
(void *)&efi_hii_database);
|
|
||||||
if (ret != EFI_SUCCESS)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
ret = efi_add_protocol(&obj->header,
|
|
||||||
&efi_guid_hii_config_routing_protocol,
|
|
||||||
(void *)&efi_hii_config_routing);
|
|
||||||
if (ret != EFI_SUCCESS)
|
|
||||||
goto failure;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
*info_ptr = info;
|
*info_ptr = info;
|
||||||
*handle_ptr = obj;
|
*handle_ptr = obj;
|
||||||
|
|
||||||
|
@@ -74,6 +74,26 @@ efi_status_t efi_root_node_register(void)
|
|||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(EFI_LOADER_HII)
|
||||||
|
/* Install HII string protocol */
|
||||||
|
ret = efi_add_protocol(root, &efi_guid_hii_string_protocol,
|
||||||
|
(void *)&efi_hii_string);
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
|
goto failure;
|
||||||
|
|
||||||
|
/* Install HII database protocol */
|
||||||
|
ret = efi_add_protocol(root, &efi_guid_hii_database_protocol,
|
||||||
|
(void *)&efi_hii_database);
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
|
goto failure;
|
||||||
|
|
||||||
|
/* Install HII configuration routing protocol */
|
||||||
|
ret = efi_add_protocol(root, &efi_guid_hii_config_routing_protocol,
|
||||||
|
(void *)&efi_hii_config_routing);
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
|
goto failure;
|
||||||
|
#endif
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user