sys_patch: Add PCIe Webcam support

This commit is contained in:
Mykola Grymalyuk
2023-07-17 18:05:33 -06:00
parent 2bba8f474a
commit 7691184ca2
9 changed files with 74 additions and 6 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
- utilities.py:
- Fix indexing error on Device Paths (thx [@Ausdauersportler](https://github.com/Ausdauersportler))
- Increment Binaries:
- PatcherSupportPkg 1.1.6 - release
- PatcherSupportPkg 1.1.7 - release
## 0.6.7
- Resolve partition buttons overlapping in Install OpenCore UI
+22 -1
View File
@@ -1290,6 +1290,27 @@ class SystemPatchDictionary():
"IOUSBHostFamily.kext": "12.6.2",
},
},
}
},
"PCIe Web Camera": {
"Display Name": "Miscellaneous: PCIe Web Camera",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.sonoma,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install Non-Root": {
"/Library/CoreMediaIO/Plug-Ins": {
"AppleCamera.plugin": "14.0 Beta 1"
},
"/Library/LaunchDaemons": {
"com.apple.cmio.AppleCameraAssistant.plist": "14.0 Beta 1"
},
},
},
},
}
+18
View File
@@ -1671,6 +1671,24 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>PCIe Camera</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>23.0.0</string>
<key>BundlePath</key>
<string>AppleCameraInterface.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleCameraInterface</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
</array>
<key>Block</key>
<array>
Binary file not shown.
+11 -3
View File
@@ -237,10 +237,18 @@ class BuildMiscellaneous:
"""
iSight Handler
"""
if self.model in smbios_data.smbios_dictionary:
if "Legacy iSight" in smbios_data.smbios_dictionary[self.model]:
if smbios_data.smbios_dictionary[self.model]["Legacy iSight"] is True:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("LegacyUSBVideoSupport.kext", self.constants.apple_isight_version, self.constants.apple_isight_path)
if "Legacy iSight" in smbios_data.smbios_dictionary[self.model]:
if smbios_data.smbios_dictionary[self.model]["Legacy iSight"] is True:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("LegacyUSBVideoSupport.kext", self.constants.apple_isight_version, self.constants.apple_isight_path)
if not self.constants.custom_model:
if self.constants.computer.pcie_webcam is True:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleCameraInterface.kext", self.constants.apple_camera_version, self.constants.apple_camera_path)
else:
if self.model.startswith("MacBook") and self.model in smbios_data.smbios_dictionary:
if cpu_data.CPUGen.haswell <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.CPUGen.kaby_lake:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleCameraInterface.kext", self.constants.apple_camera_version, self.constants.apple_camera_path)
def _usb_handling(self) -> None:
+6 -1
View File
@@ -13,7 +13,7 @@ class Constants:
def __init__(self) -> None:
# Patcher Versioning
self.patcher_version: str = "0.6.8" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.1.6" # PatcherSupportPkg
self.patcher_support_pkg_version: str = "1.1.7" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2023 Dortania"
self.patcher_name: str = "OpenCore Legacy Patcher"
@@ -65,6 +65,7 @@ class Constants:
self.apple_usb_11_injector: str = "1.0.0" # AppleUSBUHCI/OHCI
self.aicpupm_version: str = "1.0.0" # AppleIntelCPUPowerManagement/Client
self.s3x_nvme_version: str = "1.0.0" # IONVMeFamily (14.0 Beta 1, S1X and S3X classes)
self.apple_camera_version: str = "1.0.0" # AppleCameraInterface (14.0 Beta 1)
## Apple - Dortania Modified
self.bcm570_version: str = "1.0.2" # CatalinaBCM5701Ethernet
@@ -539,6 +540,10 @@ class Constants:
def s3x_nvme_path(self):
return self.payload_kexts_path / Path(f"Misc/IOS3XeFamily-v{self.s3x_nvme_version}.zip")
@property
def apple_camera_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleCameraInterface-v{self.apple_camera_version}.zip")
@property
def plist_folder_path(self):
return self.payload_kexts_path / Path("Plists")
+9
View File
@@ -630,6 +630,7 @@ class Computer:
trackpad_type: Optional[str] = None
ambient_light_sensor: Optional[bool] = False
third_party_sata_ssd: Optional[bool] = False
pcie_webcam: Optional[bool] = False
secure_boot_model: Optional[str] = None
secure_boot_policy: Optional[int] = None
oclp_sys_version: Optional[str] = None
@@ -655,6 +656,7 @@ class Computer:
computer.bluetooth_probe()
computer.topcase_probe()
computer.ambient_light_sensor_probe()
computer.pcie_webcam_probe()
computer.sata_disk_probe()
computer.oclp_sys_patch_probe()
computer.check_rosetta()
@@ -733,6 +735,13 @@ class Computer:
self.ambient_light_sensor = True
ioreg.IOObjectRelease(device)
def pcie_webcam_probe(self):
# CMRA/14E4:1570
device = next(ioreg.ioiterator_to_list(ioreg.IOServiceGetMatchingServices(ioreg.kIOMasterPortDefault, ioreg.IOServiceNameMatching("CMRA".encode()), None)[1]), None)
if device:
self.pcie_webcam = True
ioreg.IOObjectRelease(device)
def sdxc_controller_probe(self):
sdxc_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
+4
View File
@@ -61,6 +61,7 @@ class DetectRootPatch:
self.legacy_gmux = False
self.legacy_keyboard_backlight = False
self.legacy_uhci_ohci = False
self.legacy_pcie_webcam = False
# Patch Requirements
self.amfi_must_disable = False
@@ -519,6 +520,8 @@ class DetectRootPatch:
self.has_network = network_handler.NetworkUtilities().verify_network_connection()
self.legacy_pcie_webcam = self.constants.computer.pcie_webcam
if self._check_uhci_ohci() is True:
self.legacy_uhci_ohci = True
self.requires_root_kc = True
@@ -591,6 +594,7 @@ class DetectRootPatch:
"Miscellaneous: Legacy GMUX": self.legacy_gmux,
"Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight,
"Miscellaneous: Legacy USB 1.1": self.legacy_uhci_ohci,
"Miscellaneous: PCIe Web Camera": self.legacy_pcie_webcam,
"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,
@@ -187,6 +187,9 @@ class GenerateRootPatchSets:
if self.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 self.hardware_details["Miscellaneous: PCIe Web Camera"] is True:
required_patches.update({"PCIe Web Camera": all_hardware_patchset["Miscellaneous"]["PCIe Web Camera"]})
if required_patches:
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")