mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-22 02:50:15 +10:00
storage.py: Streamline S1X/S3X logic
This commit is contained in:
@@ -106,8 +106,9 @@ class BuildStorage:
|
|||||||
logging.info(f"- Failed to find Device path for PCIe Storage Controller {i}, falling back to Innie")
|
logging.info(f"- Failed to find Device path for PCIe Storage Controller {i}, falling back to Innie")
|
||||||
support.BuildSupport(self.model, self.constants, self.config).enable_kext("Innie.kext", self.constants.innie_version, self.constants.innie_path)
|
support.BuildSupport(self.model, self.constants, self.config).enable_kext("Innie.kext", self.constants.innie_version, self.constants.innie_path)
|
||||||
|
|
||||||
if not self.constants.custom_model and self.constants.allow_nvme_fixing is True:
|
if not self.constants.custom_model:
|
||||||
nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)]
|
nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)]
|
||||||
|
if self.constants.allow_nvme_fixing is True:
|
||||||
for i, controller in enumerate(nvme_devices):
|
for i, controller in enumerate(nvme_devices):
|
||||||
if controller.vendor_id == 0x106b:
|
if controller.vendor_id == 0x106b:
|
||||||
continue
|
continue
|
||||||
@@ -131,15 +132,17 @@ class BuildStorage:
|
|||||||
# https://github.com/acidanthera/NVMeFix/blob/1.0.9/NVMeFix/NVMeFix.cpp#L220-L225
|
# 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)
|
support.BuildSupport(self.model, self.constants, self.config).enable_kext("NVMeFix.kext", self.constants.nvmefix_version, self.constants.nvmefix_path)
|
||||||
|
|
||||||
if any(controller.vendor_id == 0x106b and controller.device_id in [0x2001, 0x2003] for controller in nvme_devices):
|
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
|
# Restore S1X/S3X NVMe support removed in 14.0 Beta 2
|
||||||
# - APPLE SSD AP0128H, AP0256H, etc
|
# - APPLE SSD AP0128H, AP0256H, etc
|
||||||
# - APPLE SSD AP0128J, AP0256J, 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)
|
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
|
# Restore S1X/S3X NVMe support removed in 14.0 Beta 2
|
||||||
if self.model in ["MacBook8,1", "MacBook9,1", "MacBook10,1", "MacBookPro13,1", "MacBookPro14,1"]:
|
# Apple's usage of the S1X and S3X is quite sporadic and inconsistent, so we'll try a catch all for units with NVMe drives
|
||||||
|
if self.constants.custom_model and self.model in smbios_data.smbios_dictionary:
|
||||||
|
if "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
|
||||||
|
if cpu_data.CPUGen.broadwell <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.CPUGen.kaby_lake:
|
||||||
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOS3XeFamily.kext", self.constants.s3x_nvme_version, self.constants.s3x_nvme_path)
|
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOS3XeFamily.kext", self.constants.s3x_nvme_version, self.constants.s3x_nvme_path)
|
||||||
|
|
||||||
# Apple RAID Card check
|
# Apple RAID Card check
|
||||||
|
|||||||
Reference in New Issue
Block a user