From f97381781969cde110180473de827ec7e5710c09 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 22 Jun 2023 20:02:45 -0600 Subject: [PATCH] device_probe.py: Expand NVMe detection to 0x106b Device IDs --- resources/build/storage.py | 12 +++++++----- resources/device_probe.py | 4 +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/build/storage.py b/resources/build/storage.py index 3befb8986..cd7c6e52c 100644 --- a/resources/build/storage.py +++ b/resources/build/storage.py @@ -109,6 +109,8 @@ class BuildStorage: if not self.constants.custom_model and self.constants.allow_nvme_fixing is True: nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)] for i, controller in enumerate(nvme_devices): + if controller.vendor_id == 0x106b: + continue logging.info(f"- Found 3rd Party NVMe SSD ({i + 1}): {utilities.friendly_hex(controller.vendor_id)}:{utilities.friendly_hex(controller.device_id)}") self.config["#Revision"][f"Hardware-NVMe-{i}"] = f"{utilities.friendly_hex(controller.vendor_id)}:{utilities.friendly_hex(controller.device_id)}" @@ -129,11 +131,11 @@ class BuildStorage: # https://github.com/acidanthera/NVMeFix/blob/1.0.9/NVMeFix/NVMeFix.cpp#L220-L225 support.BuildSupport(self.model, self.constants, self.config).enable_kext("NVMeFix.kext", self.constants.nvmefix_version, self.constants.nvmefix_path) - if (controller.vendor_id == 0x106b and controller.device_id in [0x2001, 0x2003]): - # Restore S1X/S3X NVMe support removed in 14.0 Beta 2 - # - APPLE SSD AP0128H, AP0256H, etc - # - APPLE SSD AP0128J, AP0256J, etc - support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOS3XeFamily.kext", self.constants.s3x_nvme_version, self.constants.s3x_nvme_path) + if any(controller.vendor_id == 0x106b and controller.device_id in [0x2001, 0x2003] for controller in nvme_devices): + # Restore S1X/S3X NVMe support removed in 14.0 Beta 2 + # - APPLE SSD AP0128H, AP0256H, etc + # - APPLE SSD AP0128J, AP0256J, etc + support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOS3XeFamily.kext", self.constants.s3x_nvme_version, self.constants.s3x_nvme_path) # Restore S1X/S3X NVMe support removed in 14.0 Beta 2 diff --git a/resources/device_probe.py b/resources/device_probe.py index d30a4c7d1..148ee5196 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -705,9 +705,7 @@ class Computer: controller = NVMeController.from_ioregistry(parent) controller.aspm = aspm - if controller.vendor_id != 0x106B: - # Handle Apple Vendor ID - self.storage.append(controller) + self.storage.append(controller) ioreg.IOObjectRelease(parent)