From 2286f19503b315044d4904232a5939ef28f40350 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Sat, 3 Oct 2020 17:16:11 +0300 Subject: [PATCH] join kext and kernel patches Signed-off-by: SergeySlice --- CloverPackage/package/po/clover.pot | 4 ++-- rEFIt_UEFI/Platform/Console.cpp | 5 ----- rEFIt_UEFI/Platform/Settings.cpp | 9 ++++++--- rEFIt_UEFI/refit/main.cpp | 10 +++++++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CloverPackage/package/po/clover.pot b/CloverPackage/package/po/clover.pot index 80f2ebb8c..96da5eff2 100644 --- a/CloverPackage/package/po/clover.pot +++ b/CloverPackage/package/po/clover.pot @@ -6,8 +6,8 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Clover r5120\n" -"POT-Creation-Date: 2020-07-17 15:12+0200\n" +"Project-Id-Version: Clover r5122\n" +"POT-Creation-Date: 2020-10-03 15:30+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rEFIt_UEFI/Platform/Console.cpp b/rEFIt_UEFI/Platform/Console.cpp index 4b77fc58c..861dd1bd5 100644 --- a/rEFIt_UEFI/Platform/Console.cpp +++ b/rEFIt_UEFI/Platform/Console.cpp @@ -21,11 +21,6 @@ #include // Only use angled for Platform, else, xcode project won't compile -extern "C" { -//#include "../../OpenCorePkg/Include/Acidanthera/OpenCore.h" -//#include "../../OpenCorePkg/Include/Acidanthera/Library/OcConsoleLib.h" -} - STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE CurrentMode = EfiConsoleControlScreenText; EFI_STATUS diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index dadeb0fe4..5708a436c 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -859,8 +859,8 @@ if ( Prop ) panic("config.plist/KernelAndKextPatches/OcKernelCache has been move // } { - const TagDict* OcQuirksDict = DictPointer->dictPropertyForKey("OcQuirks"); -if ( OcQuirksDict ) panic("config.plist/KernelAndKextPatches/OcQuirks has been merged in the config.plist/Quirks section. Update your config.plist"); +// const TagDict* OcQuirksDict = DictPointer->dictPropertyForKey("OcQuirks"); +//if ( OcQuirksDict ) panic("config.plist/KernelAndKextPatches/OcQuirks has been merged in the config.plist/Quirks section. Update your config.plist"); // if ( OcQuirksDict ) // { // Prop = OcQuirksDict->propertyForKey("AppleCpuPmCfgLock"); @@ -1266,6 +1266,8 @@ if ( OcQuirksDict ) panic("config.plist/KernelAndKextPatches/OcQuirks has been m } } DBG(" %s", newKernelPatch.Label.c_str()); + + newKernelPatch.Name = "kernel"_XS8; prop3 = Prop2->propertyForKey("Disabled"); newKernelPatch.MenuItem.BValue = !IsPropertyNotNullAndTrue(prop3); @@ -1392,8 +1394,9 @@ if ( OcQuirksDict ) panic("config.plist/KernelAndKextPatches/OcQuirks has been m MsgLog("ATTENTION : Comment property not string in KernelToPatch\n"); } } - DBG(" %s", newBootPatch.Label.c_str()); + + newBootPatch.Name = "boot.efi"_XS8; prop3 = Prop2->propertyForKey("Disabled"); newBootPatch.MenuItem.BValue = !IsPropertyNotNullAndTrue(prop3); diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 01088a542..b9c2ef788 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -1053,6 +1053,10 @@ DBG("Beginning OC\n"); { if ( KernelAndKextPatches.KextPatches[kextPatchIdx].MenuItem.BValue ) selectedPathArray.AddReference(&KernelAndKextPatches.KextPatches[kextPatchIdx], false); } + for (size_t kernelPatchIdx = 0 ; kernelPatchIdx < KernelAndKextPatches.KernelPatches.size() ; kernelPatchIdx++ ) + { + if ( KernelAndKextPatches.KernelPatches[kernelPatchIdx].MenuItem.BValue ) selectedPathArray.AddReference(&KernelAndKextPatches.KernelPatches[kernelPatchIdx], false); + } mOpenCoreConfiguration.Kernel.Patch.Count = (UINT32)selectedPathArray.size(); mOpenCoreConfiguration.Kernel.Patch.AllocCount = mOpenCoreConfiguration.Kernel.Patch.Count; mOpenCoreConfiguration.Kernel.Patch.ValueSize = sizeof(__typeof_am__(**mOpenCoreConfiguration.Kernel.Patch.Values)); @@ -1060,8 +1064,8 @@ DBG("Beginning OC\n"); memset(mOpenCoreConfiguration.Kernel.Patch.Values, 0, mOpenCoreConfiguration.Kernel.Patch.AllocCount*sizeof(*mOpenCoreConfiguration.Kernel.Patch.Values)); for (size_t kextPatchIdx = 0 ; kextPatchIdx < selectedPathArray.size() ; kextPatchIdx++ ) { - const KEXT_PATCH& kextPatch = selectedPathArray[kextPatchIdx]; - DBG("Bridge kext patch to OC : %s\n", kextPatch.Label.c_str()); + const KEXT_PATCH& kextPatch = selectedPathArray[kextPatchIdx]; //as well as kernel patches + DBG("Bridge %s patch to OC : %s\n", kextPatch.Name.c_str(), kextPatch.Label.c_str()); mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx] = (__typeof_am__(*mOpenCoreConfiguration.Kernel.Patch.Values))AllocateZeroPool(mOpenCoreConfiguration.Kernel.Patch.ValueSize); // sizeof(OC_KERNEL_ADD_ENTRY) == 680 OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx]->Arch, OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Scheme.KernelArch)); OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx]->Base, kextPatch.ProcedureName.c_str()); @@ -1088,7 +1092,7 @@ DBG("Beginning OC\n"); mOpenCoreConfiguration.Uefi.Output.ProvideConsoleGop = FALSE; //gSettings.ProvideConsoleGop; - OcProvideConsoleGop(gSettings.ProvideConsoleGop); + OcProvideConsoleGop(gSettings.ProvideConsoleGop); //do it before OcMain OC_STRING_ASSIGN(mOpenCoreConfiguration.Uefi.Output.Resolution, XString8(GlobalConfig.ScreenResolution).c_str()); OcMain(&mOpenCoreStorage, NULL);