mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 12:48:18 +10:00
sys_patch: Add basic USB 1.1 support
Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -192,16 +192,16 @@ class build_misc:
|
||||
# - 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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -252,14 +252,4 @@ class generate_defaults:
|
||||
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"])
|
||||
self.constants.disable_amfi = True
|
||||
@@ -3590,11 +3590,11 @@ OpenCore Legacy Patcher by default knows the most ideal
|
||||
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 @@ OpenCore Legacy Patcher by default knows the most ideal
|
||||
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 @@ OpenCore Legacy Patcher by default knows the most ideal
|
||||
|
||||
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())
|
||||
@@ -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 @@ class detect_root_patch:
|
||||
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 @@ class detect_root_patch:
|
||||
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 @@ class detect_root_patch:
|
||||
"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 @@ class detect_root_patch:
|
||||
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}")
|
||||
|
||||
Reference in New Issue
Block a user