mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 06:10:00 +10:00
Add user-configurable CPUFriend
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/199
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
- Innie 0ccd95e (1.3.0 release - 01-16-2021)
|
- Innie 0ccd95e (1.3.0 release - 01-16-2021)
|
||||||
- Fix MacBookPro5,4 audio support
|
- Fix MacBookPro5,4 audio support
|
||||||
- Increment binaries
|
- Increment binaries
|
||||||
- AppleALC fceb8b0 (1.6.1 rolling - 05-04-2021)
|
- AppleALC 58b57ee (1.6.1 rolling - 05-07-2021)
|
||||||
- Support custom CPU names in About This Mac
|
- Support custom CPU names in About This Mac
|
||||||
- Fix NightShift accidentally disabling on Minimal SMBIOS configs
|
- Fix NightShift accidentally disabling on Minimal SMBIOS configs
|
||||||
- Fix iMac9,1 audio support
|
- Fix iMac9,1 audio support
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
|||||||
[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],
|
[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],
|
||||||
[f"Allow OpenCore on native Models:\t{self.constants.allow_oc_everywhere}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).allow_native_models],
|
[f"Allow OpenCore on native Models:\t{self.constants.allow_oc_everywhere}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).allow_native_models],
|
||||||
[f"Download more RAM:\t\t\t{self.constants.download_ram}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).download_more_ram_dot_com],
|
[f"Download more RAM:\t\t\t{self.constants.download_ram}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).download_more_ram_dot_com],
|
||||||
|
[f"Disable CPU Friend:\t\t{self.constants.disallow_cpufriend}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).disable_cpufriend],
|
||||||
[f"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_cpu],
|
[f"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_cpu],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+12
-6
@@ -92,7 +92,7 @@ class BuildOpenCore:
|
|||||||
("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket),
|
("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket),
|
||||||
("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: self.model in ModelArray.SSEEmulator),
|
("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: self.model in ModelArray.SSEEmulator),
|
||||||
("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: self.model in ModelArray.MissingSSE42),
|
("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: self.model in ModelArray.MissingSSE42),
|
||||||
("CPUFriend.kext", self.constants.cpufriend_version, self.constants.cpufriend_path, lambda: self.model != "iMac7,1" and self.constants.allow_oc_everywhere is False),
|
("CPUFriend.kext", self.constants.cpufriend_version, self.constants.cpufriend_path, lambda: self.model != "iMac7,1" and self.constants.allow_oc_everywhere is False and self.constants.disallow_cpufriend is False),
|
||||||
# Ethernet patches
|
# Ethernet patches
|
||||||
("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: self.model in ModelArray.EthernetNvidia),
|
("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: self.model in ModelArray.EthernetNvidia),
|
||||||
("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: self.model in ModelArray.EthernetMarvell),
|
("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: self.model in ModelArray.EthernetMarvell),
|
||||||
@@ -312,12 +312,18 @@ class BuildOpenCore:
|
|||||||
# AGPM Patch
|
# AGPM Patch
|
||||||
if self.model in ModelArray.DualGPUPatch:
|
if self.model in ModelArray.DualGPUPatch:
|
||||||
print("- Adding dual GPU patch")
|
print("- Adding dual GPU patch")
|
||||||
|
if not self.constants.custom_model:
|
||||||
|
gfx0_path: str = subprocess.run([self.constants.gfxutil_path] + f"-f GFX0".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|
||||||
|
if gfx0_path == "":
|
||||||
|
gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
||||||
|
else:
|
||||||
|
gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
||||||
if self.model in ModelArray.IntelNvidiaDRM and self.constants.drm_support is True:
|
if self.model in ModelArray.IntelNvidiaDRM and self.constants.drm_support is True:
|
||||||
print("- Prioritizing DRM support over Intel QuickSync")
|
print("- Prioritizing DRM support over Intel QuickSync")
|
||||||
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696", "shikigva": 256}
|
self.config["DeviceProperties"]["Add"][gfx0_path] = {"agdpmod": "vit9696", "shikigva": 256}
|
||||||
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"disable-gpu-min": "20.0.0"}
|
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"disable-gpu-min": "20.0.0"}
|
||||||
else:
|
else:
|
||||||
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696"}
|
self.config["DeviceProperties"]["Add"][gfx0_path] = {"agdpmod": "vit9696"}
|
||||||
|
|
||||||
# HiDPI OpenCanopy and FileVault
|
# HiDPI OpenCanopy and FileVault
|
||||||
if self.model in ModelArray.HiDPIpicker:
|
if self.model in ModelArray.HiDPIpicker:
|
||||||
@@ -342,12 +348,12 @@ class BuildOpenCore:
|
|||||||
print(f"- Found GFX0 device at {self.gfx0_path}")
|
print(f"- Found GFX0 device at {self.gfx0_path}")
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print("- Failed to find GFX0 Device path, falling back on known logic")
|
print("- Failed to find GFX0 Device path, falling back on known logic")
|
||||||
if self.model == ["iMac11,1", "iMac11,3"]:
|
if self.model in ["iMac11,1", "iMac11,3"]:
|
||||||
self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
|
self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
|
||||||
else:
|
else:
|
||||||
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
||||||
else:
|
else:
|
||||||
if self.model == ["iMac11,1", "iMac11,3"]:
|
if self.model in ["iMac11,1", "iMac11,3"]:
|
||||||
self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
|
self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
|
||||||
else:
|
else:
|
||||||
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
||||||
@@ -635,7 +641,7 @@ class BuildOpenCore:
|
|||||||
self.config["PlatformInfo"]["CustomMemory"] = True
|
self.config["PlatformInfo"]["CustomMemory"] = True
|
||||||
|
|
||||||
# USB Map and CPUFriend Patching
|
# USB Map and CPUFriend Patching
|
||||||
if self.constants.allow_oc_everywhere is False and self.model != "iMac7,1":
|
if self.constants.allow_oc_everywhere is False and self.model != "iMac7,1" and self.constants.disallow_cpufriend is False:
|
||||||
new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
|
new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
|
||||||
map_config = plistlib.load(Path(new_map_ls).open("rb"))
|
map_config = plistlib.load(Path(new_map_ls).open("rb"))
|
||||||
|
|
||||||
|
|||||||
@@ -396,3 +396,19 @@ Currently only offers 1.5TB bundles
|
|||||||
self.constants.download_ram = False
|
self.constants.download_ram = False
|
||||||
else:
|
else:
|
||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
|
def disable_cpufriend(self):
|
||||||
|
Utilities.cls()
|
||||||
|
Utilities.header(["Disable CPU Friend?"])
|
||||||
|
print("""Only recommended for advanced users
|
||||||
|
Disabling CPUFriend forces macOS into using a different
|
||||||
|
Mac's power profile for CPUs and GPUs, which can harm the
|
||||||
|
hardware
|
||||||
|
""")
|
||||||
|
change_menu = input("Disable CPU Friend?(y/n): ")
|
||||||
|
if change_menu == "y":
|
||||||
|
self.constants.disallow_cpufriend = True
|
||||||
|
elif change_menu == "n":
|
||||||
|
self.constants.disallow_cpufriend = False
|
||||||
|
else:
|
||||||
|
print("Invalid option")
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class Constants:
|
|||||||
self.custom_cpu_model_value = ""
|
self.custom_cpu_model_value = ""
|
||||||
self.custom_color = ""
|
self.custom_color = ""
|
||||||
self.download_ram = False
|
self.download_ram = False
|
||||||
|
self.disallow_cpufriend = False
|
||||||
|
|
||||||
# OS Versions
|
# OS Versions
|
||||||
self.tiger = 8
|
self.tiger = 8
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user