mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-22 11:00:16 +10:00
Move FirmwareFeature generation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from Data import smbios_data, os_data
|
||||
from Resources import Utilities
|
||||
|
||||
def set_smbios_model_spoof(model):
|
||||
try:
|
||||
@@ -50,4 +51,25 @@ def set_smbios_model_spoof(model):
|
||||
return "iMac17,1"
|
||||
else:
|
||||
# Unknown Model
|
||||
raise Exception
|
||||
raise Exception
|
||||
|
||||
def update_firmware_features(firmwarefeature):
|
||||
# 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/tree/2f76673546ac3e32d2e2d528095fddcd66ad6a23/Include/Apple/IndustryStandard/AppleFeatures.h
|
||||
firmwarefeature |= 2 ** 19 # FW_FEATURE_SUPPORTS_APFS
|
||||
firmwarefeature |= 2 ** 20 # FW_FEATURE_SUPPORTS_APFS_EXTRA
|
||||
firmwarefeature |= 2 ** 35 # FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM
|
||||
return firmwarefeature
|
||||
|
||||
def generate_fw_features(model, custom):
|
||||
if not custom:
|
||||
firmwarefeature = Utilities.get_rom("firmware-features")
|
||||
if not firmwarefeature:
|
||||
print("- Failed to find FirmwareFeatures, falling back on defaults")
|
||||
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
|
||||
else:
|
||||
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
|
||||
firmwarefeature = update_firmware_features(firmwarefeature)
|
||||
return firmwarefeature
|
||||
Reference in New Issue
Block a user