mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
Add backend to support latebloom
Kext currently not enabled until ready for mass community usage
This commit is contained in:
@@ -189,12 +189,17 @@ class BuildOpenCore:
|
||||
# Misc
|
||||
("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: self.model in ModelArray.SidecarPatch),
|
||||
("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True),
|
||||
#("latebloom.kext", self.constants.latebloom_version, self.constants.latebloom_path, lambda: self.model in ModelArray.PCIRaceCondition),
|
||||
]:
|
||||
self.enable_kext(name, version, path, check)
|
||||
|
||||
if self.constants.allow_oc_everywhere is False:
|
||||
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}")
|
||||
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):
|
||||
# Use Innie's same logic:
|
||||
# https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97
|
||||
|
||||
@@ -42,6 +42,7 @@ class Constants:
|
||||
self.debugenhancer_version = "1.0.3"
|
||||
self.innie_version = "1.3.0"
|
||||
self.fw_kext = "1.0.0"
|
||||
self.latebloom_version = "0.17"
|
||||
self.disk = ""
|
||||
self.patch_disk = ""
|
||||
self.patcher_support_pkg_version = "0.0.13" # PatcherSupportPkg
|
||||
@@ -90,6 +91,10 @@ class Constants:
|
||||
self.enable_wake_on_wlan = False
|
||||
self.allow_ivy_igpu = False
|
||||
self.moj_cat_accel = False
|
||||
self.latebloom_status = False
|
||||
self.latebloom_delay = 0
|
||||
self.latebloom_range = 0
|
||||
self.latebloom_debug = 0
|
||||
|
||||
# OS Versions
|
||||
self.tiger = 8
|
||||
@@ -284,6 +289,10 @@ class Constants:
|
||||
@property
|
||||
def innie_path(self):
|
||||
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
|
||||
|
||||
@property
|
||||
def latebloom_path(self):
|
||||
return self.payload_kexts_path / Path(f"Misc/latebloom-v{self.latebloom_version}.zip")
|
||||
|
||||
@property
|
||||
def plist_folder_path(self):
|
||||
|
||||
+32
-1
@@ -994,4 +994,35 @@ NoFireWireSupport = [
|
||||
"MacBookAir3,2",
|
||||
]
|
||||
|
||||
RecoveryIgnore = ["Update", "VM", "Recovery", "Preboot"]
|
||||
PCIRaceCondition = [
|
||||
"MacBook4,1",
|
||||
"MacBook5,1",
|
||||
"MacBook5,2",
|
||||
"MacBook6,1",
|
||||
"MacBook7,1",
|
||||
"MacBookAir2,1",
|
||||
"MacBookAir3,1",
|
||||
"MacBookAir3,2",
|
||||
"MacBookPro4,1",
|
||||
"MacBookPro5,1",
|
||||
"MacBookPro5,2",
|
||||
"MacBookPro5,3",
|
||||
"MacBookPro5,4",
|
||||
"MacBookPro5,5",
|
||||
"MacBookPro6,1",
|
||||
"MacBookPro6,2",
|
||||
"MacBookPro7,1",
|
||||
"Macmini3,1",
|
||||
"Macmini4,1",
|
||||
"Macmini5,1",
|
||||
"Macmini5,2",
|
||||
"Macmini5,3",
|
||||
"iMac7,1",
|
||||
"iMac8,1",
|
||||
"iMac9,1",
|
||||
"iMac10,1",
|
||||
"iMac11,1",
|
||||
"iMac11,2",
|
||||
"iMac11,3",
|
||||
"Dortania1,1",
|
||||
]
|
||||
@@ -7,6 +7,7 @@ import os
|
||||
import plistlib
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
import requests
|
||||
|
||||
@@ -49,6 +50,27 @@ def get_disk_path():
|
||||
return root_mount_path
|
||||
|
||||
|
||||
def latebloom_detection(model):
|
||||
if model in ["MacPro4,1", "MacPro5,1", "iMac7,1", "iMac8,1"]:
|
||||
# These machines are more likely to experience boot hangs, increase delays to accomodate
|
||||
lb_delay = "250"
|
||||
else:
|
||||
lb_delay = "100"
|
||||
lb_range = "1"
|
||||
lb_debug = "0"
|
||||
if get_nvram("boot-args", decode=False):
|
||||
if "latebloom=" in get_nvram("boot-args", decode=False):
|
||||
lb_delay = re.search(r"(?:[, ])latebloom=(\d+)", get_nvram("boot-args", decode=False))
|
||||
lb_delay = lb_delay[1]
|
||||
if "lb_range=" in get_nvram("boot-args", decode=False):
|
||||
lb_range = re.search(r"(?:[, ])lb_range=(\d+)", get_nvram("boot-args", decode=False))
|
||||
lb_range = lb_range[1]
|
||||
if "lb_debug=" in get_nvram("boot-args", decode=False):
|
||||
lb_debug = re.search(r"(?:[, ])lb_debug=(\d+)", get_nvram("boot-args", decode=False))
|
||||
lb_debug = lb_debug[1]
|
||||
return int(lb_range), int(lb_range), int(lb_debug)
|
||||
|
||||
|
||||
def csr_decode(csr_active_config, os_sip):
|
||||
if csr_active_config is None:
|
||||
csr_active_config = b"\x00\x00\x00\x00"
|
||||
|
||||
Reference in New Issue
Block a user