Allow Legacy Acceleration Patches on Mac Pros and Xserves

This commit is contained in:
Mykola Grymalyuk
2021-04-21 18:13:02 -06:00
parent d4b55ad0e4
commit d482443f0e
5 changed files with 22 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
- Note ATI/AMD TeraScale 2 unsupported (HD 5/6000)
- Add better kmutil crash handling
- Fix build crashing when no wifi card is present
- Allow Legacy Acceleration Patches on Mac Pros and Xserves
## 0.1.0
- Fix crash on iMacs with Metal GPUs

View File

@@ -93,6 +93,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"DRM Preferences:\t\t\tCurrently {self.constants.drm_support}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).drm_setting],
[f"Set Generic Bootstrap:\t\t{self.constants.boot_efi}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).bootstrap_setting],
[f"Set Accleration Patches:\t\t{self.constants.legacy_acceleration_patch}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).accel_setting],
[f"Assume Legacy GPU:\t\t\t{self.constants.assume_legacy}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).force_accel_setting],
]
for option in options:

View File

@@ -293,5 +293,22 @@ important data backed up in case of emergencies
self.constants.legacy_acceleration_patch = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.legacy_acceleration_patch = False
else:
print("Invalid option")
def force_accel_setting(self):
Utilities.cls()
Utilities.header(["Assume Legacy GPU"])
print("""Allows any model to force install Legacy Acceleration
patches. Only required for Mac Pro and Xserve users.
DO NOT RUN IF METAL GPU IS INSTALLED
""")
change_menu = input("Enable Beta Acceleration Patches(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.assume_legacy = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.assume_legacy = False
else:
print("Invalid option")

View File

@@ -71,6 +71,7 @@ class Constants:
self.boot_efi = False
self.drm_support = False
self.legacy_acceleration_patch = False
self.assume_legacy = False
# OS Versions
self.tiger = 8

View File

@@ -205,7 +205,7 @@ class PatchSysVolume:
print("- Preparing Files")
subprocess.run(f"sudo find {self.constants.payload_apple_root_path} -name '.DS_Store' -delete".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
if self.model in ModelArray.LegacyGPU:
if self.model in ModelArray.LegacyGPU or self.constants.assume_legacy is True:
self.check_pciid()
if self.dgpu_devices and self.dgpu_vendor == self.constants.pci_amd_ati and self.dgpu_device in ModelArray.AMDMXMGPUs:
print("- Detected Metal-based AMD GPU, skipping legacy patches")
@@ -351,7 +351,7 @@ class PatchSysVolume:
# Check SIP
if self.constants.custom_model is not None:
print("Root Patching must be done on target machine!")
elif self.model in ModelArray.NoRootPatch11:
elif self.model in ModelArray.NoRootPatch11 and self.constants.assume_legacy is False:
print("Root Patching not required for this machine!")
elif self.model not in ModelArray.SupportedSMBIOS:
print("Cannot run on this machine, model is unsupported!")