Compare commits

..

9 Commits

Author SHA1 Message Date
Mykola Grymalyuk
690ff19b47 Add User-configurable verbose and debug
Closes https://github.com/dortania/Opencore-Legacy-Patcher/issues/10
References https://github.com/dortania/Opencore-Legacy-Patcher/issues/74
2021-03-06 17:22:52 -07:00
Mykola Grymalyuk
00a1e232b4 Remove redundant hibernation patch 2021-03-06 15:31:01 -07:00
Mykola Grymalyuk
a7ebf72d1b Add NightShiftEnabler support
Closes https://github.com/dortania/Opencore-Legacy-Patcher/issues/80
2021-03-06 15:22:47 -07:00
Mykola Grymalyuk
1af5182560 Add ForceBooterSignature support
Resolves hibernation issues
Closes https://github.com/dortania/Opencore-Legacy-Patcher/issues/72
2021-03-06 14:58:04 -07:00
Mykola Grymalyuk
eb70e4611f Add iMacProMax1,1 support
Solely for easy debugging to catch most tests at once
2021-03-04 12:19:10 -07:00
Mykola Grymalyuk
c1a6a6b156 Enable ThirdPartyDrives 2021-03-04 11:59:45 -07:00
Mykola Grymalyuk
c90fdca19d Add model verification
Ref: https://github.com/dortania/Opencore-Legacy-Patcher/pull/39
2021-03-04 11:50:30 -07:00
Mykola Grymalyuk
3dcc0d0b0b Add basic debug toggle
Currently not accessible via user-input
2021-03-04 09:58:12 -07:00
Mykola Grymalyuk
5cff0a8c6c Increment build 2021-03-04 09:46:42 -07:00
14 changed files with 339 additions and 30 deletions

View File

@@ -1,5 +1,13 @@
# OpenCore Legacy Patcher changelog
## 0.0.14
- Enable ThirdPartyDrives to aid with hibernation on 3rd party SATA drives
- Increment OpenCore 7bb41aa (0.6.8 rolling, 2021-03-06)
- Add ForceBooterSignature to resolve hibernation issues
- Add NightShiftEnabler (1.1.0 release e1639f9)
- Add user-configurable verbose and debug settings
- Add GopPassThrough quirk for UGA-based systems
## 0.0.13
- Add CPUFriend support to resolve X86PlatformPlugin clashes
- (1.2.3 c388a62 release)

View File

@@ -34,6 +34,82 @@ Tip: Run the following command on the target machine to find the model identifie
system_profiler SPHardwareDataType | grep 'Model Identifier'
""")
self.constants.custom_model = input("Please enter the model identifier of the target machine: ").strip()
if self.constants.custom_model not in ModelArray.SupportedSMBIOS:
print(f"{self.constants.custom_model} is not a valid SMBIOS Identifier!")
print_models = input("Print list of valid options? (y/n)")
if print_models in {"y", "Y", "yes", "Yes"}:
print("\n".join(ModelArray.SupportedSMBIOS))
input("Press any key to continue...")
def change_os(self):
utilities.cls()
utilities.header(["Select Patcher's Target OS"])
print(f"""
Minimum Target:\t{self.constants.min_os_support}
Maximum Target:\t{self.constants.max_os_support}
Current target:\t{self.constants.os_support}
""")
temp_os_support = float(input("Please enter OS target: "))
if (self.constants.max_os_support < temp_os_support) or (temp_os_support < self.constants.min_os_support):
print("Unsupported entry")
else:
self.constants.os_support = temp_os_support
def change_verbose(self):
utilities.cls()
utilities.header(["Set Verbose mode"])
verbose_menu = input("Enable Verbose mode(y/n): ")
if verbose_menu in {"y", "Y", "yes", "Yes"}:
self.constants.verbose_debug = True
elif verbose_menu in {"n", "N", "no", "No"}:
self.constants.verbose_debug = False
else:
print("Invalid option")
def change_oc(self):
utilities.cls()
utilities.header(["Set OpenCore DEBUG mode"])
change_oc_menu = input("Enable OpenCore DEBUG mode(y/n): ")
if change_oc_menu in {"y", "Y", "yes", "Yes"}:
self.constants.opencore_debug = True
elif change_oc_menu in {"n", "N", "no", "No"}:
self.constants.opencore_debug = False
else:
print("Invalid option")
def change_kext(self):
utilities.cls()
utilities.header(["Set Kext DEBUG mode"])
change_kext_menu = input("Enable Kext DEBUG mode(y/n): ")
if change_kext_menu in {"y", "Y", "yes", "Yes"}:
self.constants.kext_debug = True
elif change_kext_menu in {"n", "N", "no", "No"}:
self.constants.kext_debug = False
else:
print("Invalid option")
def patcher_settings(self):
response = None
while not (response and response == -1):
title = [
"Adjust Patcher Settings"
]
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
options = [
# TODO: Enable setting OS target when more OSes become supported by the patcher
#[f"Change OS version:\t\tCurrently macOS {self.constants.os_support}", self.change_os],
[f"Enable Verbose Mode:\tCurrently {self.constants.verbose_debug}", self.change_verbose],
# TODO: Enable setting OC DEBUG when path handling for DEBUg files is resolved
#[f"Enable OpenCore DEBUG:\tCurrently {self.constants.opencore_debug}", self.change_oc],
[f"Enable Kext DEBUG:\t\tCurrently {self.constants.kext_debug}", self.change_kext]
]
for option in options:
menu.add_menu_option(option[0], function=option[1])
response = menu.start()
input("Press any key to continue...")
def credits(self):
utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
@@ -43,7 +119,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
- Khronokernel:\tWriting and maintaining this patcher
- DhinakG:\t\tWriting and maintaining this patcher
- Syncretic:\t\tAAAMouSSE and telemetrap
- Slice:\t\tVoodooHDA"""]).start()
- Slice:\t\tVoodooHDA
- cdf:\t\tNightShiftEnabler"""]).start()
def main_menu(self):
response = None
@@ -78,6 +155,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
options = ([["Build OpenCore", self.build_opencore]] if ((self.constants.custom_model or self.current_model) in ModelArray.SupportedSMBIOS) else []) + [
["Install OpenCore to USB/internal drive", self.install_opencore],
["Change Model", self.change_model],
["Patcher Settings", self.patcher_settings],
["Credits", self.credits]
]

View File

@@ -8,9 +8,9 @@ from pathlib import Path
class Constants:
def __init__(self):
self.patcher_version = "0.0.13"
self.opencore_commit = "cbd2fa3"
self.opencore_version = "0.6.7"
self.patcher_version = "0.0.14"
self.opencore_commit = "7bb41aa - 2021-03-06"
self.opencore_version = "0.6.8"
self.lilu_version = "1.5.1"
self.whatevergreen_version = "1.4.8"
self.airportbcrmfixup_version = "2.1.2"
@@ -27,6 +27,7 @@ class Constants:
self.piixata_version = "1.0.0"
self.backlight_version = "1.0.0"
self.cpufriend_version = "1.2.3"
self.nightshift_version = "1.1.0"
# Get resource path
self.current_path = Path(__file__).parent.parent.resolve()
@@ -36,6 +37,15 @@ class Constants:
self.custom_mxm_gpu: str = None
self.current_gpuv: str = None
self.current_gpud: str = None
# Patcher Settings
self.opencore_debug = False
self.kext_debug = False
self.verbose_debug = True
self.os_support = 11.0
self.min_os_support = 11.0
self.max_os_support = 11.0
# Payload Location
# OpenCore
@property
@@ -86,6 +96,8 @@ class Constants:
def backlight_path(self): return self.payload_kexts_path / Path(f"Misc/AppleBacklightFixup-v{self.backlight_version}.zip")
@property
def cpufriend_path(self): return self.payload_kexts_path / Path(f"Acidanthera/CPUFriend-v{self.cpufriend_version}.zip")
@property
def nightshift_path(self): return self.payload_kexts_path / Path(f"Misc/NightShiftEnabler-v{self.nightshift_version}.zip")
# Build Location
@property

View File

@@ -59,7 +59,8 @@ SupportedSMBIOS = [
"MacPro4,1",
"MacPro5,1",
# Xserve
"Xserve3,1"
"Xserve3,1",
"iMacProMax1,1"
]
## CPU patches
@@ -85,18 +86,21 @@ MissingSSE42 = [
"iMac8,1",
"iMac9,1",
"iMac10,1",
"MacPro3,1"
"MacPro3,1",
"iMacProMax1,1"
]
SSEEmulator = [
"MacPro3,1"
"MacPro3,1",
"iMacProMax1,1"
]
DualSocket = [
"MacPro3,1",
"MacPro4,1",
"MacPro5,1",
"Xserve3,1"
"Xserve3,1",
"iMacProMax1,1"
]
pciSSDT = [
@@ -104,7 +108,8 @@ pciSSDT = [
"MacBookPro6,2",
"iMac11,1",
"iMac11,2",
"iMac11,3"
"iMac11,3",
"iMacProMax1,1"
]
## Ethernet patches
@@ -123,12 +128,14 @@ EthernetNvidia = [
"Macmini3,1",
"Macmini4,1",
"iMac9,1",
"iMac10,1"
"iMac10,1",
"iMacProMax1,1"
]
EthernetMarvell = [
"MacBookPro4,1",
"iMac7,1",
"iMac8,1"
"iMac8,1",
"iMacProMax1,1"
]
EthernetBroadcom = [
"MacBookPro6,1",
@@ -143,7 +150,8 @@ EthernetBroadcom = [
"iMac11,2",
"iMac11,3",
"iMac12,1",
"iMac12,2"
"iMac12,2",
"iMacProMax1,1"
]
## Wifi patches
@@ -156,14 +164,16 @@ WifiAtheros = [
"iMac12,1",
"iMac12,2",
"MacPro3,1",
"MacPro4,1"
"MacPro4,1",
"iMacProMax1,1"
]
WifiBCM94328 = [
"MacBookAir2,1",
"MacBookPro4,1",
"iMac7,1",
"iMac8,1"
"iMac8,1",
"iMacProMax1,1"
]
WifiBCM94322 = [
@@ -181,6 +191,7 @@ WifiBCM94322 = [
"MacBookPro5,4",
"MacBookPro5,5",
"MacBookPro7,1",
"iMacProMax1,1"
]
WifiBCM943224 = [
@@ -190,6 +201,7 @@ WifiBCM943224 = [
"MacBookPro6,2",
"Macmini3,1",
"Macmini4,1",
"iMacProMax1,1"
]
WifiBCM94331 = [
@@ -228,7 +240,8 @@ WifiBCM94331 = [
"iMac9,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)
"iMac13,1", # PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0)
"iMac13,2", # PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0)
"MacPro5,1" # PciRoot(0x0)/Pci(0x1C,0x5)/Pci(0x0,0x0)
"MacPro5,1", # PciRoot(0x0)/Pci(0x1C,0x5)/Pci(0x0,0x0)
"iMacProMax1,1"
]
## Audio
@@ -269,7 +282,8 @@ LegacyAudio = [
"iMac11,3",
"iMac12,1",
"iMac12,2",
"MacPro3,1"
"MacPro3,1",
"iMacProMax1,1"
]
## GPU
@@ -309,7 +323,8 @@ LegacyGPU = [
"iMac11,2",
"iMac11,3",
"iMac12,1",
"iMac12,2"
"iMac12,2",
"iMacProMax1,1"
]
LegacyHID = [
@@ -332,13 +347,15 @@ LegacyHID = [
"iMac8,1",
"iMac9,1",
"iMac10,1",
"MacPro3,1"
"MacPro3,1",
"iMacProMax1,1"
]
NVMePatch = [
"MacPro3,1"
"MacPro4,1"
"Xserve3,1"
"MacPro3,1",
"MacPro4,1",
"Xserve3,1",
"iMacProMax1,1"
]
SidecarPatch = [
@@ -354,7 +371,8 @@ SidecarPatch = [
"iMac13,2",
"iMac14,1",
"iMac14,2",
"iMac14,3"
"iMac14,3",
"iMacProMax1,1"
]
DualGPUPatch = [
@@ -375,22 +393,25 @@ DualGPUPatch = [
"iMac13,2",
"iMac14,2",
"iMac14,3",
"iMacProMax1,1"
]
HiDPIpicker = [
"MacBookPro10,1",
"MacBookPro10,2",
"iMacProMax1,1"
]
IDEPatch = [
"MacPro3,1"
"MacPro3,1",
"iMacProMax1,1"
]
# 11" Air
MacBookAir61 = [
"MacBookAir3,1",
"MacBookAir4,1",
"MacBookAir5,1"
"MacBookAir5,1",
]
# MacBook and 13" Air
@@ -469,7 +490,8 @@ MacPro71 = [
"MacPro3,1",
"MacPro4,1",
"MacPro5,1",
"Xserve3,1"
"Xserve3,1",
"iMacProMax1,1"
]
# Maps
@@ -702,6 +724,7 @@ upgradableMXMGPUs = [
"iMac12,1",
"iMac12,2",
"Xserve3,1",
"iMacProMax1,1"
]
# Reference: https://forums.macrumors.com/threads/2011-imac-graphics-card-upgrade.1596614/
@@ -754,4 +777,24 @@ X86PP = [
"iMac14,1",
"iMac14,2",
"iMac14,3",
]
NightShiftExclude = [
"MacBookAir5,1",
"MacBookAir5,2",
"MacBookPro9,1",
"MacBookPro9,2",
"MacBookPro10,1",
"MacBookPro10,2",
"Macmini6,1",
"Macmini6,2",
"iMac13,1",
"iMac13,2",
"iMac14,1",
"iMac14,2",
"iMac14,3",
]
UGAtoGOP = [
"MacPro3,1"
]

View File

@@ -75,6 +75,7 @@ class BuildOpenCore:
("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path, lambda: True),
("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path, lambda: True),
("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in ModelArray.MacPro71),
("NightShiftEnabler.kext", self.constants.nightshift_version, self.constants.nightshift_path, lambda: self.model not in ModelArray.NightShiftExclude),
# CPU patches
("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket),
("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: self.model in ModelArray.SSEEmulator),
@@ -191,8 +192,23 @@ class BuildOpenCore:
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)
shutil.copy(self.constants.gui_path, self.constants.oc_folder)
self.config["UEFI"]["Drivers"] = ["OpenCanopy.efi", "OpenRuntime.efi"]
# Hibernation Patch
self.config["Booter"]["Quirks"]["DiscardHibernateMap"] = True
# Add UGA to GOP layer
if self.model in ModelArray.UGAtoGOP:
print("- Adding UGA to GOP Patch")
self.config["UEFI"]["ProtocolOverrides"]["GopPassThrough"] = True
#DEBUG Settings
if self.constants.verbose_debug == True:
print("- Enabling Verbose boot")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -v"
if self.constants.kext_debug == True:
print("- Enabling DEBUG Kexts")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -liludbgall"
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " msgbuf=1048576"
if self.constants.opencore_debug == True:
print("- Enabling DEBUG OpenCore")
self.config["Misc"]["Debug"]["Target"] = 67
def set_smbios(self):
spoofed_model = self.model

View File

@@ -145,6 +145,8 @@
<false/>
<key>EnableWriteUnprotector</key>
<false/>
<key>ForceBooterSignature</key>
<true/>
<key>ForceExitBootServices</key>
<false/>
<key>ProtectMemoryRegions</key>
@@ -502,6 +504,24 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>NightShiftEnabler</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>BundlePath</key>
<string>NightShiftEnabler.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/NightShiftEnabler</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -644,7 +664,7 @@
<key>SetApfsTrimTimeout</key>
<integer>-1</integer>
<key>ThirdPartyDrives</key>
<false/>
<true/>
<key>XhciPortLimit</key>
<false/>
</dict>
@@ -667,7 +687,7 @@
<key>ConsoleAttributes</key>
<integer>0</integer>
<key>HibernateMode</key>
<string>Auto</string>
<string>None</string>
<key>HideAuxiliary</key>
<true/>
<key>LauncherPath</key>
@@ -804,7 +824,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>-v keepsyms=1 debug=0x100</string>
<string>keepsyms=1 debug=0x100</string>
<key>run-efi-updater</key>
<string>No</string>
<key>csr-active-config</key>

View File

@@ -10470,6 +10470,138 @@
<key>board-id</key>
<string>Mac-7BA5B2D9E42DDD94</string>
</dict>
<key>iMacProMax1,1</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.AppleUSBHostMergeProperties</string>
<key>IOClass</key>
<string>AppleUSBHostMergeProperties</string>
<key>IONameMatch</key>
<string>SHC1</string>
<key>IOProviderClass</key>
<string>AppleUSBXHCIPCI</string>
<key>IOProviderMergeProperties</key>
<dict>
<key>port-count</key>
<data>FgAAAA==</data>
<key>ports</key>
<dict>
<key>HS02</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>AgAAAA==</data>
</dict>
<key>HS03</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>AwAAAA==</data>
</dict>
<key>HS04</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>BAAAAA==</data>
</dict>
<key>HS05</key>
<dict>
<key>UsbConnector</key>
<integer>9</integer>
<key>port</key>
<data>BQAAAA==</data>
</dict>
<key>HS06</key>
<dict>
<key>UsbConnector</key>
<integer>9</integer>
<key>port</key>
<data>BgAAAA==</data>
</dict>
<key>HS07</key>
<dict>
<key>UsbConnector</key>
<integer>9</integer>
<key>port</key>
<data>BwAAAA==</data>
</dict>
<key>HS08</key>
<dict>
<key>UsbConnector</key>
<integer>9</integer>
<key>port</key>
<data>CAAAAA==</data>
</dict>
<key>HS10</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>CgAAAA==</data>
</dict>
<key>HS12</key>
<dict>
<key>UsbConnector</key>
<integer>255</integer>
<key>port</key>
<data>DAAAAA==</data>
</dict>
<key>HS13</key>
<dict>
<key>UsbConnector</key>
<integer>255</integer>
<key>port</key>
<data>DQAAAA==</data>
</dict>
<key>SS02</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>EgAAAA==</data>
</dict>
<key>SS03</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>EwAAAA==</data>
</dict>
<key>SS04</key>
<dict>
<key>UsbConnector</key>
<integer>255</integer>
<key>kUSBDeviceDescriptorOverride</key>
<data>EgEQAwAAAAmsBQiEAnoDBAIB</data>
<key>kUSBHostPortPropertyCardReader</key>
<true/>
<key>kUSBHostPortPropertyCardReaderValidateDescriptors</key>
<false/>
<key>port</key>
<data>FAAAAA==</data>
</dict>
<key>SS05</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>FQAAAA==</data>
</dict>
<key>SS06</key>
<dict>
<key>UsbConnector</key>
<integer>3</integer>
<key>port</key>
<data>FgAAAA==</data>
</dict>
</dict>
</dict>
<key>model</key>
<string>iXacProMax1,1</string>
</dict>
</dict>
<key>OSBundleRequired</key>
<string>Root</string>

Binary file not shown.