mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-13 20:28:21 +10:00
Add dosdude patch detection
This commit is contained in:
@@ -197,7 +197,7 @@ class BuildOpenCore:
|
||||
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True
|
||||
|
||||
if self.get_kext_by_bundle_path("latebloom.kext")["Enabled"] is True:
|
||||
print(f"Setting latebloom delay of {self.constants.latebloom_delay}, range {self.constants.latebloom_range}, debug {self.constants.latebloom_debug}")
|
||||
print(f"- Setting latebloom delay of {self.constants.latebloom_delay}, range {self.constants.latebloom_range}, debug {self.constants.latebloom_debug}")
|
||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" latebloom={self.constants.latebloom_delay}, lb_range={self.constants.latebloom_range}, lb_debug={self.constants.latebloom_debug}"
|
||||
|
||||
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in ModelArray.MacPro71):
|
||||
|
||||
@@ -1024,5 +1024,8 @@ PCIRaceCondition = [
|
||||
"iMac11,1",
|
||||
"iMac11,2",
|
||||
"iMac11,3",
|
||||
"MacPro3,1",
|
||||
"MacPro4,1",
|
||||
"MacPro5,1",
|
||||
"Dortania1,1",
|
||||
]
|
||||
@@ -538,7 +538,7 @@ set million colour before rebooting"""
|
||||
sip_value = (
|
||||
"For Hackintoshes, please set csr-active-config to '030A0000' (0xA03)\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
|
||||
)
|
||||
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled = Utilities.patching_status(sip)
|
||||
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled, self.dosdude_patched = Utilities.patching_status(sip)
|
||||
if self.sip_enabled is True:
|
||||
print("\nCannot patch! Please disable System Integrity Protection (SIP).")
|
||||
print("Disable SIP in Patcher Settings and Rebuild OpenCore\n")
|
||||
@@ -565,8 +565,12 @@ set million colour before rebooting"""
|
||||
print("Please ensure your Board ID is listed below:")
|
||||
print("\n".join(self.constants.sandy_board_id))
|
||||
self.bad_board_id = True
|
||||
|
||||
if self.dosdude_patched is True:
|
||||
print("\nCannot patch! Detected machine has already been patched by another patcher")
|
||||
print("Please ensure your install is either clean or patched with OpenCore Legacy Patcher")
|
||||
|
||||
if any([self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.amfi_enabled if self.amfi_must_disable else False, self.bad_board_id if self.check_board_id else False]):
|
||||
if any([self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.dosdude_patched, self.amfi_enabled if self.amfi_must_disable else False, self.bad_board_id if self.check_board_id else False]):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
@@ -8,7 +8,7 @@ import plistlib
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
import os
|
||||
import requests
|
||||
|
||||
from Resources import Constants, ioreg
|
||||
@@ -99,9 +99,12 @@ def patching_status(os_sip):
|
||||
sbm_enabled = True # Secure Boot Status (SecureBootModel)
|
||||
amfi_enabled = True # Apple Mobile File Integrity
|
||||
fv_enabled = True # FileVault
|
||||
dosdude_patched = True
|
||||
|
||||
amfi_1 = "amfi_get_out_of_my_way=0x1"
|
||||
amfi_2 = "amfi_get_out_of_my_way=1"
|
||||
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
|
||||
gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext"
|
||||
|
||||
if get_nvram("boot-args", decode=False) and (amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False)):
|
||||
amfi_enabled = False
|
||||
@@ -114,8 +117,11 @@ def patching_status(os_sip):
|
||||
fv_status: str = subprocess.run("fdesetup status".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|
||||
if fv_status.startswith("FileVault is Off"):
|
||||
fv_enabled = False
|
||||
|
||||
if not (Path(gen6_kext).exists() and Path(gen7_kext).exists()):
|
||||
dosdude_patched = False
|
||||
|
||||
return sip_enabled, sbm_enabled, amfi_enabled, fv_enabled
|
||||
return sip_enabled, sbm_enabled, amfi_enabled, fv_enabled, dosdude_patched
|
||||
|
||||
|
||||
clear = True
|
||||
|
||||
Reference in New Issue
Block a user