I've created a nonvolatile UEFI variable via Linux efivarfs interface. I can get the value of the variable with efivar
command line. But when I try to get the value of that variable during boot phase via EDK2 GetVariable2()
I got "Not Found" error.
Here is the .dec file and C++ snippet:
[Guids]
gEfiMyTestGuid = {0x11c564cd, 0xb9f2, 0x4eb8, {0x94, 0x62, 0xe0, 0xba, 0x74, 0x56, 0x42, 0x36}}
extern EFI_GUID gEfiMyTestGuid;
....
....
VOID *Data;
UINTN DataSize;
EFI_STATUS Status;
Status = GetVariable2 (L"test", &gEfiMyTestGuid, &Data,
&DataSize);
if (EFI_ERROR (Status)) {
Print (L"Failure error: %r\n", Status);
return Status;
}