make block skywalk to be conditional

Signed-off-by: Slice <sergey.slice@gmail.com>
This commit is contained in:
Slice 2023-08-27 22:14:02 +03:00
parent c653a7378a
commit 2711170df4
4 changed files with 1351 additions and 1342 deletions

File diff suppressed because it is too large Load Diff

View File

@ -194,6 +194,7 @@ public:
XBool KPPanicNoKextDump = XBool();
XBool _KPAppleIntelCPUPM = XBool();
XBool KPAppleRTC = XBool();
XBool BlockSkywalk = XBool();
XBool EightApple = XBool();
XBool KPDELLSMBIOS = XBool(); // Dell SMBIOS patch
UINT32 FakeCPUID = UINT32();
@ -220,6 +221,7 @@ public:
if ( !(_KPAppleIntelCPUPM == other._KPAppleIntelCPUPM ) ) return false;
if ( !(KPAppleRTC == other.KPAppleRTC ) ) return false;
if ( !(EightApple == other.EightApple ) ) return false;
if ( !(BlockSkywalk == other.BlockSkywalk ) ) return false;
if ( !(KPDELLSMBIOS == other.KPDELLSMBIOS ) ) return false;
if ( !(FakeCPUID == other.FakeCPUID ) ) return false;
if ( !(KPATIConnectorsController == other.KPATIConnectorsController ) ) return false;
@ -240,6 +242,7 @@ public:
KPPanicNoKextDump = other.dgetKPPanicNoKextDump();
_KPAppleIntelCPUPM = other.dget_KPAppleIntelCPUPM();
KPAppleRTC = other.dgetKPAppleRTC();
BlockSkywalk = other.dgetBlockSkywalk();
EightApple = other.dgetEightApple();
KPDELLSMBIOS = other.dgetKPDELLSMBIOS();
FakeCPUID = other.dgetFakeCPUID();

View File

@ -243,6 +243,7 @@ public:
XmlBool PanicNoKextDump = XmlBool();
XmlBool AppleIntelCPUPM = XmlBool();
XmlBool AppleRTC = XmlBool();
XmlBool BlockSkywalk = XmlBool();
XmlBool EightApple = XmlBool();
XmlBool DellSMBIOSPatch = XmlBool();
XmlUInt32 FakeCPUID = XmlUInt32();
@ -254,7 +255,7 @@ public:
XmlArray<KernelAndKextPatches_KernelToPatch_Class> KernelToPatch = XmlArray<KernelAndKextPatches_KernelToPatch_Class>();
XmlArray<KernelAndKextPatches_BootPatch_Class> BootPatches = XmlArray<KernelAndKextPatches_BootPatch_Class>();
XmlDictField m_fields[17] = {
XmlDictField m_fields[18] = {
{"Debug", Debug},
{"KernelLapic", KernelLapic},
{"KernelXCPM", KernelXCPM},
@ -262,6 +263,7 @@ public:
{"PanicNoKextDump", PanicNoKextDump},
{"AppleIntelCPUPM", AppleIntelCPUPM},
{"AppleRTC", AppleRTC},
{"BlockSkywalk", BlockSkywalk},
{"EightApple", EightApple},
{"DellSMBIOSPatch", DellSMBIOSPatch},
{"FakeCPUID", FakeCPUID},
@ -313,6 +315,7 @@ public:
XBool dgetKPPanicNoKextDump() const { return PanicNoKextDump.isDefined() ? PanicNoKextDump.value() : XBool(false); };
XBool dget_KPAppleIntelCPUPM() const { return AppleIntelCPUPM.isDefined() ? AppleIntelCPUPM.value() : XBool(false); };
XBool dgetKPAppleRTC() const { return AppleRTC.isDefined() ? AppleRTC.value() : XBool(true); };
XBool dgetBlockSkywalk() const { return BlockSkywalk.isDefined() ? BlockSkywalk.value() : XBool(true); };
XBool dgetEightApple() const { return EightApple.isDefined() ? EightApple.value() : XBool(false); };
XBool dgetKPDELLSMBIOS() const { return DellSMBIOSPatch.isDefined() ? DellSMBIOSPatch.value() : XBool(false); };
uint32_t dgetFakeCPUID() const { return FakeCPUID.isDefined() ? FakeCPUID.value() : 0; };

View File

@ -1137,24 +1137,25 @@ void LOADER_ENTRY::StartLoader()
DBG("assign executable as '%s'\n", mOpenCoreConfiguration.Kernel.Force.Values[kextIdx]->ExecutablePath.Value);
}
if (gSettings.KernelAndKextPatches.BlockSkywalk) {
mOpenCoreConfiguration.Kernel.Block.Count = 1;
mOpenCoreConfiguration.Kernel.Block.AllocCount = 1;
mOpenCoreConfiguration.Kernel.Block.ValueSize = sizeof(__typeof_am__(**mOpenCoreConfiguration.Kernel.Block.Values));
valuesSize = mOpenCoreConfiguration.Kernel.Block.AllocCount*sizeof(*mOpenCoreConfiguration.Kernel.Block.Values);
mOpenCoreConfiguration.Kernel.Block.Values = (OC_KERNEL_BLOCK_ENTRY**)malloc(valuesSize);
mOpenCoreConfiguration.Kernel.Block.Count = 1;
mOpenCoreConfiguration.Kernel.Block.AllocCount = 1;
mOpenCoreConfiguration.Kernel.Block.ValueSize = sizeof(__typeof_am__(**mOpenCoreConfiguration.Kernel.Block.Values));
valuesSize = mOpenCoreConfiguration.Kernel.Block.AllocCount*sizeof(*mOpenCoreConfiguration.Kernel.Block.Values);
mOpenCoreConfiguration.Kernel.Block.Values = (OC_KERNEL_BLOCK_ENTRY**)malloc(valuesSize);
memset(mOpenCoreConfiguration.Kernel.Block.Values, 0, valuesSize);
memset(mOpenCoreConfiguration.Kernel.Block.Values, 0, valuesSize);
mOpenCoreConfiguration.Kernel.Block.Values[0] = (__typeof_am__(*mOpenCoreConfiguration.Kernel.Block.Values))malloc(mOpenCoreConfiguration.Kernel.Block.ValueSize);
memset(mOpenCoreConfiguration.Kernel.Block.Values[0], 0, mOpenCoreConfiguration.Kernel.Block.ValueSize);
mOpenCoreConfiguration.Kernel.Block.Values[0]->Enabled = 1;
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Arch, OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Scheme.KernelArch));
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Comment, "");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MaxKernel, "");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MinKernel, "23");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Identifier, "com.apple.iokit.IOSkywalkFamily");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Strategy, "Exclude");
mOpenCoreConfiguration.Kernel.Block.Values[0] = (__typeof_am__(*mOpenCoreConfiguration.Kernel.Block.Values))malloc(mOpenCoreConfiguration.Kernel.Block.ValueSize);
memset(mOpenCoreConfiguration.Kernel.Block.Values[0], 0, mOpenCoreConfiguration.Kernel.Block.ValueSize);
mOpenCoreConfiguration.Kernel.Block.Values[0]->Enabled = 1;
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Arch, OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Scheme.KernelArch));
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Comment, "");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MaxKernel, "");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MinKernel, "23");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Identifier, "com.apple.iokit.IOSkywalkFamily");
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Strategy, "Exclude");
}
#endif
mOpenCoreConfiguration.Uefi.Output.ProvideConsoleGop = gSettings.GUI.ProvideConsoleGop;