mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
defaults.py: Fix crash on hackintoshes
This commit is contained in:
+20
-13
@@ -12,12 +12,17 @@ class generate_defaults:
|
|||||||
settings.amfi_status = True
|
settings.amfi_status = True
|
||||||
|
|
||||||
if host_is_target:
|
if host_is_target:
|
||||||
if settings.computer.usb_controllers and smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
|
if settings.computer.usb_controllers:
|
||||||
# Pre-Ivy do not natively support XHCI boot support
|
try:
|
||||||
# If we detect XHCI on older model, enable
|
if smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
|
||||||
for controller in settings.computer.usb_controllers:
|
# Pre-Ivy do not natively support XHCI boot support
|
||||||
if isinstance(controller, device_probe.XHCIController):
|
# If we detect XHCI on older model, enable
|
||||||
settings.xhci_boot = True
|
for controller in settings.computer.usb_controllers:
|
||||||
|
if isinstance(controller, device_probe.XHCIController):
|
||||||
|
settings.xhci_boot = True
|
||||||
|
break
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
if utilities.check_metal_support(device_probe, settings.computer) is False:
|
if utilities.check_metal_support(device_probe, settings.computer) is False:
|
||||||
settings.disable_cs_lv = True
|
settings.disable_cs_lv = True
|
||||||
if settings.computer.gpus:
|
if settings.computer.gpus:
|
||||||
@@ -96,13 +101,15 @@ class generate_defaults:
|
|||||||
# Users disabling TS2 most likely have a faulty dGPU
|
# Users disabling TS2 most likely have a faulty dGPU
|
||||||
# users can override this in settings
|
# users can override this in settings
|
||||||
settings.allow_ts2_accel = False
|
settings.allow_ts2_accel = False
|
||||||
|
try:
|
||||||
if smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value and model != "MacPro5,1":
|
if smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value and model != "MacPro5,1":
|
||||||
# Sidecar and AirPlay to Mac only blacklist Ivy and newer (as well as MacPro5,1)
|
# Sidecar and AirPlay to Mac only blacklist Ivy and newer (as well as MacPro5,1)
|
||||||
# Avoid extra patching without benefit
|
# Avoid extra patching without benefit
|
||||||
settings.fu_arguments = " -disable_sidecar_mac"
|
settings.fu_arguments = " -disable_sidecar_mac"
|
||||||
else:
|
else:
|
||||||
settings.fu_arguments = None
|
settings.fu_arguments = None
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Check if running in RecoveryOS
|
# Check if running in RecoveryOS
|
||||||
settings.recovery_status = utilities.check_recovery()
|
settings.recovery_status = utilities.check_recovery()
|
||||||
|
|||||||
Reference in New Issue
Block a user