mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
Update comments
This commit is contained in:
@@ -63,22 +63,11 @@ class BuildOpenCore:
|
||||
else:
|
||||
return model
|
||||
|
||||
def fw_feature_detect(self, model):
|
||||
# Values based off OpenCorePkg's Firmwarefeatures and FirmwarefeaturesMask
|
||||
# Additionally, APFS bit(19) flipped
|
||||
# https://github.com/acidanthera/OpenCorePkg/blob/0.6.9/Include/Apple/IndustryStandard/AppleFeatures.h#L136
|
||||
if model == "iMac7,1":
|
||||
fw_feature = b"\x07\x14\x08\xc0\x00\x00\x00\x00"
|
||||
fw_mask = b"\xff\x1f\x08\xc0\x00\x00\x00\x00"
|
||||
elif model in ["MacPro4,1", "Xserve3,1"]:
|
||||
fw_feature = b"7\xf5\t\xe0\x00\x00\x00\x00"
|
||||
fw_mask = b"7\xff\x0b\xc0\x00\x00\x00\x00"
|
||||
else:
|
||||
fw_feature = b"\x03\x14\x08\xc0\x00\x00\x00\x00"
|
||||
fw_mask = b"\xff\x3f\x08\xc0\x00\x00\x00\x00"
|
||||
return fw_feature, fw_mask
|
||||
|
||||
def patch_firmware_feature(self):
|
||||
# Adjust FirmwareFeature to support everything macOS requires
|
||||
# APFS Bit (19/20): 10.13+ (OSInstall)
|
||||
# Large BaseSystem Bit (35): 12.0 B7+ (patchd)
|
||||
# https://github.com/acidanthera/OpenCorePkg/blob/0.6.9/Include/Apple/IndustryStandard/AppleFeatures.h
|
||||
if not self.constants.custom_model:
|
||||
firmwarefeature = Utilities.get_rom("firmware-features")
|
||||
if not firmwarefeature:
|
||||
|
||||
@@ -140,16 +140,17 @@ def friendly_hex(integer: int):
|
||||
def amfi_status():
|
||||
amfi_1 = "amfi_get_out_of_my_way=0x1"
|
||||
amfi_2 = "amfi_get_out_of_my_way=1"
|
||||
if (
|
||||
(
|
||||
get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False) and "-allow_amfi" in get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
|
||||
) or
|
||||
(
|
||||
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))
|
||||
)
|
||||
):
|
||||
return False
|
||||
return True
|
||||
|
||||
if get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False):
|
||||
if "-allow_amfi" in get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
elif get_nvram("boot-args", decode=False):
|
||||
if amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def check_oclp_boot():
|
||||
|
||||
Reference in New Issue
Block a user