Adjust AMFI logic for Kepler and GCN

This commit is contained in:
Mykola Grymalyuk
2022-09-13 21:34:37 -06:00
parent 616d812913
commit 7fc2d478f2
3 changed files with 23 additions and 11 deletions

View File

@@ -1006,7 +1006,7 @@ class BuildOpenCore:
# Before merging into mainline, this needs to be resolved
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable _csr_check() in _vnode_check_signature")["Enabled"] = True
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi=0x2"
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi=0x80"
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_amfi"
# CSLVFixup simply patches out __RESTRICT and __restrict out of the Music.app Binary
# Ref: https://pewpewthespells.com/blog/blocking_code_injection_on_ios_and_os_x.html

View File

@@ -34,7 +34,10 @@ class generate_defaults:
except KeyError:
pass
if utilities.check_metal_support(device_probe, settings.computer) is False:
settings.disable_cs_lv = True
for gpu in settings.computer.gpus:
if isinstance(gpu, device_probe.AMD) or isinstance(gpu, device_probe.NVIDIA):
settings.disable_cs_lv = True
break
settings.secure_status = False
settings.sip_status = False
settings.allow_fv_root = True
@@ -185,4 +188,11 @@ class generate_defaults:
settings.force_nv_web = True
if model in model_array.ModernGPU:
settings.disable_cs_lv = True
for gpu in smbios_data.smbios_dictionary[model]["Stock GPUs"]:
if gpu in [
device_probe.NVIDIA.Archs.Kepler,
device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
]:
settings.disable_cs_lv = True

View File

@@ -71,13 +71,17 @@ class detect_root_patch:
# 12.0 Beta 5: 21.0.0 - 21A5304g
# 12.0 Beta 6: 21.1.0 - 21A5506j
# 12.0 Beta 7: 21.1.0 - 21A5522h
if self.constants.detected_os >= os_data.os_data.ventura:
if (
self.constants.detected_os >= os_data.os_data.ventura or
(
"21A5506j" not in self.constants.detected_os_build and
self.constants.detected_os == os_data.os_data.monterey and
self.constants.detected_os_minor > 0
)
):
self.kepler_gpu = True
self.supports_metal = True
elif self.constants.detected_os == os_data.os_data.monterey and self.constants.detected_os_minor > 0:
if "21A5506j" not in self.constants.detected_os_build:
self.kepler_gpu = True
self.supports_metal = True
self.amfi_must_disable = True
elif gpu.arch in [
device_probe.NVIDIA.Archs.Fermi,
device_probe.NVIDIA.Archs.Kepler,
@@ -111,6 +115,7 @@ class detect_root_patch:
self.legacy_gcn = True
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > non_metal_os:
self.iron_gpu = True
@@ -150,9 +155,6 @@ class detect_root_patch:
self.sandy_gpu = False
self.legacy_keyboard_backlight = False
if self.constants.detected_os >= os_data.os_data.ventura:
# All root patches in Ventura require AMFI disabled
self.amfi_must_disable = True
def check_dgpu_status(self):
dgpu = self.constants.computer.dgpu