Mykola Grymalyuk
2021-03-01 20:51:10 -07:00
parent 83df3e3e12
commit c47e21d02f
3 changed files with 42 additions and 33 deletions
+1
View File
@@ -9,6 +9,7 @@
- WhateverGreen 2e19d1b(1.4.8 release) - WhateverGreen 2e19d1b(1.4.8 release)
- Rework SMBIOS allowing both original and custom serials(Should resolve all iMessage issues) - Rework SMBIOS allowing both original and custom serials(Should resolve all iMessage issues)
- Support upgraded GPU detection in iMac10,x-12,x - Support upgraded GPU detection in iMac10,x-12,x
- Add Wifi card upgrade detection
## 0.0.10 ## 0.0.10
- Increment binaries - Increment binaries
+3 -5
View File
@@ -743,7 +743,6 @@ NVIDIAMXMGPUs = [
"0x1392",#GTX 860M "0x1392",#GTX 860M
"0x1199",#GTX 870M "0x1199",#GTX 870M
"0x11a9",#GTX 870M "0x11a9",#GTX 870M
"0x731f",
] ]
AMDMXMGPUs = [ AMDMXMGPUs = [
@@ -751,11 +750,10 @@ AMDMXMGPUs = [
"0x67e8",#AMD WX 4130/WX 4150 "0x67e8",#AMD WX 4130/WX 4150
"0x67e0",#AMD WX 4170 "0x67e0",#AMD WX 4170
"0x67c0",#AMD WX 7100 "0x67c0",#AMD WX 7100
"0x731f",
] ]
nativeWifi = [ nativeWifi = [
"0x43ba",#BCM43602 "ba430000",#BCM43602
"0x43a3",#BCM4350 "a3430000",#BCM4350
"0x43a0",#BCM4360 "a0430000",#BCM4360
] ]
+16 -6
View File
@@ -34,6 +34,12 @@ class BuildOpenCore:
self.config = None self.config = None
self.constants: Constants.Constants = versions self.constants: Constants.Constants = versions
def hexswap(self, input_hex: str):
hex_pairs = [input_hex[i:i + 2] for i in range(0, len(input_hex), 2)]
hex_rev = hex_pairs[::-1]
hex_str = "".join(["".join(x) for x in hex_rev])
return hex_str.upper()
def build_efi(self): def build_efi(self):
utilities.cls() utilities.cls()
if not Path(self.constants.build_path).exists(): if not Path(self.constants.build_path).exists():
@@ -87,6 +93,12 @@ class BuildOpenCore:
# WiFi patches # WiFi patches
wifi_devices = plistlib.loads(subprocess.run(f"ioreg -c IOPCIDevice -r -d2 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
wifi_devices = [i for i in wifi_devices if i["vendor-id"] == binascii.unhexlify("E4140000") and i["class-code"] == binascii.unhexlify("00800200")]
wifi_devices = wifi_devices[0]
if (self.constants.custom_model) == "None" & (self.hexswap(binascii.hexlify(wifi_devices["vendor-id"]).decode()[:4]) in ModelArray.nativeWifi):
print("- Skipping wifi patches")
else:
if self.model in ModelArray.WifiAtheros: if self.model in ModelArray.WifiAtheros:
self.enable_kext("IO80211HighSierra.kext", self.constants.io80211high_sierra_version, self.constants.io80211high_sierra_path) self.enable_kext("IO80211HighSierra.kext", self.constants.io80211high_sierra_version, self.constants.io80211high_sierra_path)
self.get_kext_by_bundle_path("IO80211HighSierra.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True self.get_kext_by_bundle_path("IO80211HighSierra.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True
@@ -139,12 +151,10 @@ class BuildOpenCore:
self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["UIScale"] = binascii.unhexlify("02") self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["UIScale"] = binascii.unhexlify("02")
# Check GPU Vendor # Check GPU Vendor
if self.constants.custom_model != "None": if self.constants.custom_model == "None":
#current_gpu: str = subprocess.run("system_profiler SPDisplaysDataType".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() current_gpu: str = subprocess.run("system_profiler SPDisplaysDataType".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
#current_gpuv = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Vendor"))][0] current_gpuv = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Vendor"))][0]
#current_gpud = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Device ID"))][0] current_gpud = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Device ID"))][0]
current_gpuv = "NVIDIA (0x10de)"
current_gpud = "0x11a9"
print(f"- Detected GPU: {current_gpuv} {current_gpud}") print(f"- Detected GPU: {current_gpuv} {current_gpud}")
if (current_gpuv == "AMD (0x1002)") & (current_gpud in ModelArray.AMDMXMGPUs): if (current_gpuv == "AMD (0x1002)") & (current_gpud in ModelArray.AMDMXMGPUs):
self.constants.custom_mxm_gpu = True self.constants.custom_mxm_gpu = True