mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
efi_loader: clear OsIndications
After each reboot we must clear flag EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED in variable OsIndications. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
417a3c24c9
commit
149108a3eb
1 changed files with 39 additions and 1 deletions
|
@ -5,9 +5,12 @@
|
|||
* Copyright (c) 2016-2018 Alexander Graf et al.
|
||||
*/
|
||||
|
||||
#define LOG_CATEGORY LOGC_EFI
|
||||
|
||||
#include <common.h>
|
||||
#include <efi_loader.h>
|
||||
#include <efi_variable.h>
|
||||
#include <log.h>
|
||||
|
||||
#define OBJ_LIST_NOT_INITIALIZED 1
|
||||
|
||||
|
@ -171,6 +174,37 @@ static efi_status_t efi_init_os_indications(void)
|
|||
&os_indications_supported, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* efi_clear_os_indications() - clear OsIndications
|
||||
*
|
||||
* Clear EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED
|
||||
*/
|
||||
static efi_status_t efi_clear_os_indications(void)
|
||||
{
|
||||
efi_uintn_t size;
|
||||
u64 os_indications;
|
||||
efi_status_t ret;
|
||||
|
||||
size = sizeof(os_indications);
|
||||
ret = efi_get_variable_int(L"OsIndications", &efi_global_variable_guid,
|
||||
NULL, &size, &os_indications, NULL);
|
||||
if (ret != EFI_SUCCESS)
|
||||
os_indications = 0;
|
||||
else
|
||||
os_indications &=
|
||||
~EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED;
|
||||
ret = efi_set_variable_int(L"OsIndications", &efi_global_variable_guid,
|
||||
EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
sizeof(os_indications), &os_indications,
|
||||
false);
|
||||
if (ret != EFI_SUCCESS)
|
||||
log_err("Setting %ls failed\n", L"OsIndications");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* efi_init_obj_list() - Initialize and populate EFI object list
|
||||
*
|
||||
|
@ -178,7 +212,7 @@ static efi_status_t efi_init_os_indications(void)
|
|||
*/
|
||||
efi_status_t efi_init_obj_list(void)
|
||||
{
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
efi_status_t r, ret = EFI_SUCCESS;
|
||||
|
||||
/* Initialize once only */
|
||||
if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
|
||||
|
@ -297,7 +331,11 @@ efi_status_t efi_init_obj_list(void)
|
|||
if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK) &&
|
||||
!IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY))
|
||||
ret = efi_launch_capsules();
|
||||
|
||||
out:
|
||||
r = efi_clear_os_indications();
|
||||
if (ret == EFI_SUCCESS)
|
||||
ret = r;
|
||||
efi_obj_list_initialized = ret;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue