mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 12:00:15 +10:00
sys_patch.py: Clean-up non-Metal enforcement during preflight & unpatch
This commit is contained in:
@@ -108,6 +108,7 @@ class PatchSysVolume:
|
|||||||
print("- Failed to revert snapshot via Apple's 'bless' command")
|
print("- Failed to revert snapshot via Apple's 'bless' command")
|
||||||
else:
|
else:
|
||||||
self.clean_skylight_plugins()
|
self.clean_skylight_plugins()
|
||||||
|
self.delete_nonmetal_enforcement()
|
||||||
self.constants.root_patcher_succeded = True
|
self.constants.root_patcher_succeded = True
|
||||||
print("- Unpatching complete")
|
print("- Unpatching complete")
|
||||||
print("\nPlease reboot the machine for patches to take effect")
|
print("\nPlease reboot the machine for patches to take effect")
|
||||||
@@ -193,6 +194,14 @@ class PatchSysVolume:
|
|||||||
else:
|
else:
|
||||||
print("- Creating SkylightPlugins folder")
|
print("- Creating SkylightPlugins folder")
|
||||||
utilities.process_status(utilities.elevated(["mkdir", "-p", f"{self.mount_application_support}/SkyLightPlugins/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
utilities.process_status(utilities.elevated(["mkdir", "-p", f"{self.mount_application_support}/SkyLightPlugins/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
|
||||||
|
def delete_nonmetal_enforcement(self):
|
||||||
|
use_metal = subprocess.run(["defaults", "read", "/Library/Preferences/com.apple.CoreDisplay", "useMetal"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
||||||
|
use_iop = subprocess.run(["defaults", "read", "/Library/Preferences/com.apple.CoreDisplay", "useIOP"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
||||||
|
if use_metal or use_iop in ["1", "true"]:
|
||||||
|
print("- Removing non-Metal Enforcement Preferences")
|
||||||
|
subprocess.run(["defaults", "delete", "/Library/Preferences/com.apple.CoreDisplay", "useMetal"])
|
||||||
|
subprocess.run(["defaults", "delete", "/Library/Preferences/com.apple.CoreDisplay", "useIOP"])
|
||||||
|
|
||||||
def write_patchset(self, patchset):
|
def write_patchset(self, patchset):
|
||||||
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
||||||
@@ -260,6 +269,8 @@ class PatchSysVolume:
|
|||||||
|
|
||||||
# Make sure old SkyLight plugins aren't being used
|
# Make sure old SkyLight plugins aren't being used
|
||||||
self.clean_skylight_plugins()
|
self.clean_skylight_plugins()
|
||||||
|
# Make sure non-Metal Enforcement preferences are not present
|
||||||
|
self.delete_nonmetal_enforcement()
|
||||||
|
|
||||||
# Make sure SNB kexts are compatible with the host
|
# Make sure SNB kexts are compatible with the host
|
||||||
if "Intel Sandy Bridge" in required_patches:
|
if "Intel Sandy Bridge" in required_patches:
|
||||||
|
|||||||
Reference in New Issue
Block a user