Fix erroring on XHCI detection

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/236
This commit is contained in:
Mykola Grymalyuk
2021-05-21 07:42:43 -06:00
parent fd48419cb2
commit 88724c4950

View File

@@ -475,8 +475,8 @@ class BuildOpenCore:
devices = plistlib.loads(subprocess.run("ioreg -c IOPCIDevice -r -d2 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
try:
devices = [i for i in devices if i["class-code"] == binascii.unhexlify(self.constants.classcode_xhci)]
vendor_id = self.hexswap(binascii.hexlify(devices[0]["vendor-id"]).decode()[:4])
device_id = self.hexswap(binascii.hexlify(devices[0]["device-id"]).decode()[:4])
vendor_id = Utilities.hexswap(binascii.hexlify(devices[0]["vendor-id"]).decode()[:4])
device_id = Utilities.hexswap(binascii.hexlify(devices[0]["device-id"]).decode()[:4])
print("- Found XHCI Controller, adding Boot Support")
shutil.copy(self.constants.xhci_driver_path, self.constants.drivers_path)
self.config["UEFI"]["Drivers"] += ["XhciDxe.efi"]