add some apple variables

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2022-08-29 22:44:10 +03:00
parent 6890d48124
commit f63935320d

View File

@ -51,6 +51,8 @@
#include <Protocol/AppleImageCodecProtocol.h>
#define EFI_CPU_DATA_MAXIMUM_LENGTH 0x100
const char CDM[16] = "sha2-384";
const char HW[16] = "x86legacyap";
// gDataHub
/// A pointer to the DataHubProtocol
@ -465,6 +467,13 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
//clear OC present
DeleteNvramVariable(L"opencore-version", gEfiAppleBootGuid);
//Now we want manually install some SecureBoot Variables while boot.efi do this automatically.
//set same values
UINT64 ecid = 0;
CopyMem(&ecid, &uuid, 8);
SetNvramVariable(L"ApECID", gAppleSecureBootVariableGuid, Attributes, 8, &ecid);
SetNvramVariable(L"HardwareModel", gAppleSecureBootVariableGuid, Attributes, 16, HW);
return EFI_SUCCESS;
}