mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 11:30:15 +10:00
SysPatch.py: Fix AMD linking
This commit is contained in:
@@ -889,7 +889,7 @@ NoRootPatch11 = [
|
|||||||
"Xserve3,1",
|
"Xserve3,1",
|
||||||
]
|
]
|
||||||
|
|
||||||
DeleteAccel11 = [
|
DeleteNvidiaAccel11 = [
|
||||||
"AMDRadeonX4000.kext",
|
"AMDRadeonX4000.kext",
|
||||||
"AMDRadeonX4000HWServices.kext",
|
"AMDRadeonX4000HWServices.kext",
|
||||||
"AMDRadeonX5000.kext",
|
"AMDRadeonX5000.kext",
|
||||||
@@ -914,12 +914,14 @@ DeleteAccel11 = [
|
|||||||
"GeForce.kext",
|
"GeForce.kext",
|
||||||
"IOAcceleratorFamily2.kext",
|
"IOAcceleratorFamily2.kext",
|
||||||
"IOGPUFamily.kext",
|
"IOGPUFamily.kext",
|
||||||
"IOSurface.kext",
|
]
|
||||||
# May need to delete for AMD GPU acceleration
|
|
||||||
#"AMD8000Controller.kext" # AMDSupport Dependancy
|
DeleteAMDAccel11 = [
|
||||||
#"AMD9000Controller.kext" # AMDSupport Dependancy
|
"AMD7000Controller.kext", # AMDSupport Dependancy
|
||||||
#"AMD9500Controller.kext" # IOAccelertor Dependancy
|
"AMD8000Controller.kext", # AMDSupport Dependancy
|
||||||
#"AMD10000Controller.kext" # AMDSupport Dependancy
|
"AMD9000Controller.kext", # AMDSupport Dependancy
|
||||||
|
"AMD9500Controller.kext", # AMDSupport Dependancy
|
||||||
|
"AMD10000Controller.kext", # AMDSupport Dependancy
|
||||||
]
|
]
|
||||||
|
|
||||||
AddNvidiaAccel11 = [
|
AddNvidiaAccel11 = [
|
||||||
@@ -929,6 +931,7 @@ AddNvidiaAccel11 = [
|
|||||||
"GeForceTeslaVADriver.bundle",
|
"GeForceTeslaVADriver.bundle",
|
||||||
"NVDANV50HalTesla.kext",
|
"NVDANV50HalTesla.kext",
|
||||||
"NVDAResmanTesla.kext",
|
"NVDAResmanTesla.kext",
|
||||||
|
"IOSurface.kext",
|
||||||
]
|
]
|
||||||
|
|
||||||
AddAMDAccel11 = [
|
AddAMDAccel11 = [
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ class PatchSysVolume:
|
|||||||
else:
|
else:
|
||||||
print("- Could not find root volume")
|
print("- Could not find root volume")
|
||||||
|
|
||||||
def delete_old_binaries(self):
|
def delete_old_binaries(self, vendor_patch):
|
||||||
for delete_current_kext in ModelArray.DeleteAccel11:
|
for delete_current_kext in vendor_patch:
|
||||||
delete_path = Path(self.mount_extensions) / Path(delete_current_kext)
|
delete_path = Path(self.mount_extensions) / Path(delete_current_kext)
|
||||||
if Path(delete_path).exists():
|
if Path(delete_path).exists():
|
||||||
print(f"- Deleting {delete_current_kext}")
|
print(f"- Deleting {delete_current_kext}")
|
||||||
@@ -87,36 +87,37 @@ class PatchSysVolume:
|
|||||||
|
|
||||||
def gpu_accel_patches_11(self):
|
def gpu_accel_patches_11(self):
|
||||||
print("- Deleting unsupported Binaries")
|
print("- Deleting unsupported Binaries")
|
||||||
self.delete_old_binaries()
|
|
||||||
print("- Adding supported Binaries for GPU Accleration")
|
print("- Adding supported Binaries for GPU Accleration")
|
||||||
|
|
||||||
# TODO: Add proper hardware checks
|
# TODO: Add proper hardware checks
|
||||||
# Due to MUX-based laptops and headless iGPUs, it's difficult to determine what GPU is present
|
# Due to MUX-based laptops and headless iGPUs, it's difficult to determine what GPU is present
|
||||||
# Fix would be to parse IOReg for both IGPU and GFX0
|
# Fix would be to parse IOReg for both IGPU and GFX0
|
||||||
if self.model in ModelArray.LegacyGPUNvidia:
|
if self.model in ModelArray.LegacyGPUNvidia:
|
||||||
print("- Adding legacy Nvidia Kexts and Bundles")
|
print("- Merging legacy Nvidia Kexts and Bundles")
|
||||||
|
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
|
||||||
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
|
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
|
||||||
elif self.model in ModelArray.LegacyGPUAMD:
|
elif self.model in ModelArray.LegacyGPUAMD:
|
||||||
print("- Adding legacy AMD Kexts and Bundles")
|
print("- Merging legacy AMD Kexts and Bundles")
|
||||||
|
self.delete_old_binaries(ModelArray.DeleteAMDAccel11)
|
||||||
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
|
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
|
||||||
if self.model in ModelArray.LegacyGPUIntelGen1:
|
if self.model in ModelArray.LegacyGPUIntelGen1:
|
||||||
print("- Adding legacy Intel 1st Gen Kexts and Bundles")
|
print("- Merging legacy Intel 1st Gen Kexts and Bundles")
|
||||||
self.add_new_binaries(ModelArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
|
self.add_new_binaries(ModelArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
|
||||||
elif self.model in ModelArray.LegacyGPUIntelGen2:
|
elif self.model in ModelArray.LegacyGPUIntelGen2:
|
||||||
print("- Adding legacy Intel 2nd Gen Kexts and Bundles")
|
print("- Merging legacy Intel 2nd Gen Kexts and Bundles")
|
||||||
self.add_new_binaries(ModelArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
|
self.add_new_binaries(ModelArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
|
||||||
# iMac10,1 came in both AMD and Nvidia GPU models, so we must do hardware detection
|
# iMac10,1 came in both AMD and Nvidia GPU models, so we must do hardware detection
|
||||||
if self.model == "iMac10,1":
|
if self.model == "iMac10,1":
|
||||||
if self.constants.current_gpuv == "AMD (0x1002)":
|
if self.constants.current_gpuv == "AMD (0x1002)":
|
||||||
print("- Adding legacy AMD Kexts and Bundles")
|
print("- Merging legacy AMD Kexts and Bundles")
|
||||||
|
self.delete_old_binaries(ModelArray.DeleteAMDAccel11)
|
||||||
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
|
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
|
||||||
else:
|
else:
|
||||||
print("- Adding legacy Nvidia Kexts and Bundles")
|
print("- Merging legacy Nvidia Kexts and Bundles")
|
||||||
|
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
|
||||||
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
|
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
|
||||||
|
|
||||||
print("- Adding Catalina's IOSurface.kext")
|
|
||||||
subprocess.run(f"sudo cp -R {self.constants.iosurface_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
|
|
||||||
# Frameworks
|
# Frameworks
|
||||||
print("- Merging legacy Frameworks")
|
print("- Merging legacy Frameworks")
|
||||||
subprocess.run(f"sudo ditto {self.constants.payload_apple_frameworks_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo ditto {self.constants.payload_apple_frameworks_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|||||||
Reference in New Issue
Block a user