Add NVMe and FireWire support

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/267
This commit is contained in:
Mykola Grymalyuk
2021-06-05 11:38:04 -06:00
parent 95afb7d109
commit 375b7c2fd2
10 changed files with 155 additions and 0 deletions

View File

@@ -1,6 +1,9 @@
# OpenCore Legacy Patcher changelog
## 0.1.7
- Add FireWire Boot Support for Catalina and newer
- Add NVMe firmware support for older models (ie. MacPro3,1)
- OpenCore must be stored on a bootable volume (ie. USB or SATA)
## 0.1.6
- Add XHCI UEFI Driver for 3rd Party USB 3.0 Controllers

View File

@@ -100,6 +100,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"Enable Kext DEBUG:\t\t\tCurrently {self.constants.kext_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_kext],
[f"Set ShowPicker Mode:\t\tCurrently {self.constants.showpicker}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_showpicker],
[f"Set Vault Mode:\t\t\tCurrently {self.constants.vault}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_vault],
[f"Allow FireWire Boot:\t\tCurrently {self.constants.firewire_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).allow_firewire],
[f"Allow NVMe Boot:\t\t\tCurrently {self.constants.nvme_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).allow_nvme],
[f"Set SIP and SecureBootModel:\tSIP: {self.constants.sip_status} SBM: {self.constants.secure_status}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_sip],
[f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).allow_native_models],
[f"Advanced Patch Settings, for developers only", self.advanced_patcher_settings],

View File

@@ -395,6 +395,14 @@ class BuildOpenCore:
else:
self.config["DeviceProperties"]["Add"][hdef_path] = {"apple-layout-id": 90, "use-apple-layout-id": 1, "use-layout-id": 1, }
# Enable FireWire Boot Support
if self.constants.firewire_boot is True and self.model not in ModelArray.NoFireWireSupport:
print("- Enabling FireWire Boot Support")
self.enable_kext("IOFireWireFamily.kext", self.constants.fw_kext, self.constants.fw_family_path)
self.enable_kext("IOFireWireSBP2.kext", self.constants.fw_kext, self.constants.fw_sbp2_path)
self.enable_kext("IOFireWireSerialBusProtocolTransport.kext", self.constants.fw_kext, self.constants.fw_bus_path)
self.get_kext_by_bundle_path("IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext")["Enabled"] = True
def backlight_path_detection(self):
if not self.constants.custom_model:
dgpu_vendor,dgpu_device,dgpu_acpi = DeviceProbe.pci_probe().gpu_probe("GFX0")
@@ -537,6 +545,11 @@ class BuildOpenCore:
except IndexError:
print("- No XHCI Controller Found (I)")
if self.constants.nvme_boot is True:
print("- Enabling NVMe boot support")
shutil.copy(self.constants.nvme_driver_path, self.constants.drivers_path)
self.config["UEFI"]["Drivers"] += ["NvmExpressDxe.efi"]
# Add OpenCanopy
print("- Adding OpenCanopy GUI")
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)

View File

@@ -438,3 +438,49 @@ Valid options:
self.constants.override_smbios = self.constants.custom_model or self.current_model
else:
print("Returning to main menu")
def allow_firewire(self):
Utilities.cls()
Utilities.header(["Allow FireWire Boot Support"])
print("""
In macOS Catalina and newer, Apple restricted
usage of FireWire devices to boot macOS for
security concerns relating to DMA access.
If you are comfortable lowering the security,
you can re-enable FireWire support for Catalina
and newer.
Note: MacBook5,x-7,1 don't support FireWire boot
""")
change_menu = input("Enable FireWire Boot support?(y/n): ")
if change_menu == "y":
self.constants.firewire_boot = True
elif change_menu == "n":
self.constants.firewire_boot = False
else:
print("Invalid option")
def allow_nvme(self):
Utilities.cls()
Utilities.header(["Allow NVMe UEFI Support"])
print("""
For machines not natively supporting NVMe,
this option allows you to see and boot NVMe
drive in OpenCore's picker
Not required if your machine natively supports NVMe
Note: You must have OpenCore on a bootable volume
first, ie. USB or SATA drive. Once loaded,
OpenCore will enable NVMe support in it's picker
""")
change_menu = input("Enable NVMe Boot support?(y/n): ")
if change_menu == "y":
self.constants.nvme_boot = True
elif change_menu == "n":
self.constants.nvme_boot = False
else:
print("Invalid option")

View File

@@ -39,6 +39,7 @@ class Constants:
self.nvmefix_version = "1.0.7"
self.sidecarfixup_version = "1.0.0"
self.innie_version = "1.3.0"
self.fw_kext = "1.0.0"
self.payload_version = "0.0.8"
# Get resource path
@@ -81,6 +82,8 @@ class Constants:
self.recovery_status = False
self.override_smbios = "Default"
self.apecid_support = False
self.firewire_boot = False
self.nvme_boot = False
# OS Versions
self.tiger = 8
@@ -209,6 +212,12 @@ class Constants:
def plist_folder_path(self): return self.payload_kexts_path / Path(f"Plists")
@property
def platform_plugin_plist_path(self): return self.plist_folder_path / Path(f"PlatformPlugin")
@property
def fw_family_path(self): return self.payload_kexts_path / Path(f"FireWire/IOFireWireFamily-v{self.fw_kext}.zip")
@property
def fw_sbp2_path(self): return self.payload_kexts_path / Path(f"FireWire/IOFireWireSBP2-v{self.fw_kext}.zip")
@property
def fw_bus_path(self): return self.payload_kexts_path / Path(f"FireWire/IOFireWireSerialBusProtocolTransport-v{self.fw_kext}.zip")
# Build Location
@property

View File

@@ -923,6 +923,16 @@ AMCSupport = [
#"MacBookPro10,1"
]
NoFireWireSupport = [
"MacBook5,1",
"MacBook6,1",
"MacBook7,1",
"MacBookAir1,1",
"MacBookAir2,1",
"MacBookAir3,1",
"MacBookAir3,2",
]
DeleteNvidiaAccel11 = [
"AMDRadeonX4000.kext",
"AMDRadeonX4000HWServices.kext",

View File

@@ -860,6 +860,78 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>BundlePath</key>
<string>IOFireWireFamily.kext</string>
<key>Comment</key>
<string></string>
<key>Enabled</key>
<true/>
<key>ExecutablePath</key>
<string>Contents/MacOS/IOFireWireFamily</string>
<key>Arch</key>
<string>Any</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>BundlePath</key>
<string>IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext</string>
<key>Comment</key>
<string></string>
<key>Enabled</key>
<true/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleFWOHCI</string>
<key>Arch</key>
<string>Any</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>BundlePath</key>
<string>IOFireWireSBP2.kext</string>
<key>Comment</key>
<string></string>
<key>Enabled</key>
<true/>
<key>ExecutablePath</key>
<string>Contents/MacOS/IOFireWireSBP2</string>
<key>Arch</key>
<string>Any</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>BundlePath</key>
<string>IOFireWireSerialBusProtocolTransport.kext</string>
<key>Comment</key>
<string></string>
<key>Enabled</key>
<true/>
<key>ExecutablePath</key>
<string>Contents/MacOS/IOFireWireSerialBusProtocolTransport</string>
<key>Arch</key>
<string>Any</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
</array>
<key>Block</key>
<array/>

Binary file not shown.

Binary file not shown.