From 084c0cc438347eebeb99984bd43a1c9a751a66e0 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 11 Jun 2022 10:50:18 -0600 Subject: [PATCH] build.py: Add Ventura USB map injection --- CHANGELOG.md | 25 +++++++++++++------------ data/model_array.py | 36 ++++++++++++++++++++++++++++++++++++ resources/build.py | 8 ++++++-- 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89b194b1f..bfd8d8823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # OpenCore Legacy Patcher changelog ## 0.5.0 +- Ventura Specific Updates: + - Switch boot.efi model patch to iMac18,1 + - Resolve pre-Force Touch Trackpad support in Ventura + - Add Ventura-dropped Models: + - MacPro6,1 + - Macmini7,1 + - iMac16,x, iMac17,1 + - MacBook9,1 + - MacBookAir7,x + - MacBookPro11,4/5, MacBookPro12,1, MacBookPro13,x + - Add Ventura Software Catalog parsing + - Add Kernel Debug Kit checks to Ventura root patching + - Add USB map injection for dropped models ## 0.4.6 - Fix Bluetooth support in 12.4 Release @@ -27,18 +40,6 @@ - Deprecate TUI support - Users may still manually run from source for future builds - Binaries will no longer be provided on future release -- Ventura Specific Updates: - - Switch boot.efi model patch to iMac18,1 - - Resolve pre-Force Touch Trackpad support in Ventura - - Add Ventura-dropped Models: - - MacPro6,1 - - Macmini7,1 - - iMac16,x, iMac17,1 - - MacBook9,1 - - MacBookAir7,x - - MacBookPro11,4/5, MacBookPro12,1, MacBookPro13,x - - Add Ventura Software Catalog parsing - - Add Kernel Debug Kit checks to Ventura root patching ## 0.4.5 - Fix AutoPatcher.pkg download on releases diff --git a/data/model_array.py b/data/model_array.py index 22b82d731..e7e6fe688 100644 --- a/data/model_array.py +++ b/data/model_array.py @@ -312,3 +312,39 @@ Missing_USB_Map = [ "Xserve2,1", "Xserve3,1", ] + +Missing_USB_Map_Ventura = [ + "MacBook8,1", + "MacBookAir5,1", + "MacBookAir5,2", + "MacBookAir6,1", + "MacBookAir6,2", + "MacBookAir7,1", + "MacBookAir7,2", + "MacBookPro9,1", + "MacBookPro9,2", + "MacBookPro10,1", + "MacBookPro10,2", + "MacBookPro11,1", + "MacBookPro11,2", + "MacBookPro11,3", + "MacBookPro11,4", + "MacBookPro11,5", + "MacBookPro12,1", + "MacPro5,1", + "MacPro6,1", + "Macmini6,1", + "Macmini6,2", + "Macmini7,1", + "iMac13,1", + "iMac13,2", + "iMac14,1", + "iMac14,2", + "iMac14,3", + "iMac14,4", + "iMac15,1", + "iMac15,2", + "iMac16,1", + "iMac16,2", + "iMac17,1", +] \ No newline at end of file diff --git a/resources/build.py b/resources/build.py index de55e742a..cc95fe536 100644 --- a/resources/build.py +++ b/resources/build.py @@ -432,13 +432,17 @@ class BuildOpenCore: usb_map_path.exists() and (self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True) and self.model not in ["Xserve2,1", "Dortania1,1"] - and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) + and ( + (self.model in model_array.Missing_USB_Map or self.model in model_array.Missing_USB_Map_Ventura) + or self.constants.serial_settings in ["Moderate", "Advanced"]) ): print("- Adding USB-Map.kext") Path(self.constants.map_kext_folder).mkdir() Path(self.constants.map_contents_folder).mkdir() shutil.copy(usb_map_path, self.constants.map_contents_folder) self.get_kext_by_bundle_path("USB-Map.kext")["Enabled"] = True + if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]: + self.get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0" if self.constants.allow_oc_everywhere is False: if self.constants.serial_settings != "None": @@ -1199,7 +1203,7 @@ class BuildOpenCore: if ( self.constants.allow_oc_everywhere is False and self.model not in ["Xserve2,1", "Dortania1,1"] - and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) + and ((self.model in model_array.Missing_USB_Map or self.model in model_array.Missing_USB_Map_Ventura) or self.constants.serial_settings in ["Moderate", "Advanced"]) ): new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist") map_config = plistlib.load(Path(new_map_ls).open("rb"))