From 2c848c9618519a9684528d4c386cea7a1a5b73b7 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Mon, 17 Feb 2025 14:30:02 +0700 Subject: [PATCH] Add USBInjectAll kext --- OpCore-Simplify.py | 25 +++++++++++++++++-------- Scripts/config_prodigy.py | 3 ++- Scripts/datasets/kext_data.py | 9 +++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/OpCore-Simplify.py b/OpCore-Simplify.py index 5921f89..a0f8bbb 100644 --- a/OpCore-Simplify.py +++ b/OpCore-Simplify.py @@ -237,24 +237,33 @@ class OCPE: print("OpenCore EFI build complete.") time.sleep(2) - def results(self, hardware_report, smbios_model): + def results(self, hardware_report, smbios_model, kexts): self.u.head("Results") print("") print("Your OpenCore EFI for {} has been built at:".format(hardware_report.get("Motherboard").get("Name"))) print("\t{}".format(self.result_dir)) + for kext in kexts: + if kext.name == "USBInjectAll": + if kext.checked: + print("\033[0;31mNote: USBInjectAll is not recommended. Please use USBMap.kext instead.\033[0m") + print("") + print("To use USBMap.kext:") + print("") + print("* Remove USBInjectAll.kext from the {} folder.".format("EFI\\OC\\Kexts" if os.name == "nt" else "EFI/OC/Kexts")) + else: + print("") + print("Before using EFI, please complete the following steps:") print("") - print("Before using EFI, please complete the following steps:") - print("") - print("1. Use USBToolBox:") + print("* Use USBToolBox:") print(" - Mapping USB with the option 'Use Native Class' enabled.") print(" - Use the model identifier '{}'.".format(smbios_model)) print("") - print("2. Add USBMap.kext:") - print(" - Place the created USBMap.kext file into the {} folder.".format("EFI\\OC\\Kexts" if os.name == "nt" else "EFI/OC/Kexts")) + print("* Add created USBMap.kext into the {} folder.".format("EFI\\OC\\Kexts" if os.name == "nt" else "EFI/OC/Kexts")) print("") - print("3. Edit config.plist:") + print("* Edit config.plist:") print(" - Use ProperTree to open your config.plist.") print(" - Run OC Snapshot by pressing Command/Ctrl + R.") + print(" - If you have more than 15 ports on a single controller, enable the XhciPortLimit patch.") print(" - Save the file when finished.") print("") self.u.open_folder(self.result_dir) @@ -340,7 +349,7 @@ class OCPE: elif option == 6: self.gathering_files(macos_version) self.build_opencore_efi(hardware_report, unsupported_devices, smbios_model, macos_version, needs_oclp) - self.results(hardware_report, smbios_model) + self.results(hardware_report, smbios_model, self.k.kexts) if __name__ == '__main__': update_flag = updater.Updater().run_update() diff --git a/Scripts/config_prodigy.py b/Scripts/config_prodigy.py index 4b5a10c..1cd0bba 100644 --- a/Scripts/config_prodigy.py +++ b/Scripts/config_prodigy.py @@ -609,7 +609,6 @@ class ConfigProdigy: config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] = self.boot_args(hardware_report, macos_version, kexts, config["Booter"]["Quirks"]["ResizeAppleGpuBars"] == 0) config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = self.utils.hex_to_bytes(self.csr_active_config(macos_version)) config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["prev-lang:kbd"] = "en:252" - config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"].append("csr-active-config") config["PlatformInfo"]["Generic"].update(self.smbios.generate_smbios(smbios_model)) config["PlatformInfo"]["Generic"]["ROM"] = self.utils.hex_to_bytes(config["PlatformInfo"]["Generic"]["ROM"]) @@ -629,6 +628,8 @@ class ConfigProdigy: if kext.name == "BlueToolFixup": config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothExternalDongleFailed"] = self.utils.hex_to_bytes("00") config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothInternalControllerInfo"] = self.utils.hex_to_bytes("0000000000000000000000000000") + elif kext.name == "USBInjectAll": + config["Kernel"]["Quirks"]["XhciPortLimit"] = True elif kext.name == "RestrictEvents": revpatch = [] revblock = [] diff --git a/Scripts/datasets/kext_data.py b/Scripts/datasets/kext_data.py index 542a557..85790e8 100644 --- a/Scripts/datasets/kext_data.py +++ b/Scripts/datasets/kext_data.py @@ -390,6 +390,15 @@ kexts = [ "repo": "GUX-RyzenXHCIFix" } ), + KextInfo( + name = "USBInjectAll", + description = "Inject all USB ports for the installed Intel EHCI/XHCI chipset automatically", + category = "USB", + github_repo = { + "owner": "daliansky", + "repo": "OS-X-USB-Inject-All" + } + ), KextInfo( name = "XHCI-unsupported", description = "Enables USB 3.0 support for unsupported xHCI controllers",