Fix CPU Renaming on non-i5 models

This commit is contained in:
Mykola Grymalyuk
2021-05-03 23:49:43 -06:00
parent aba21bca43
commit 1957e70cfd
5 changed files with 285 additions and 5 deletions

View File

@@ -120,6 +120,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"Set Acceleration 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],
[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"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_cpu],
]

View File

@@ -600,6 +600,8 @@ class BuildOpenCore:
# Setup menu
def minimal_serial_patch(self):
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
self.config["PlatformInfo"]["PlatformNVRAM"]["ProcessorType"] = 1537
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board
@@ -608,6 +610,8 @@ class BuildOpenCore:
self.config["PlatformInfo"]["UpdateSMBIOS"] = True
def moderate_serial_patch(self):
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
self.config["PlatformInfo"]["Automatic"] = True
self.config["PlatformInfo"]["UpdateDataHub"] = True
@@ -617,6 +621,8 @@ class BuildOpenCore:
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
def advanced_serial_patch(self):
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
@@ -642,6 +648,11 @@ class BuildOpenCore:
self.spoofed_model = self.model
minimal_serial_patch(self)
if self.constants.download_ram is False:
self.config["PlatformInfo"].pop("Memory")
else:
print("- Inserting 1.5TB of RAM into your Mac")
# USB Map and CPUFriend Patching
if self.constants.allow_oc_everywhere is False and self.model != "iMac7,1":
new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
@@ -679,10 +690,6 @@ class BuildOpenCore:
plistlib.dump(cpu_config, Path(new_cpu_ls).open("wb"), sort_keys=True)
if self.model == "MacBookPro9,1":
new_agdp_ls = Path(self.constants.agdp_contents_folder) / Path("Info.plist")
new_agpm_ls = Path(self.constants.agpm_contents_folder) / Path("Info.plist")

View File

@@ -6,6 +6,8 @@ import subprocess
import sys
import time
import platform
import tkinter as tk
from tkinter import colorchooser
from Resources import Build, ModelArray, Constants, SysPatch, Utilities
@@ -359,4 +361,36 @@ Custom names will report as follows:
self.constants.custom_cpu_model = 1
self.constants.custom_cpu_model_value = input("Enter new CPU Name: ")
else:
print("Invalid option")
print("Invalid option")
def custom_color_thing(self):
Utilities.cls()
Utilities.header(["Set custom CPU Model Name"])
print("""Change reported CPU Model name in About This Mac
Custom names will report as follows:
1: Custom Color
2. Reset
""")
change_menu = input("Set custom CPU Name(1,2,3): ")
if change_menu == "1":
temp_tk_root = tk.Tk()
temp_tk_root.wm_withdraw()
self.constants.custom_color = colorchooser.askcolor(title="Choose color")
temp_tk_root.destroy()
elif change_menu == "2":
self.constants.custom_color = ""
else:
print("Invalid option")
def download_more_ram_dot_com(self):
Utilities.cls()
Utilities.header(["Download more RAM"])
print("""Downloads more RAM to your Mac!
Currently only offers 1.5TB bundles
""")
change_menu = input("Download more RAM?(y/n): ")
if change_menu == "1":
self.constants.download_ram = True
else:
print("Invalid option")

View File

@@ -78,6 +78,8 @@ class Constants:
self.allow_oc_everywhere = False
self.custom_cpu_model = 2
self.custom_cpu_model_value = ""
self.custom_color = ""
self.download_ram = False
# OS Versions
self.tiger = 8

View File

@@ -1216,6 +1216,242 @@
<key>SystemUUID</key>
<string></string>
</dict>
<key>Memory</key>
<dict>
<key>DataWidth</key>
<integer>64</integer>
<key>ErrorCorrection</key>
<integer>3</integer>
<key>FormFactor</key>
<integer>9</integer>
<key>MaxCapacity</key>
<integer>137438953472</integer>
<key>TotalWidth</key>
<integer>64</integer>
<key>Type</key>
<integer>26</integer>
<key>TypeDetail</key>
<integer>128</integer>
<key>Devices</key>
<array>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 1</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA000000001</string>
<key>Size</key>
<real>131072</real>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 2</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 3</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA000000002</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 4</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 5</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA000000002</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 6</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 7</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA000000001</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 8</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 9</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 10</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 11</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
<dict>
<key>AssetTag</key>
<string></string>
<key>BankLocator</key>
<string></string>
<key>DeviceLocator</key>
<string>Slot 12</string>
<key>Manufacturer</key>
<string>Acidanthera</string>
<key>PartNumber</key>
<string>M00001-4GB</string>
<key>SerialNumber</key>
<string>AAA00000000X</string>
<key>Size</key>
<integer>131072</integer>
<key>Speed</key>
<integer>69420</integer>
</dict>
</array>
</dict>
<key>PlatformNVRAM</key>
<dict>
<key>BID</key>