Add Apple RAID Card support

This commit is contained in:
Mykola Grymalyuk
2021-11-25 17:57:31 -07:00
parent 60221edb07
commit b1df91cac3
6 changed files with 56 additions and 2 deletions
+1
View File
@@ -27,6 +27,7 @@
- Fix Wifi Password prompt in Monterey on legacy wifi - Fix Wifi Password prompt in Monterey on legacy wifi
- Applicable for Atheros, BCM94328, BCM94322 - Applicable for Atheros, BCM94328, BCM94322
- Fix OpenCL Acceleration on Ivy Bridge and Kepler - Fix OpenCL Acceleration on Ivy Bridge and Kepler
- Add Apple RAID Card support
## 0.3.1 ## 0.3.1
- Increment Binaries: - Increment Binaries:
+19 -1
View File
@@ -1119,7 +1119,7 @@
<key>BundlePath</key> <key>BundlePath</key>
<string>LegacyUSBVideoSupport.kext</string> <string>LegacyUSBVideoSupport.kext</string>
<key>Comment</key> <key>Comment</key>
<string>Legayc iSight support</string> <string>Legacy iSight support</string>
<key>Enabled</key> <key>Enabled</key>
<false/> <false/>
<key>ExecutablePath</key> <key>ExecutablePath</key>
@@ -1131,6 +1131,24 @@
<key>PlistPath</key> <key>PlistPath</key>
<string>Contents/Info.plist</string> <string>Contents/Info.plist</string>
</dict> </dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleRAIDCard.kext</string>
<key>Comment</key>
<string>RAID Card Support</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleRAIDCard</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
</array> </array>
<key>Block</key> <key>Block</key>
<array/> <array/>
Binary file not shown.
+13
View File
@@ -718,6 +718,19 @@ class BuildOpenCore:
print("- Adding SATA Hibernation Patch") print("- Adding SATA Hibernation Patch")
self.config["Kernel"]["Quirks"]["ThirdPartyDrives"] = True self.config["Kernel"]["Quirks"]["ThirdPartyDrives"] = True
break break
# Apple RAID Card check
if not self.constants.custom_model:
if self.computer.storage:
for storage_controller in self.computer.storage:
if storage_controller.vendor_id == 0x106b and storage_controller.device_id == 0x008A:
# AppleRAIDCard.kext only supports pci106b,8a
self.enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path)
break
elif self.model.startswith("XServe"):
# For XServes, assume RAID is present
# Namely due to Xserve2,1 being limited to 10.7, thus no hardware detection
self.enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path)
# DEBUG Settings # DEBUG Settings
if self.constants.verbose_debug is True: if self.constants.verbose_debug is True:
+6 -1
View File
@@ -47,7 +47,8 @@ class Constants:
self.piixata_version = "1.0.1" # AppleIntelPIIXATA self.piixata_version = "1.0.1" # AppleIntelPIIXATA
self.fw_kext = "1.0.1" # IOFireWireFamily self.fw_kext = "1.0.1" # IOFireWireFamily
self.apple_trackpad = "1.0.1" # AppleUSBTrackpad self.apple_trackpad = "1.0.1" # AppleUSBTrackpad
self.apple_isight_version = "1.0.0" # AppleISight self.apple_isight_version = "1.0.0" # AppleiSight
self.apple_raid_version = "1.0.0" # AppleRAIDCard
## Apple - Dortania Modified ## Apple - Dortania Modified
self.bcm570_version = "1.0.2" # CatalinaBCM5701Ethernet self.bcm570_version = "1.0.2" # CatalinaBCM5701Ethernet
@@ -349,6 +350,10 @@ class Constants:
@property @property
def apple_isight_path(self): def apple_isight_path(self):
return self.payload_kexts_path / Path(f"Misc/LegacyUSBVideoSupport-v{self.apple_isight_version}.zip") return self.payload_kexts_path / Path(f"Misc/LegacyUSBVideoSupport-v{self.apple_isight_version}.zip")
@property
def apple_raid_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleRAIDCard-v{self.apple_raid_version}.zip")
@property @property
def plist_folder_path(self): def plist_folder_path(self):
+17
View File
@@ -154,6 +154,10 @@ class NVMeController(PCIDevice):
class SATAController(PCIDevice): class SATAController(PCIDevice):
CLASS_CODE: ClassVar[int] = 0x010601 CLASS_CODE: ClassVar[int] = 0x010601
@dataclass
class SASController(PCIDevice):
CLASS_CODE: ClassVar[int] = 0x010400
@dataclass @dataclass
class NVIDIA(GPU): class NVIDIA(GPU):
@@ -417,6 +421,14 @@ class Computer:
None, None,
)[1] )[1]
) )
sas_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault,
{"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex(utilities.hexswap(hex(SASController.CLASS_CODE)[2:].zfill(8)))}]},
None,
)[1]
)
nvme_controllers = ioreg.ioiterator_to_list( nvme_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices( ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault, {"IOProviderClass": "IONVMeController", "IOParentMatch": {"IOProviderClass": "IOPCIDevice"}, "IOPropertyMatch": {"IOClass": "IONVMeController"}}, None ioreg.kIOMasterPortDefault, {"IOProviderClass": "IONVMeController", "IOParentMatch": {"IOProviderClass": "IOPCIDevice"}, "IOPropertyMatch": {"IOClass": "IONVMeController"}}, None
@@ -425,6 +437,11 @@ class Computer:
for device in sata_controllers: for device in sata_controllers:
self.storage.append(SATAController.from_ioregistry(device)) self.storage.append(SATAController.from_ioregistry(device))
ioreg.IOObjectRelease(device) ioreg.IOObjectRelease(device)
for device in sas_controllers:
self.storage.append(SASController.from_ioregistry(device))
ioreg.IOObjectRelease(device)
for device in nvme_controllers: for device in nvme_controllers:
parent = ioreg.IORegistryEntryGetParentEntry(device, "IOService".encode(), None)[1] parent = ioreg.IORegistryEntryGetParentEntry(device, "IOService".encode(), None)[1]
ioreg.IOObjectRelease(device) ioreg.IOObjectRelease(device)