mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
Implement basic CPU detection
This commit is contained in:
@@ -195,7 +195,7 @@ B. Exit
|
|||||||
'If you plan to create the USB for another machine, please select the "Change Model" option in the menu.'
|
'If you plan to create the USB for another machine, please select the "Change Model" option in the menu.'
|
||||||
]
|
]
|
||||||
elif not self.constants.custom_model and self.current_model == "iMac7,1" and \
|
elif not self.constants.custom_model and self.current_model == "iMac7,1" and \
|
||||||
"SSE4.1" not in subprocess.run("sysctl machdep.cpu.features".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode():
|
DeviceProbe.pci_probe().cpu_feature("SSE4.1") is False:
|
||||||
in_between = [
|
in_between = [
|
||||||
'Your model requires a CPU upgrade to a CPU supporting SSE4.1+ to be supported by this patcher!',
|
'Your model requires a CPU upgrade to a CPU supporting SSE4.1+ to be supported by this patcher!',
|
||||||
'',
|
'',
|
||||||
|
|||||||
@@ -88,6 +88,15 @@ class pci_probe:
|
|||||||
print(f"- No IOService entry found for Wireless Card (I)")
|
print(f"- No IOService entry found for Wireless Card (I)")
|
||||||
return "", "", "", ""
|
return "", "", "", ""
|
||||||
|
|
||||||
|
def cpu_feature(self, instruction):
|
||||||
|
cpu_features = subprocess.run("sysctl machdep.cpu.features".split(), stdout=subprocess.PIPE).stdout.decode().partition(": ")[2].strip().split(" ")
|
||||||
|
if instruction in cpu_features:
|
||||||
|
print(f"- Found {instruction} support")
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print(f"- Failed to find {instruction} support")
|
||||||
|
return False
|
||||||
|
|
||||||
class smbios_probe:
|
class smbios_probe:
|
||||||
def model_detect(self, custom):
|
def model_detect(self, custom):
|
||||||
opencore_model: str = subprocess.run("nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|
opencore_model: str = subprocess.run("nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|
||||||
|
|||||||
Reference in New Issue
Block a user