From 1957e70cfda9f525daee0f12b9020ba5769a857d Mon Sep 17 00:00:00 2001
From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com>
Date: Mon, 3 May 2021 23:49:43 -0600
Subject: [PATCH] Fix CPU Renaming on non-i5 models
---
OpenCore-Patcher.command | 1 +
Resources/Build.py | 15 ++-
Resources/CliMenu.py | 36 +++++-
Resources/Constants.py | 2 +
payloads/Config/config.plist | 236 +++++++++++++++++++++++++++++++++++
5 files changed, 285 insertions(+), 5 deletions(-)
diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command
index 77b0a8a13..8aeccf4f1 100755
--- a/OpenCore-Patcher.command
+++ b/OpenCore-Patcher.command
@@ -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],
]
diff --git a/Resources/Build.py b/Resources/Build.py
index 94e5309fb..2918cb0b8 100644
--- a/Resources/Build.py
+++ b/Resources/Build.py
@@ -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")
diff --git a/Resources/CliMenu.py b/Resources/CliMenu.py
index 4e9b47e47..19bd04e18 100644
--- a/Resources/CliMenu.py
+++ b/Resources/CliMenu.py
@@ -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")
\ No newline at end of file
+ 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")
diff --git a/Resources/Constants.py b/Resources/Constants.py
index 679fa32a5..63e31140c 100644
--- a/Resources/Constants.py
+++ b/Resources/Constants.py
@@ -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
diff --git a/payloads/Config/config.plist b/payloads/Config/config.plist
index 7efd77799..e1e5950c6 100644
--- a/payloads/Config/config.plist
+++ b/payloads/Config/config.plist
@@ -1216,6 +1216,242 @@
SystemUUID
+ Memory
+
+ DataWidth
+ 64
+ ErrorCorrection
+ 3
+ FormFactor
+ 9
+ MaxCapacity
+ 137438953472
+ TotalWidth
+ 64
+ Type
+ 26
+ TypeDetail
+ 128
+ Devices
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 1
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA000000001
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 2
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 3
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA000000002
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 4
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 5
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA000000002
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 6
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 7
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA000000001
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 8
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 9
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 10
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 11
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+ AssetTag
+
+ BankLocator
+
+ DeviceLocator
+ Slot 12
+ Manufacturer
+ Acidanthera
+ PartNumber
+ M00001-4GB
+ SerialNumber
+ AAA00000000X
+ Size
+ 131072
+ Speed
+ 69420
+
+
+
PlatformNVRAM
BID