X-Git-Url: https://code.delx.au/refind/blobdiff_plain/e8d54384d2b49983ba17471527db797159bfede4..HEAD:/refind/apple.c diff --git a/refind/apple.c b/refind/apple.c index 6225d9a..437b523 100644 --- a/refind/apple.c +++ b/refind/apple.c @@ -24,12 +24,15 @@ #include "lib.h" #include "screen.h" #include "apple.h" +#include "mystrings.h" #include "refit_call_wrapper.h" CHAR16 gCsrStatus[256]; // Get CSR (Apple's System Integrity Protection [SIP], or "rootless") status -// information. +// information. If the variable is not present and the firmware is Apple, fake +// it and claim it's enabled, since that's how OS X 10.11 treats a system with +// the variable absent. EFI_STATUS GetCsrStatus(UINT32 *CsrStatus) { UINT32 *ReturnValue = NULL; UINTN CsrLength; @@ -46,6 +49,9 @@ EFI_STATUS GetCsrStatus(UINT32 *CsrStatus) { SPrint(gCsrStatus, 255, L" Unknown System Integrity Protection version"); } MyFreePool(ReturnValue); + } else if ((Status == EFI_NOT_FOUND) && (StriSubCmp(L"Apple", ST->FirmwareVendor))) { + *CsrStatus = SIP_ENABLED; + Status = EFI_SUCCESS; } // if (Status == EFI_SUCCESS) } // if (CsrStatus) return Status; @@ -76,7 +82,7 @@ VOID RecordgCsrStatus(UINT32 CsrStatus, BOOLEAN DisplayMessage) { egDisplayMessage(gCsrStatus, &BGColor); PauseSeconds(3); } // if -} // VOID RecordgCsrStatus +} // VOID RecordgCsrStatus() // Find the current CSR status and reset it to the next one in the // GlobalConfig.CsrValues list, or to the first value if the current @@ -156,7 +162,7 @@ EFI_STATUS SetAppleOSInfo() { Print(L"Out of resources in SetAppleOSInfo!\n"); } if ((Status == EFI_SUCCESS) && (SetOs->Version == 2)) - Status = refit_call1_wrapper (SetOs->SetOsVendor, "Apple Inc."); + Status = refit_call1_wrapper (SetOs->SetOsVendor, (CHAR8 *) "Apple Inc."); MyFreePool(AppleOSVersion); } // if (AppleOSVersion) } // if