mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 03:50:14 +10:00
Add ACPI path verification for DeviceProperty injection
Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/451
This commit is contained in:
@@ -539,7 +539,7 @@ class BuildOpenCore:
|
|||||||
print(f"- Found dGPU ({i + 1}): {Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}")
|
print(f"- Found dGPU ({i + 1}): {Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}")
|
||||||
self.config["#Revision"][f"Hardware-MacPro-dGPU-{i + 1}"] = f"{Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}"
|
self.config["#Revision"][f"Hardware-MacPro-dGPU-{i + 1}"] = f"{Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}"
|
||||||
|
|
||||||
if device.pci_path:
|
if device.pci_path and device.acpi_path:
|
||||||
print(f"- Found dGPU ({i + 1}) at {device.pci_path}")
|
print(f"- Found dGPU ({i + 1}) at {device.pci_path}")
|
||||||
if isinstance(device, device_probe.AMD):
|
if isinstance(device, device_probe.AMD):
|
||||||
print("- Adding Mac Pro, Xserve DRM patches")
|
print("- Adding Mac Pro, Xserve DRM patches")
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class PCIDevice:
|
|||||||
# ioregistryentry: Optional[ioreg.IORegistryEntry] = None
|
# ioregistryentry: Optional[ioreg.IORegistryEntry] = None
|
||||||
name: Optional[str] = None # Name of IORegistryEntry
|
name: Optional[str] = None # Name of IORegistryEntry
|
||||||
model: Optional[str] = None # model property
|
model: Optional[str] = None # model property
|
||||||
|
acpi_path: Optional[str] = None
|
||||||
pci_path: Optional[str] = None
|
pci_path: Optional[str] = None
|
||||||
|
|
||||||
# def __getstate__(self):
|
# def __getstate__(self):
|
||||||
@@ -48,6 +49,8 @@ class PCIDevice:
|
|||||||
device = cls(vendor_id, device_id, int.from_bytes(properties["class-code"][:6], byteorder="little"), name=ioreg.io_name_t_to_str(ioreg.IORegistryEntryGetName(entry, None)[1]))
|
device = cls(vendor_id, device_id, int.from_bytes(properties["class-code"][:6], byteorder="little"), name=ioreg.io_name_t_to_str(ioreg.IORegistryEntryGetName(entry, None)[1]))
|
||||||
if "model" in properties:
|
if "model" in properties:
|
||||||
device.model = properties["model"].strip(b"\0").decode()
|
device.model = properties["model"].strip(b"\0").decode()
|
||||||
|
if "acpi_path" in properties:
|
||||||
|
device.acpi_path = properties["acpi-path"].strip(b"\0").decode()
|
||||||
device.populate_pci_path(entry)
|
device.populate_pci_path(entry)
|
||||||
return device
|
return device
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user