mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 20:10:14 +10:00
Organize Constants.py
This commit is contained in:
@@ -259,9 +259,7 @@ class BuildOpenCore:
|
|||||||
else:
|
else:
|
||||||
print("- Unable to run Wireless hardware detection")
|
print("- Unable to run Wireless hardware detection")
|
||||||
|
|
||||||
if self.constants.wifi_build is True:
|
if not self.constants.custom_model and self.computer.wifi:
|
||||||
print("- Skipping Wifi patches on request")
|
|
||||||
elif not self.constants.custom_model and self.computer.wifi:
|
|
||||||
if isinstance(self.computer.wifi, device_probe.Broadcom):
|
if isinstance(self.computer.wifi, device_probe.Broadcom):
|
||||||
# This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device
|
# This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device
|
||||||
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code:
|
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code:
|
||||||
@@ -452,7 +450,6 @@ class BuildOpenCore:
|
|||||||
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
|
||||||
|
|
||||||
def nvidia_patch(self, backlight_path):
|
def nvidia_patch(self, backlight_path):
|
||||||
self.constants.custom_mxm_gpu = True
|
|
||||||
if self.model in ["iMac11,1", "iMac11,2", "iMac11,3", "iMac10,1"]:
|
if self.model in ["iMac11,1", "iMac11,2", "iMac11,3", "iMac10,1"]:
|
||||||
print("- Adding Nvidia Brightness Control and DRM patches")
|
print("- Adding Nvidia Brightness Control and DRM patches")
|
||||||
self.config["DeviceProperties"]["Add"][backlight_path] = {
|
self.config["DeviceProperties"]["Add"][backlight_path] = {
|
||||||
@@ -493,7 +490,6 @@ class BuildOpenCore:
|
|||||||
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
|
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
|
||||||
|
|
||||||
def amd_patch(self, backlight_path):
|
def amd_patch(self, backlight_path):
|
||||||
self.constants.custom_mxm_gpu = True
|
|
||||||
print("- Adding AMD DRM patches")
|
print("- Adding AMD DRM patches")
|
||||||
self.config["DeviceProperties"]["Add"][backlight_path] = {"shikigva": 80, "unfairgva": 1}
|
self.config["DeviceProperties"]["Add"][backlight_path] = {"shikigva": 80, "unfairgva": 1}
|
||||||
if self.constants.custom_model and self.model == "iMac11,2":
|
if self.constants.custom_model and self.model == "iMac11,2":
|
||||||
|
|||||||
@@ -12,94 +12,131 @@ from Resources import device_probe
|
|||||||
|
|
||||||
class Constants:
|
class Constants:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.patcher_version = "0.2.5"
|
# Patcher Versioning
|
||||||
|
self.patcher_version = "0.2.5" # OpenCore-Legacy-Patcher
|
||||||
|
self.patcher_support_pkg_version = "0.0.20" # PatcherSupportPkg
|
||||||
|
|
||||||
|
# OpenCore Versioning
|
||||||
|
# https://github.com/acidanthera/OpenCorePkg
|
||||||
self.opencore_commit = "ff4b099 - 09-06-2021"
|
self.opencore_commit = "ff4b099 - 09-06-2021"
|
||||||
self.opencore_version = "0.7.3"
|
self.opencore_version = "0.7.3"
|
||||||
self.lilu_version = "1.5.6"
|
|
||||||
self.whatevergreen_version = "1.5.3"
|
# Kext Versioning
|
||||||
self.airportbcrmfixup_version = "2.1.3"
|
## Acidanthera
|
||||||
self.bcm570_version = "1.0.1"
|
## https://github.com/acidanthera
|
||||||
self.marvel_version = "1.0.0"
|
self.lilu_version = "1.5.6" # Lilu
|
||||||
self.nforce_version = "1.0.0"
|
self.whatevergreen_version = "1.5.3" # WhateverGreen
|
||||||
self.mce_version = "1.0.0"
|
self.airportbcrmfixup_version = "2.1.3" # AirPortBrcmFixup
|
||||||
self.mousse_version = "0.95"
|
self.nvmefix_version = "1.0.9" # NVMeFix
|
||||||
self.telemetrap_version = "1.0.0"
|
self.applealc_version = "1.6.3" # AppleALC
|
||||||
self.corecaptureelcap_version = "1.0.0"
|
self.restrictevents_version = "1.0.3" # RestrictEvents
|
||||||
self.io80211elcap_version = "1.0.0"
|
self.restrictevents_mbp_version = "1.0.3" # RestrictEvents blocking displaypolicyd (see RestrictEvents-MBP91.patch)
|
||||||
self.io80211high_sierra_version = "1.0.0"
|
self.featureunlock_version = "1.0.3" # FeatureUnlock
|
||||||
self.io80211mojave_version = "1.0.0"
|
self.debugenhancer_version = "1.0.4" # DebugEnhancer
|
||||||
self.applealc_version = "1.6.3"
|
self.cpufriend_version = "1.2.4" # CPUFriend
|
||||||
self.restrictevents_version = "1.0.3"
|
|
||||||
self.restrictevents_mbp_version = "1.0.3"
|
## Apple
|
||||||
self.piixata_version = "1.0.0"
|
## https://www.apple.com
|
||||||
self.backlight_version = "1.0.1"
|
self.marvel_version = "1.0.0" # MarvelYukonEthernet
|
||||||
self.backlight_injector_version = "1.0.0"
|
self.nforce_version = "1.0.0" # nForceEthernet
|
||||||
self.cpufriend_version = "1.2.4"
|
self.piixata_version = "1.0.0" # AppleIntelPIIXATA
|
||||||
self.smcspoof_version = "1.0.0"
|
self.fw_kext = "1.0.0" # IOFireWireFamily
|
||||||
self.nvmefix_version = "1.0.9"
|
self.apple_trackpad = "1.0.0" # AppleUSBTrackpad
|
||||||
self.featureunlock_version = "1.0.3"
|
|
||||||
self.debugenhancer_version = "1.0.4"
|
## Apple - Dortania Modified
|
||||||
self.innie_version = "1.3.0"
|
self.bcm570_version = "1.0.1" # CatalinaBCM5701Ethernet
|
||||||
self.fw_kext = "1.0.0"
|
self.corecaptureelcap_version = "1.0.0" # corecaptureElCap
|
||||||
self.latebloom_version = "0.19"
|
self.io80211elcap_version = "1.0.0" # IO80211ElCap
|
||||||
self.disk = ""
|
self.io80211high_sierra_version = "1.0.0" # IO80211HighSierra
|
||||||
self.patch_disk = ""
|
self.io80211mojave_version = "1.0.0" # IO80211Mojave
|
||||||
self.patcher_support_pkg_version = "0.0.20" # PatcherSupportPkg
|
|
||||||
|
## Dortania
|
||||||
|
## https://github.com/dortania
|
||||||
|
self.backlight_injector_version = "1.0.0" # BacklightInjector
|
||||||
|
self.smcspoof_version = "1.0.0" # SMC-Spoof
|
||||||
|
self.mce_version = "1.0.0" # AppleMCEReporterDisabler
|
||||||
|
|
||||||
|
## Syncretic
|
||||||
|
## https://forums.macrumors.com/members/syncretic.1173816/
|
||||||
|
self.latebloom_version = "0.19" # Latebloom
|
||||||
|
self.mousse_version = "0.95" # MouSSE
|
||||||
|
self.telemetrap_version = "1.0.0" # telemetrap
|
||||||
|
|
||||||
|
## cdf
|
||||||
|
## https://github.com/cdf/Innie
|
||||||
|
self.innie_version = "1.3.0" # Innie
|
||||||
|
|
||||||
# Get resource path
|
# Get resource path
|
||||||
self.current_path = Path(__file__).parent.parent.resolve()
|
self.current_path = Path(__file__).parent.parent.resolve()
|
||||||
self.payload_path = self.current_path / Path("payloads")
|
self.payload_path = self.current_path / Path("payloads")
|
||||||
|
|
||||||
# Hardware
|
|
||||||
self.computer: device_probe.Computer = None # type: ignore
|
|
||||||
|
|
||||||
self.custom_model: Optional[str] = None
|
|
||||||
self.custom_mxm_gpu: bool = False
|
|
||||||
|
|
||||||
# Patcher Settings
|
# Patcher Settings
|
||||||
|
self.allow_oc_everywhere = False # Set whether Patcher can be run on unsupported Macs
|
||||||
|
self.gui_mode = False # Determine whether running in a GUI or TUI
|
||||||
|
self.disk = "" # Set installation ESP
|
||||||
|
self.patch_disk = "" # Set Root Volume to patch
|
||||||
|
self.validate = False # Enable validation testing for CI
|
||||||
|
self.recovery_status = False # Detect if booted into RecoveryOS
|
||||||
|
|
||||||
|
## Hardware
|
||||||
|
self.computer: device_probe.Computer = None # type: ignore
|
||||||
|
self.custom_model: Optional[str] = None
|
||||||
|
|
||||||
|
## OpenCore Settings
|
||||||
self.opencore_debug = False
|
self.opencore_debug = False
|
||||||
self.opencore_build = "RELEASE"
|
self.opencore_build = "RELEASE"
|
||||||
self.kext_debug = False
|
self.showpicker = True # Show or Hide OpenCore's Boot Picker
|
||||||
self.verbose_debug = False
|
self.boot_efi = False # Use EFI/BOOT/BOOTx64.efi bootstrap
|
||||||
|
|
||||||
|
## Kext Settings
|
||||||
|
self.kext_debug = False # Enables Lilu debug and DebugEnhancer
|
||||||
|
|
||||||
|
## NVRAM Settings
|
||||||
|
self.verbose_debug = False # -v
|
||||||
|
|
||||||
|
## SMBIOS Settings
|
||||||
|
self.custom_cpu_model = 2 # Patch type value
|
||||||
|
self.custom_cpu_model_value = "" # New CPU name within About This Mac
|
||||||
|
self.serial_settings = "Minimal" # Set SMBIOS level used
|
||||||
|
self.override_smbios = "Default" # Set SMBIOS model used
|
||||||
|
|
||||||
|
## Latebloom Settings
|
||||||
|
self.latebloom_status = False # Latebloom Enabled
|
||||||
|
self.latebloom_delay = 0 # Delay between each PCIe Probe
|
||||||
|
self.latebloom_range = 0 # Range each delay can differ
|
||||||
|
self.latebloom_debug = 0 # Debug Setting
|
||||||
|
|
||||||
|
## Security Settings
|
||||||
|
self.apecid_support = False # ApECID
|
||||||
|
self.amfi_status = True # Apple Mobile File Integrity
|
||||||
|
self.sip_status = True # System Integrity Protection
|
||||||
|
self.secure_status = False # Secure Boot Model
|
||||||
|
self.vault = False # EFI Vault
|
||||||
|
|
||||||
|
## OS Settings
|
||||||
self.os_support = 12.0
|
self.os_support = 12.0
|
||||||
self.metal_build = False
|
self.detected_os = 0 # Major Kernel Version
|
||||||
self.imac_vendor = "None"
|
self.detected_os_minor = 0 # Minor Kernel Version
|
||||||
self.wifi_build = False
|
|
||||||
self.gui_mode = False
|
## Boot Volume Settings
|
||||||
self.serial_settings = "Minimal"
|
self.firewire_boot = False # Allow macOS FireWire Boot
|
||||||
self.showpicker = True
|
self.nvme_boot = False # Allow UEFI NVMe Boot
|
||||||
self.vault = False
|
|
||||||
self.sip_status = True
|
## Graphics Settings
|
||||||
self.secure_status = False
|
self.metal_build = False # Set MXM Build support
|
||||||
self.detected_os = 0
|
self.imac_vendor = "None" # Set MXM GPU vendor
|
||||||
self.detected_os_minor = 0
|
self.drm_support = False # Set iMac14,x DRM support
|
||||||
self.boot_efi = False
|
self.allow_ivy_igpu = False # Set iMac13,x iGPU support
|
||||||
self.drm_support = False
|
self.moj_cat_accel = False # Set Mojave/Catalina Acceleration support
|
||||||
self.allow_oc_everywhere = False
|
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
|
||||||
self.custom_cpu_model = 2
|
|
||||||
self.custom_cpu_model_value = ""
|
## Miscellaneous
|
||||||
self.custom_color = ""
|
self.disallow_cpufriend = False # Disable CPUFriend
|
||||||
self.download_ram = False
|
self.enable_wake_on_wlan = False # Allow Wake on WLAN for modern Broadcom
|
||||||
self.disallow_cpufriend = False
|
self.disable_thunderbolt = False # Disable Thunderbolt Controller
|
||||||
self.recovery_status = False
|
|
||||||
self.override_smbios = "Default"
|
|
||||||
self.apecid_support = False
|
|
||||||
self.firewire_boot = False
|
|
||||||
self.nvme_boot = False
|
|
||||||
self.amfi_status = True
|
|
||||||
self.terascale_2_patch = False
|
|
||||||
self.enable_wake_on_wlan = False
|
|
||||||
self.allow_ivy_igpu = False
|
|
||||||
self.moj_cat_accel = False
|
|
||||||
self.latebloom_status = False
|
|
||||||
self.latebloom_delay = 0
|
|
||||||
self.latebloom_range = 0
|
|
||||||
self.latebloom_debug = 0
|
|
||||||
self.validate = False
|
|
||||||
self.disable_thunderbolt = False
|
|
||||||
self.allow_ts2_accel = True
|
|
||||||
|
|
||||||
# OS Versions
|
# OS Versions
|
||||||
|
## Based off Major Kernel Version
|
||||||
self.tiger = 8
|
self.tiger = 8
|
||||||
self.leopard = 9
|
self.leopard = 9
|
||||||
self.snow_leopard = 10
|
self.snow_leopard = 10
|
||||||
@@ -127,7 +164,7 @@ class Constants:
|
|||||||
self.pci_syskonnect = "1148"
|
self.pci_syskonnect = "1148"
|
||||||
|
|
||||||
# Class Codes
|
# Class Codes
|
||||||
# https://pci-ids.ucw.cz/read/PD
|
## https://pci-ids.ucw.cz/read/PD
|
||||||
self.classcode_sata = "01060100"
|
self.classcode_sata = "01060100"
|
||||||
self.classcode_nvme = "02080100"
|
self.classcode_nvme = "02080100"
|
||||||
self.classcode_nvme_generic = "02800100"
|
self.classcode_nvme_generic = "02800100"
|
||||||
@@ -262,10 +299,6 @@ class Constants:
|
|||||||
def piixata_path(self):
|
def piixata_path(self):
|
||||||
return self.payload_kexts_path / Path(f"Misc/AppleIntelPIIXATA-v{self.piixata_version}.zip")
|
return self.payload_kexts_path / Path(f"Misc/AppleIntelPIIXATA-v{self.piixata_version}.zip")
|
||||||
|
|
||||||
@property
|
|
||||||
def backlight_path(self):
|
|
||||||
return self.payload_kexts_path / Path(f"Misc/AppleBacklightFixup-v{self.backlight_version}.zip")
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def backlight_injector_path(self):
|
def backlight_injector_path(self):
|
||||||
return self.payload_kexts_path / Path(f"Misc/BacklightInjector-v{self.backlight_injector_version}.zip")
|
return self.payload_kexts_path / Path(f"Misc/BacklightInjector-v{self.backlight_injector_version}.zip")
|
||||||
|
|||||||
Reference in New Issue
Block a user