mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
defaults.py: Don’t grab RE’s CPU name
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
- Resolve unused KDKs not being properly cleaned up
|
- Resolve unused KDKs not being properly cleaned up
|
||||||
- Implement MXM graphics handling for iMac9,1
|
- Implement MXM graphics handling for iMac9,1
|
||||||
- Credit to [Ausdauersportler](https://github.com/Ausdauersportler) for implementation
|
- Credit to [Ausdauersportler](https://github.com/Ausdauersportler) for implementation
|
||||||
|
- Resolve accidental CPU renaming with RestrictEvents
|
||||||
- Backend changes:
|
- Backend changes:
|
||||||
- Use `.AppleSystemUIFont` for wxPython text rendering (thanks [jazzzny](https://github.com/Jazzzny))
|
- Use `.AppleSystemUIFont` for wxPython text rendering (thanks [jazzzny](https://github.com/Jazzzny))
|
||||||
- Add extra error handling for network errors:
|
- Add extra error handling for network errors:
|
||||||
|
|||||||
@@ -112,15 +112,6 @@ class BuildMiscellaneous:
|
|||||||
support.BuildSupport(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
|
support.BuildSupport(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
|
||||||
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revpatch"] = patch_args
|
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revpatch"] = patch_args
|
||||||
|
|
||||||
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
|
|
||||||
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revcpu"] = self.constants.custom_cpu_model
|
|
||||||
if self.constants.custom_cpu_model_value != "":
|
|
||||||
logging.info(f"- Adding custom CPU Name: {self.constants.custom_cpu_model_value}")
|
|
||||||
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revcpuname"] = self.constants.custom_cpu_model_value
|
|
||||||
else:
|
|
||||||
logging.info("- Adding CPU Name Patch")
|
|
||||||
support.BuildSupport(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
|
|
||||||
|
|
||||||
if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False:
|
if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False:
|
||||||
# Ensure this is done at the end so all previous RestrictEvents patches are applied
|
# Ensure this is done at the end so all previous RestrictEvents patches are applied
|
||||||
# RestrictEvents and EFICheckDisabler will conflict if both are injected
|
# RestrictEvents and EFICheckDisabler will conflict if both are injected
|
||||||
|
|||||||
@@ -235,10 +235,6 @@ class BuildSMBIOS:
|
|||||||
self.config["PlatformInfo"]["SMBIOS"]["SystemProductName"] = self.model
|
self.config["PlatformInfo"]["SMBIOS"]["SystemProductName"] = self.model
|
||||||
self.config["PlatformInfo"]["SMBIOS"]["BoardVersion"] = self.model
|
self.config["PlatformInfo"]["SMBIOS"]["BoardVersion"] = self.model
|
||||||
|
|
||||||
# ProcessorType (when RestrictEvent's CPU naming is used)
|
|
||||||
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
|
|
||||||
self.config["PlatformInfo"]["SMBIOS"]["ProcessorType"] = 1537
|
|
||||||
|
|
||||||
# Avoid incorrect Firmware Updates
|
# Avoid incorrect Firmware Updates
|
||||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
|
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
|
||||||
self.config["PlatformInfo"]["SMBIOS"]["BIOSVersion"] = "9999.999.999.999.999"
|
self.config["PlatformInfo"]["SMBIOS"]["BIOSVersion"] = "9999.999.999.999.999"
|
||||||
@@ -273,8 +269,6 @@ class BuildSMBIOS:
|
|||||||
Implements a full SMBIOS replacement, however retains original serial numbers (unless override requested)
|
Implements a full SMBIOS replacement, however retains original serial numbers (unless override requested)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
|
|
||||||
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537
|
|
||||||
if self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != "":
|
if self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != "":
|
||||||
logging.info("- Adding custom serial numbers")
|
logging.info("- Adding custom serial numbers")
|
||||||
self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.constants.custom_serial_number
|
self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.constants.custom_serial_number
|
||||||
@@ -297,8 +291,6 @@ class BuildSMBIOS:
|
|||||||
Implements a full SMBIOS replacement, including serial numbers
|
Implements a full SMBIOS replacement, including serial numbers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
|
|
||||||
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537
|
|
||||||
if self.constants.custom_serial_number == "" or self.constants.custom_board_serial_number == "":
|
if self.constants.custom_serial_number == "" or self.constants.custom_board_serial_number == "":
|
||||||
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 = 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(" | ")
|
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
|
||||||
|
|||||||
@@ -156,10 +156,6 @@ class Constants:
|
|||||||
self.override_smbios: str = "Default" # Set SMBIOS model used
|
self.override_smbios: str = "Default" # Set SMBIOS model used
|
||||||
self.allow_native_spoofs: bool = False # Allow native models to recieve spoofs
|
self.allow_native_spoofs: bool = False # Allow native models to recieve spoofs
|
||||||
|
|
||||||
### RestrictEvents CPU renaming
|
|
||||||
self.custom_cpu_model: int = 2 # Patch type value
|
|
||||||
self.custom_cpu_model_value: str = "" # New CPU name within About This Mac
|
|
||||||
|
|
||||||
### Serial Number Overrides
|
### Serial Number Overrides
|
||||||
self.custom_serial_number: str = "" # Set SMBIOS serial number
|
self.custom_serial_number: str = "" # Set SMBIOS serial number
|
||||||
self.custom_board_serial_number: str = "" # Set SMBIOS board serial number
|
self.custom_board_serial_number: str = "" # Set SMBIOS board serial number
|
||||||
|
|||||||
@@ -146,12 +146,6 @@ class GenerateDefaults:
|
|||||||
self.constants.custom_serial_number = ""
|
self.constants.custom_serial_number = ""
|
||||||
self.constants.custom_board_serial_number = ""
|
self.constants.custom_board_serial_number = ""
|
||||||
|
|
||||||
custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
|
|
||||||
if custom_cpu_model_value is not None:
|
|
||||||
# TODO: Fix to not use two separate variables
|
|
||||||
self.constants.custom_cpu_model = 1
|
|
||||||
self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
|
|
||||||
|
|
||||||
|
|
||||||
def _networking_probe(self) -> None:
|
def _networking_probe(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user