Skip to content

Commit

Permalink
Part 3: Fix AppleALC and add legacy USB mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazzzny committed Feb 20, 2025
1 parent 37411b7 commit 7938659
Show file tree
Hide file tree
Showing 4 changed files with 567 additions and 2 deletions.
10 changes: 8 additions & 2 deletions opencore_legacy_patcher/efi_builder/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,24 @@ def _usb_handling(self) -> None:

# USB Map
usb_map_path = Path(self.constants.plist_folder_path) / Path("AppleUSBMaps/Info.plist")
usb_map_path_legacy = Path(self.constants.plist_folder_path) / Path("AppleUSBMapsLegacy/Info.plist")

if (
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.model in model_array.Missing_USB_Map_Ventura)
(self.model in model_array.Missing_USB_Map or self.model in model_array.Missing_USB_Map_Ventura or self.model in model_array.Missing_USB_Map_Legacy)
or self.constants.serial_settings in ["Moderate", "Advanced"])
):
logging.info("- 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)

if self.model in model_array.Missing_USB_Map_Legacy:
shutil.copy(usb_map_path_legacy, self.constants.map_contents_folder)
else:
shutil.copy(usb_map_path, self.constants.map_contents_folder)
support.BuildSupport(self.model, self.constants, self.config).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"]:
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
Expand Down
Loading

0 comments on commit 7938659

Please sign in to comment.