diff --git a/CHANGELOG.md b/CHANGELOG.md index 12bb220b2..2cda31818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - 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 diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 8715929a1..23766d0f6 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -41,6 +41,76 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' 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", ["""Many thanks to the following: @@ -85,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] ] diff --git a/Resources/Constants.py b/Resources/Constants.py index 819240c13..e8c1d64e2 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -38,10 +38,14 @@ class Constants: self.current_gpuv: str = None self.current_gpud: str = None - # Debug Settings + # 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 diff --git a/Resources/ModelArray.py b/Resources/ModelArray.py index ac52f2392..c7a7ee500 100644 --- a/Resources/ModelArray.py +++ b/Resources/ModelArray.py @@ -793,4 +793,8 @@ NightShiftExclude = [ "iMac14,1", "iMac14,2", "iMac14,3", +] + +UGAtoGOP = [ + "MacPro3,1" ] \ No newline at end of file diff --git a/Resources/build.py b/Resources/build.py index 357ebe17a..9a9fc6afa 100644 --- a/Resources/build.py +++ b/Resources/build.py @@ -192,13 +192,22 @@ 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"] + + # 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): diff --git a/payloads/Kexts/Acidanthera/AirportBrcmFixup-v2.1.2.zip b/payloads/Kexts/Acidanthera/AirportBrcmFixup-v2.1.2.zip index 049e9e666..6a671bde9 100644 Binary files a/payloads/Kexts/Acidanthera/AirportBrcmFixup-v2.1.2.zip and b/payloads/Kexts/Acidanthera/AirportBrcmFixup-v2.1.2.zip differ diff --git a/payloads/Kexts/Acidanthera/CPUFriend-v1.2.3.zip b/payloads/Kexts/Acidanthera/CPUFriend-v1.2.3.zip index 448a4ded1..d56143812 100644 Binary files a/payloads/Kexts/Acidanthera/CPUFriend-v1.2.3.zip and b/payloads/Kexts/Acidanthera/CPUFriend-v1.2.3.zip differ diff --git a/payloads/Kexts/Acidanthera/Lilu-v1.5.1.zip b/payloads/Kexts/Acidanthera/Lilu-v1.5.1.zip index 6e017eede..4f1334979 100644 Binary files a/payloads/Kexts/Acidanthera/Lilu-v1.5.1.zip and b/payloads/Kexts/Acidanthera/Lilu-v1.5.1.zip differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.0.zip b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.0.zip index 9f31ec234..e852830d2 100644 Binary files a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.0.zip and b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.0.zip differ diff --git a/payloads/Kexts/Acidanthera/WhateverGreen-v1.4.8.zip b/payloads/Kexts/Acidanthera/WhateverGreen-v1.4.8.zip index 03b0191e6..f3d2a0dc4 100644 Binary files a/payloads/Kexts/Acidanthera/WhateverGreen-v1.4.8.zip and b/payloads/Kexts/Acidanthera/WhateverGreen-v1.4.8.zip differ diff --git a/payloads/Kexts/Misc/NightShiftEnabler-v1.1.0.zip b/payloads/Kexts/Misc/NightShiftEnabler-v1.1.0.zip index 41681548b..f7abc7cce 100644 Binary files a/payloads/Kexts/Misc/NightShiftEnabler-v1.1.0.zip and b/payloads/Kexts/Misc/NightShiftEnabler-v1.1.0.zip differ