build.py: Add Ventura USB map injection

This commit is contained in:
Mykola Grymalyuk
2022-06-11 10:50:18 -06:00
parent 12ebef03db
commit 084c0cc438
3 changed files with 55 additions and 14 deletions
+6 -2
View File
@@ -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"))