mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
Add new SMBIOS patching options
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# OpenCore Legacy Patcher changelog
|
||||
|
||||
## 0.0.16
|
||||
- Move Serial selection to Patcher Settings
|
||||
- Add new SMBIOS patching options:
|
||||
- Minimal: Only update board ID and BIOSVersion, keep original serials
|
||||
- Moderate: Update entire SMBIOS, keep original serials
|
||||
- Advanced: Update entire SMBIOS, generate new serials
|
||||
|
||||
## 0.0.15
|
||||
- Add user-configurable OpenCore DEBUG builds
|
||||
- Add user-configurable Wifi and GPU patches
|
||||
|
||||
@@ -128,6 +128,30 @@ option is for those patching on a different machine.
|
||||
else:
|
||||
print("Invalid option")
|
||||
|
||||
def change_serial(self):
|
||||
utilities.cls()
|
||||
utilities.header(["Set SMBIOS Mode"])
|
||||
print("""This section is for setting how OpenCore generates the SMBIOS
|
||||
Recommended for adanced users who want control how serials are handled
|
||||
|
||||
Valid options:
|
||||
|
||||
1. Minimal:\tUse original serials and minimally update SMBIOS
|
||||
2. Moderate:\tReplave entire SMBIOS but keep original serials
|
||||
3. Advanced:\tReplace entire SMBIOS and generate new serials
|
||||
|
||||
Note: For new users we recommend leaving as default(1. Minimal)
|
||||
""")
|
||||
change_serial_menu = input("Set SMBIOS Mode(ie. 1): ")
|
||||
if change_serial_menu == "1":
|
||||
self.constants.serial_settings = "Minimal"
|
||||
elif change_serial_menu == "2":
|
||||
self.constants.serial_settings = "Moderate"
|
||||
elif change_serial_menu == "3":
|
||||
self.constants.serial_settings = "Advanced"
|
||||
else:
|
||||
print("Invalid option")
|
||||
|
||||
def patcher_settings(self):
|
||||
response = None
|
||||
while not (response and response == -1):
|
||||
@@ -143,6 +167,7 @@ option is for those patching on a different machine.
|
||||
[f"Enable Kext DEBUG:\t\t\tCurrently {self.constants.kext_debug}", self.change_kext],
|
||||
[f"Assume Metal GPU Always:\t\tCurrently {self.constants.kext_debug}", self.change_metal],
|
||||
[f"Assume Upgraded Wifi Always:\tCurrently {self.constants.kext_debug}", self.change_wifi],
|
||||
[f"Set SMBIOS Mode:\t\t\tCurrently {self.constants.serial_settings}", self.change_serial],
|
||||
]
|
||||
|
||||
for option in options:
|
||||
@@ -150,9 +175,6 @@ option is for those patching on a different machine.
|
||||
|
||||
response = menu.start()
|
||||
|
||||
|
||||
input("Press any key to continue...")
|
||||
|
||||
def credits(self):
|
||||
utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
|
||||
["""Many thanks to the following:
|
||||
|
||||
@@ -48,6 +48,8 @@ class Constants:
|
||||
self.max_os_support = 11.0
|
||||
self.metal_build = False
|
||||
self.wifi_build = False
|
||||
self.gui_mode = False
|
||||
self.serial_settings = "Minimal"
|
||||
|
||||
# Payload Location
|
||||
# OpenCore
|
||||
|
||||
@@ -269,36 +269,44 @@ class BuildOpenCore:
|
||||
print("- Spoofing to MacPro7,1")
|
||||
spoofed_model = "MacPro7,1"
|
||||
spoofed_board = "Mac-27AD2F918AE68F61"
|
||||
self.config["#Revision"]["Spoofed-Model"] = spoofed_model
|
||||
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
|
||||
self.spoofed_model = spoofed_model
|
||||
self.spoofed_board = spoofed_board
|
||||
self.config["#Revision"]["Spoofed-Model"] = self.spoofed_model
|
||||
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
self.macserial_output = macserial_output.stdout.decode().strip().split(" | ")
|
||||
|
||||
# Setup menu
|
||||
smbios_mod = True
|
||||
while smbios_mod == True:
|
||||
print("Use original or generate new serials")
|
||||
print("For new users, we recommend use originals(ie. y)")
|
||||
smbios_mod = input("Use original serials?(y, n): ")
|
||||
|
||||
if smbios_mod in {"y", "Y", "yes", "Yes"}:
|
||||
spoofed_model = self.model
|
||||
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = spoofed_board
|
||||
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = spoofed_board
|
||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||
elif smbios_mod in {"n", "N", "no", "No"}:
|
||||
self.config["PlatformInfo"]["Automatic"] = True
|
||||
self.config["PlatformInfo"]["UpdateDataHub"] = True
|
||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
|
||||
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = spoofed_model
|
||||
self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = macserial_output[0]
|
||||
self.config["PlatformInfo"]["Generic"]["MLB"] = macserial_output[1]
|
||||
self.config["PlatformInfo"]["Generic"]["SystemUUID"] = str(uuid.uuid4()).upper()
|
||||
else:
|
||||
smbios_mod = True
|
||||
|
||||
def minimal_serial_patch(self):
|
||||
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board
|
||||
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board
|
||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||
def moderate_serial_patch(self):
|
||||
self.config["PlatformInfo"]["Automatic"] = True
|
||||
self.config["PlatformInfo"]["UpdateDataHub"] = True
|
||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
|
||||
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
|
||||
def adanced_serial_patch(self):
|
||||
self.config["PlatformInfo"]["Automatic"] = True
|
||||
self.config["PlatformInfo"]["UpdateDataHub"] = True
|
||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
|
||||
self.config["PlatformInfo"]["Generic"]["ROM"] = binascii.unhexlify("112233445566")
|
||||
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
|
||||
self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.macserial_output[0]
|
||||
self.config["PlatformInfo"]["Generic"]["MLB"] = self.macserial_output[1]
|
||||
self.config["PlatformInfo"]["Generic"]["SystemUUID"] = str(uuid.uuid4()).upper()
|
||||
|
||||
if self.constants.serial_settings == "Moderate":
|
||||
moderate_serial_patch(self)
|
||||
elif self.constants.serial_settings == "Advanced":
|
||||
adanced_serial_patch(self)
|
||||
else:
|
||||
self.spoofed_model = self.model
|
||||
minimal_serial_patch(self)
|
||||
|
||||
# USB Map Patching
|
||||
self.new_map_ls = Path(self.constants.map_contents_folder) / Path(f"Info.plist")
|
||||
self.new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
|
||||
self.map_config = plistlib.load(Path(self.new_map_ls).open("rb"))
|
||||
|
||||
self.map_config["IOKitPersonalities_x86_64"][self.model]["model"] = spoofed_model
|
||||
@@ -382,7 +390,8 @@ class BuildOpenCore:
|
||||
print("Your OpenCore EFI has been built at:")
|
||||
print(f" {self.constants.opencore_release_folder}")
|
||||
print("")
|
||||
input("Press [Enter] to go back.\n")
|
||||
if self.constants.gui_mode == False:
|
||||
input("Press [Enter] to go back.\n")
|
||||
|
||||
def copy_efi(self):
|
||||
utilities.cls()
|
||||
|
||||
@@ -930,7 +930,7 @@
|
||||
<key>ProcessorType</key>
|
||||
<integer>0</integer>
|
||||
<key>ROM</key>
|
||||
<data>ESIzRFVm</data>
|
||||
<data></data>
|
||||
<key>SpoofVendor</key>
|
||||
<true/>
|
||||
<key>SystemProductName</key>
|
||||
|
||||
Reference in New Issue
Block a user