diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fa383120..dbe0dc5179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,9 +18,13 @@ - Allows for easy root patching, dropping reliance on Safe Mode to boot - Primarily applicable for Mac Pros with AMD Polaris and Vega GPUs - Implement mini validation during GUI build +- Add early UHCI/OHCI support (USB1.1) + - Implemented via Root Volume patching, ie. no installer support at this time + - Applicable for Penryn Macs and Cheese Grater Mac Pros (MacPro3,1 - MacPro5,1) + - See associated issue for current limitations: [Legacy UHCI/OHCI support in Ventura](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021) - Increment Binaries: - OpenCorePkg 0.8.8 - release - - PatcherSupportPkg 0.7.3 - release + - PatcherSupportPkg 0.7.4 - release - KDKlessWorkaround 1.0.0 - rolling (4924276) - FeatureUnlock 1.1.2 - release - CPUFriend 1.2.6 - release diff --git a/data/sys_patch_dict.py b/data/sys_patch_dict.py index ca4254b873..ecd813e8c7 100644 --- a/data/sys_patch_dict.py +++ b/data/sys_patch_dict.py @@ -1030,6 +1030,28 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): "defaults write /Library/Preferences/.GlobalPreferences.plist Moraea_BacklightHack -bool true": True, }, }, + "Legacy USB 1.1": { + "Display Name": "Miscellaneous: Legacy USB 1.1", + "OS Support": { + "Minimum OS Support": { + "OS Major": os_data.os_data.ventura, + "OS Minor": 0 + }, + "Maximum OS Support": { + "OS Major": os_data.os_data.max_os, + "OS Minor": 99 + }, + }, + "Install Reference": { + "/System/Library/Extensions/IOUSBHostFamily.kext/Contents/MacOS": { + "IOUSBHostFamily": "12.6.2", + }, + "/System/Library/Extensions/IOUSBHostFamily.kext/Contents/PlugIns": { + "AppleUSBEHCI.kext": "12.6.2", + "AppleUSBHub.kext": "12.6.2", + }, + }, + } }, } diff --git a/resources/build/misc.py b/resources/build/misc.py index f54a5f9525..6cb9c199ea 100644 --- a/resources/build/misc.py +++ b/resources/build/misc.py @@ -192,16 +192,16 @@ def usb_handling(self): # - IOUSBHostFamily.kext (only kext itself, not plugins) # - AppleUSBHub.kext # - AppleUSBEHCI.kext - # if ( - # smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \ - # self.model in ["MacPro4,1", "MacPro5,1"] - # ): - # print("- Adding UHCI/OHCI USB support") - # shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path) - # support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True - # support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True - # support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True - # support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True + if ( + smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \ + self.model in ["MacPro4,1", "MacPro5,1"] + ): + print("- Adding UHCI/OHCI USB support") + shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path) + support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True + support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True + support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True + support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True def debug_handling(self): # DEBUG Settings (OpenCorePkg and Kernel Space) diff --git a/resources/constants.py b/resources/constants.py index 688a7d8f47..384f6b105f 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -13,7 +13,7 @@ class Constants: def __init__(self): # Patcher Versioning self.patcher_version = "0.5.4" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version = "0.7.3" # PatcherSupportPkg + self.patcher_support_pkg_version = "0.7.4" # PatcherSupportPkg self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/" self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/" self.discord_link = "https://discord.gg/rqdPgH8xSN" diff --git a/resources/defaults.py b/resources/defaults.py index 1d96f8e7fb..e51cbcdfd8 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -252,14 +252,4 @@ def gpu_probe(self): self.constants.disable_cs_lv = True if os_data.os_data.ventura in self.constants.legacy_accel_support: # Only disable AMFI if we officially support Ventura - self.constants.disable_amfi = True - - if self.host_is_target: - self.constants.host_is_non_metal = True - # If a Mac is non-Metal based, Beta Blur is highly recommended - if self.constants.detected_os >= os_data.os_data.big_sur: - for arg in ["Moraea_BlurBeta"]: - # If user explicitly set the blur, don't override - arg_result = subprocess.run(["defaults", "read", "-g", arg], stdout=subprocess.PIPE).stdout.decode("utf-8").strip() - if arg_result not in ["true", "1", "false", "0"]: - subprocess.run(["defaults", "write", "-g", arg, "-bool", "TRUE"]) \ No newline at end of file + self.constants.disable_amfi = True \ No newline at end of file diff --git a/resources/gui/gui_main.py b/resources/gui/gui_main.py index f167ee2021..f3a8422803 100644 --- a/resources/gui/gui_main.py +++ b/resources/gui/gui_main.py @@ -3590,11 +3590,11 @@ def non_metal_config_menu(self, event=None): else: is_blur_enabled = False - is_rim_enabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBeta"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip() - if is_rim_enabled in ["1", "true"]: - is_rim_enabled = True + is_rim_disabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBetaDisabled"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip() + if is_rim_disabled in ["1", "true"]: + is_rim_disabled = True else: - is_rim_enabled = False + is_rim_disabled = False # Checkbox: Dark Menu Bar self.dark_menu_bar_checkbox = wx.CheckBox(self.frame_modal, label="Dark Menu Bar") @@ -3610,8 +3610,8 @@ def non_metal_config_menu(self, event=None): self.enable_beta_blur_checkbox.SetPosition(wx.Point(self.dark_menu_bar_checkbox.GetPosition().x, self.dark_menu_bar_checkbox.GetPosition().y + self.dark_menu_bar_checkbox.GetSize().height + 7)) # Checkbox: Enable Beta Rim - self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Enable Beta Rim") - self.enable_beta_rim_checkbox.SetValue(is_rim_enabled) + self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Disable Beta Rim") + self.enable_beta_rim_checkbox.SetValue(is_rim_disabled) self.enable_beta_rim_checkbox.Bind(wx.EVT_CHECKBOX, self.enable_beta_rim_click) self.enable_beta_rim_checkbox.SetPosition(wx.Point(self.enable_beta_blur_checkbox.GetPosition().x, self.enable_beta_blur_checkbox.GetPosition().y + self.enable_beta_blur_checkbox.GetSize().height + 7)) @@ -3640,7 +3640,7 @@ def enable_dark_menubar_click(self, event=None): def enable_beta_rim_click(self, event=None): if event.IsChecked(): - subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "true"]) + subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "true"]) else: - subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "false"]) + subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "false"]) print("Beta Rim Enabled:", event.IsChecked()) \ No newline at end of file diff --git a/resources/sys_patch/sys_patch_detect.py b/resources/sys_patch/sys_patch_detect.py index 767828cbc7..5537deb251 100644 --- a/resources/sys_patch/sys_patch_detect.py +++ b/resources/sys_patch/sys_patch_detect.py @@ -5,7 +5,7 @@ from resources import constants, device_probe, utilities, amfi_detect from resources.sys_patch import sys_patch_helpers -from data import model_array, os_data, sip_data, sys_patch_dict +from data import model_array, os_data, sip_data, sys_patch_dict, smbios_data, cpu_data import py_sip_xnu from pathlib import Path @@ -39,6 +39,7 @@ def __init__(self, model, versions): self.legacy_wifi = False self.legacy_gmux = False self.legacy_keyboard_backlight = False + self.legacy_uhci_ohci = False # Patch Requirements self.amfi_must_disable = False @@ -364,9 +365,41 @@ def check_sip(self): sip_value = f"For Hackintoshes, please set csr-active-config to '03060000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS" return (sip, sip_value, sip_hex) + def check_uhci_ohci(self): + if self.constants.detected_os < os_data.os_data.ventura: + return False + + # If we're on a hackintosh, check for UHCI/OHCI controllers + if self.constants.host_is_hackintosh is True: + for controller in self.constants.computer.usb_controllers: + if ( + isinstance(controller, device_probe.UHCIController) or + isinstance(controller, device_probe.OHCIController) + ): + return True + return False + + if self.model not in smbios_data.smbios_dictionary: + return False + + # If we're on a Mac, check for Penryn or older + # This is due to Apple implementing an internal USB hub on post-Penryn (excluding MacPro4,1 and MacPro5,1) + # Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710 + if ( + smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \ + self.model in ["MacPro4,1", "MacPro5,1"] + ): + return True + + return False + def detect_patch_set(self): self.has_network = utilities.verify_network_connection() + if self.check_uhci_ohci() is True: + self.legacy_uhci_ohci = True + self.requires_root_kc = True + if self.model in model_array.LegacyBrightness: if self.constants.detected_os > os_data.os_data.catalina: self.brightness_legacy = True @@ -423,6 +456,7 @@ def detect_patch_set(self): "Networking: Legacy Wireless": self.legacy_wifi, "Miscellaneous: Legacy GMUX": self.legacy_gmux, "Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight, + "Miscellaneous: Legacy USB 1.1": self.legacy_uhci_ohci, "Settings: Requires AMFI exemption": self.amfi_must_disable, "Settings: Supports Auxiliary Cache": not self.requires_root_kc, "Settings: Kernel Debug Kit missing": self.missing_kdk if self.constants.detected_os >= os_data.os_data.ventura.value else False, @@ -641,6 +675,8 @@ def generate_patchset(self, hardware_details): required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]}) if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True: required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]}) + if hardware_details["Miscellaneous: Legacy USB 1.1"] is True: + required_patches.update({"Legacy USB 1.1": all_hardware_patchset["Miscellaneous"]["Legacy USB 1.1"]}) if required_patches: host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")