Fix crashing on custom models

This commit is contained in:
Mykola Grymalyuk
2021-04-20 09:11:56 -06:00
parent bd4564f98e
commit c78f7d0bdb
2 changed files with 4 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ class OpenCoreLegacyPatcher():
self.constants.serial_settings = "Moderate"
if self.current_model in ModelArray.LegacyGPU:
Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).check_pciid(False)
if not (self.constants.dgpu_devices and self.constants.dgpu_vendor == self.constants.pci_amd_ati and self.constants.dgpu_device in ModelArray.AMDMXMGPUs) or not (self.constants.dgpu_devices and self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs):
if not (self.constants.dgpu_vendor == self.constants.pci_amd_ati and self.constants.dgpu_device in ModelArray.AMDMXMGPUs) or not (self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs):
self.constants.sip_status = False
self.constants.secure_status = False

View File

@@ -318,9 +318,9 @@ class BuildOpenCore:
print("- Failed to find vendor")
elif not self.constants.custom_model:
self.check_pciid(True)
if self.constants.dgpu_devices and self.constants.dgpu_vendor == self.constants.pci_amd_ati and self.constants.dgpu_device in ModelArray.AMDMXMGPUs:
if self.constants.dgpu_vendor == self.constants.pci_amd_ati and self.constants.dgpu_device in ModelArray.AMDMXMGPUs:
amd_patch(self)
elif self.constants.dgpu_devices and self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs:
elif self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs:
nvidia_patch(self)
if self.model in ModelArray.MacPro71:
print("- Adding Mac Pro, Xserve DRM patches")
@@ -416,7 +416,7 @@ class BuildOpenCore:
print("- Spoofing to iMacPro1,1")
spoofed_model = "iMacPro1,1"
spoofed_board = "Mac-7BA5B2D9E42DDD94"
elif self.constants.dgpu_devices and self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs:
elif self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs and not self.constants.custom_model:
print("- Spoofing to iMacPro1,1")
spoofed_model = "iMacPro1,1"
spoofed_board = "Mac-7BA5B2D9E42DDD94"