diff --git a/Include/Guid/OcLogVariable.h b/Include/Guid/OcLogVariable.h deleted file mode 100755 index 14b191b2..00000000 --- a/Include/Guid/OcLogVariable.h +++ /dev/null @@ -1,31 +0,0 @@ -/** @file - Copyright (C) 2016, The HermitCrabs Lab. All rights reserved. - - All rights reserved. - - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -**/ - -#ifndef OC_LOG_VARIABLE_GUID_H -#define OC_LOG_VARIABLE_GUID_H - -#define OC_LOG_VARIABLE_NAME L"boot-log" - -#define OC_LOG_VARIABLE_PATH L"boot-path" - -/// Definition for OcLog Variable -/// 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102 -#define OC_LOG_VARIABLE_GUID \ - { \ - 0x4D1FDA02, 0x38C7, 0x4A6A, { 0x9C, 0xC6, 0x4B, 0xCC, 0xA8, 0xB3, 0x01, 0x02 } \ - } - -extern EFI_GUID gOcLogVariableGuid; - -#endif // OC_LOG_VARIABLE_GUID_H diff --git a/Include/Guid/LiluVariables.h b/Include/Guid/OcVariables.h similarity index 56% rename from Include/Guid/LiluVariables.h rename to Include/Guid/OcVariables.h index 4d23b4e1..d902c7c7 100644 --- a/Include/Guid/LiluVariables.h +++ b/Include/Guid/OcVariables.h @@ -1,7 +1,7 @@ /** @file - Lilu specific GUIDs for UEFI Variable Storage, version 1.0. + Lilu & OpenCore specific GUIDs for UEFI Variable Storage, version 1.0. -Copyright (c) 2018, vit9696. All rights reserved.
+Copyright (c) 2019, vit9696. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -12,12 +12,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ +#ifndef OC_VARIABLES_H +#define OC_VARIABLES_H + // -// 2660DD78-81D2-419D-8138-7B1F363F79A6 +// Variable used for OpenCore log storage (if enabled). +// +#define OC_LOG_VARIABLE_NAME L"boot-log" + +// +// Variable used for OpenCore boot path (if enabled). +// +#define OC_LOG_VARIABLE_PATH L"boot-path" + +// +// Variable used for OpenCore request to redirect NVRAM Boot variable write. +// See: https://github.com/acidanthera/bugtracker/issues/308. +// +#define OC_BOOT_REDIRECT_VARIABLE_NAME L"boot-redirect" + +// +// 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102 // This GUID is specifically used for normal variable access by Lilu kernel extension and its plugins. // -#define LILU_NORMAL_VARIABLE_GUID \ - { 0x2660DD78, 0x81D2, 0x419D, { 0x81, 0x38, 0x7B, 0x1F, 0x36, 0x3F, 0x79, 0xA6 } } +#define OC_VENDOR_VARIABLE_GUID \ + { 0x4D1FDA02, 0x38C7, 0x4A6A, { 0x9C, 0xC6, 0x4B, 0xCC, 0xA8, 0xB3, 0x01, 0x02 } } // // E09B9297-7928-4440-9AAB-D1F8536FBF0A @@ -25,7 +44,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Any writes to this GUID should be prohibited via EFI_RUNTIME_SERVICES after EXIT_BOOT_SERVICES. // The expected return code on variable write is EFI_SECURITY_VIOLATION. // -#define LILU_READ_ONLY_VARIABLE_GUID \ +#define OC_READ_ONLY_VARIABLE_GUID \ { 0xE09B9297, 0x7928, 0x4440, { 0x9A, 0xAB, 0xD1, 0xF8, 0x53, 0x6F, 0xBF, 0x0A } } // @@ -34,5 +53,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Any reads from this GUID should be prohibited via EFI_RUNTIME_SERVICES after EXIT_BOOT_SERVICES. // The expected return code on variable read is EFI_SECURITY_VIOLATION. // -#define LILU_WRITE_ONLY_VARIABLE_GUID \ +#define OC_WRITE_ONLY_VARIABLE_GUID \ { 0xF0B9AF8F, 0x2222, 0x4840, { 0x8A, 0x37, 0xEC, 0xF7, 0xCC, 0x8C, 0x12, 0xE1 } } + +// +// External global variables with GUID values. +// +extern EFI_GUID gOcVendorVariableGuid; +extern EFI_GUID gOcReadOnlyVariableGuid; +extern EFI_GUID gOcWriteOnlyVariableGuid; + +#endif // OC_VARIABLES_H diff --git a/Library/OcDebugLogLib/OcDebugLogLib.inf b/Library/OcDebugLogLib/OcDebugLogLib.inf index ca149a06..a04e257f 100755 --- a/Library/OcDebugLogLib/OcDebugLogLib.inf +++ b/Library/OcDebugLogLib/OcDebugLogLib.inf @@ -34,7 +34,7 @@ [Guids] gEfiMiscSubClassGuid - gOcLogVariableGuid + gOcVendorVariableGuid gApplePlatformProducerNameGuid [Protocols] diff --git a/Library/OcDebugLogLib/OcLog.c b/Library/OcDebugLogLib/OcLog.c index d59ad489..5091cf3c 100755 --- a/Library/OcDebugLogLib/OcLog.c +++ b/Library/OcDebugLogLib/OcLog.c @@ -14,7 +14,7 @@ #include -#include +#include #include @@ -258,7 +258,7 @@ OcLogAddEntry ( gRT->SetVariable ( OC_LOG_VARIABLE_NAME, - &gOcLogVariableGuid, + &gOcVendorVariableGuid, Attributes, AsciiStrSize (Private->AsciiBuffer), Private->AsciiBuffer diff --git a/OcSupportPkg.dec b/OcSupportPkg.dec index 90bbfc34..0c186368 100644 --- a/OcSupportPkg.dec +++ b/OcSupportPkg.dec @@ -23,7 +23,11 @@ Include [Guids] - gOcLogVariableGuid = { 0x4D1FDA02, 0x38C7, 0x4A6A, { 0x9C, 0xC6, 0x4B, 0xCC, 0xA8, 0xB3, 0x01, 0x02 }} + gOcVendorVariableGuid = { 0x4D1FDA02, 0x38C7, 0x4A6A, { 0x9C, 0xC6, 0x4B, 0xCC, 0xA8, 0xB3, 0x01, 0x02 }} + + gOcReadOnlyVariableGuid = { 0xE09B9297, 0x7928, 0x4440, { 0x9A, 0xAB, 0xD1, 0xF8, 0x53, 0x6F, 0xBF, 0x0A }} + + gOcWriteOnlyVariableGuid = { 0xF0B9AF8F, 0x2222, 0x4840, { 0x8A, 0x37, 0xEC, 0xF7, 0xCC, 0x8C, 0x12, 0xE1 }} ## OcSupport package token space guid gOcSupportPkgTokenSpaceGuid = { 0x38D40CB0, 0x7E37, 0x4CAA, { 0x91, 0xD3, 0x00, 0x47, 0x70, 0xA8, 0x73, 0x77 }}