aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2022-06-01 23:30:39 +0530
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2022-06-12 09:17:54 +0200
commit119fafdefb81677dc629b79263672e9457849c61 (patch)
tree725f93299c790d69eb7265d7f1bb3bf23a6a84d9 /lib
parent57bd363de7b95bececd40a0c8dbb2fcf4d8d3b21 (diff)
downloadu-boot-119fafdefb81677dc629b79263672e9457849c61.zip
u-boot-119fafdefb81677dc629b79263672e9457849c61.tar.gz
u-boot-119fafdefb81677dc629b79263672e9457849c61.tar.bz2
EFI: Do not consider OsIndications variable if CONFIG_EFI_IGNORE_OSINDICATIONS is enabled
The EFI_IGNORE_OSINDICATIONS config symbol was introduced as a mechanism to have capsule updates work even on platforms where the SetVariable runtime service was not supported. The current logic requires the OsIndications variable to have been set to a 64 bit value even when the EFI_IGNORE_OSINDICATIONS config is enabled. Return an error code on not being able to read the variable only when EFI_IGNORE_OSINDICATIONS is not enabled. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_capsule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index c76a5f3..a6b98f0 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -1058,14 +1058,15 @@ static void efi_capsule_scan_done(void)
*/
static efi_status_t check_run_capsules(void)
{
- u64 os_indications;
+ u64 os_indications = 0x0;
efi_uintn_t size;
efi_status_t r;
size = sizeof(os_indications);
r = efi_get_variable_int(u"OsIndications", &efi_global_variable_guid,
NULL, &size, &os_indications, NULL);
- if (r != EFI_SUCCESS || size != sizeof(os_indications))
+ if (!IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS) &&
+ (r != EFI_SUCCESS || size != sizeof(os_indications)))
return EFI_NOT_FOUND;
if (os_indications &
@@ -1084,7 +1085,7 @@ static efi_status_t check_run_capsules(void)
return EFI_SUCCESS;
} else if (IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS)) {
return EFI_SUCCESS;
- } else {
+ } else {
return EFI_NOT_FOUND;
}
}