From d563011c72e737708cfcd258cc8900efe82fb109 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 00:04:55 -0600 Subject: [PATCH 01/30] Refactor SMBIOS table --- CHANGELOG.md | 1 + Data/bluetooth_data.py | 11 + Data/cpu_data.py | 15 + Data/os_data.py | 16 + Resources/PCIIDArray.py => Data/pci_data.py | 9 +- Data/sip_data.py | 35 + Data/smbios_data.py | 1385 +++++++++++++++++++ Resources/Build.py | 83 +- Resources/Constants.py | 162 --- Resources/ModelArray.py | 435 ------ Resources/SMBIOSData.py | 110 -- Resources/SysPatch.py | 5 +- Resources/Utilities.py | 7 +- Resources/device_probe.py | 52 +- 14 files changed, 1546 insertions(+), 780 deletions(-) create mode 100644 Data/bluetooth_data.py create mode 100644 Data/cpu_data.py create mode 100644 Data/os_data.py rename Resources/PCIIDArray.py => Data/pci_data.py (99%) create mode 100644 Data/sip_data.py create mode 100644 Data/smbios_data.py delete mode 100644 Resources/SMBIOSData.py diff --git a/CHANGELOG.md b/CHANGELOG.md index e8ee031c1..03f349827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - PatcherSupportPkg 0.1.5 release - RestrictEvents 1.0.5 rolling (2430ed0) - Limit MacBookPro6,2 G State + - Works around crashing when switching GPUs - Fix OTA updates on T2 SMBIOS ## 0.2.5 diff --git a/Data/bluetooth_data.py b/Data/bluetooth_data.py new file mode 100644 index 000000000..10a1daae3 --- /dev/null +++ b/Data/bluetooth_data.py @@ -0,0 +1,11 @@ +class bluetooth_data: + # Bluetooth Chipsets + NonApplicable = 0 + BRCM2045 = 1 # TODO: Rename chipset, currently guessing MacPro1,1-3,1 name + BRCM2046 = 2 # BT 2.1 + BRCM2070 = 3 # BT 2.1 + BRCM20702_v1 = 4 # BT 4.0 - 2012 + BRCM20702_v2 = 5 # BT 4.0 - 2013+ + BRCM20703 = 6 # BT 4.2 + BRCM20703_UART = 9 # BRCM20703 over UART, BT 4.2 + UART = 10 \ No newline at end of file diff --git a/Data/cpu_data.py b/Data/cpu_data.py new file mode 100644 index 000000000..d372f1103 --- /dev/null +++ b/Data/cpu_data.py @@ -0,0 +1,15 @@ +class cpu_data: + pentium_4 = 0 + yonah = 1 + conroe = 2 + penryn = 3 + nahalem = 4 # (Westmere included) + sandy_bridge = 5 # 2000 + ivy_bridge = 6 # 3000 + haswell = 7 # 4000 + broadwell = 8 # 5000 + skylake = 9 # 6000 + kaby_lake = 10 # 7000 + coffee_lake = 11 # 8000 + comet_lake = 12 # 9000 + ice_lake = 13 # 10000 diff --git a/Data/os_data.py b/Data/os_data.py new file mode 100644 index 000000000..19ce05dce --- /dev/null +++ b/Data/os_data.py @@ -0,0 +1,16 @@ +class os_data: + # OS Versions, Based off Major Kernel Version + tiger = 8 + leopard = 9 + snow_leopard = 10 + lion = 11 + mountain_lion = 12 + mavericks = 13 + yosemite = 14 + el_capitan = 15 + sierra = 16 + high_sierra = 17 + mojave = 18 + catalina = 19 + big_sur = 20 + monterey = 21 \ No newline at end of file diff --git a/Resources/PCIIDArray.py b/Data/pci_data.py similarity index 99% rename from Resources/PCIIDArray.py rename to Data/pci_data.py index 6974665f4..1c55f0b1b 100644 --- a/Resources/PCIIDArray.py +++ b/Data/pci_data.py @@ -1,6 +1,4 @@ # Array of Device IDs for different devices - - class nvidia_ids: # Courteous of envytools as well as Macrumors: # https://envytools.readthedocs.io/en/latest/hw/pciid.html @@ -850,6 +848,13 @@ class intel_ids: class broadcom_ids: + AppleBCMWLANBusInterfacePCIe = [ + 0x43DC, + 0x4464, + 0x4488, + 0x4425, + ] + AirPortBrcmNIC = [ # AirPortBrcmNIC IDs 0x43BA, # BCM43602 diff --git a/Data/sip_data.py b/Data/sip_data.py new file mode 100644 index 000000000..bf8345995 --- /dev/null +++ b/Data/sip_data.py @@ -0,0 +1,35 @@ +class system_integrity_protection: + csr_values = { + # Source: macOS 11.4 (XNU's csr.h) + # https://opensource.apple.com/source/xnu/xnu-7195.121.3/bsd/sys/csr.h.auto.html + "CSR_ALLOW_UNTRUSTED_KEXTS": False, # 0x1 - Allows Unsigned Kexts - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_UNRESTRICTED_FS": False, # 0x2 - File System Access - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_TASK_FOR_PID": False, # 0x4 - Unrestricted task_for_pid() - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_KERNEL_DEBUGGER": False, # 0x8 - Allow Kernel Debugger - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_APPLE_INTERNAL": False, # 0x10 - Set AppleInternal Features - Introduced in El Capitan # noqa: E241 + # "CSR_ALLOW_DESTRUCTIVE_DTRACE": False, # 0x20 - Allow destructive DTrace - Deprecated # noqa: E241 + "CSR_ALLOW_UNRESTRICTED_DTRACE": False, # 0x20 - Unrestricted DTrace usage - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_UNRESTRICTED_NVRAM": False, # 0x40 - Unrestricted NVRAM write - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_DEVICE_CONFIGURATION": False, # 0x80 - Allow custom DeviceTree (iOS) - Introduced in El Capitan # noqa: E241 + "CSR_ALLOW_ANY_RECOVERY_OS": False, # 0x100 - Skip BaseSystem Verification - Introduced in Sierra # noqa: E241 + "CSR_ALLOW_UNAPPROVED_KEXTS": False, # 0x200 - Allow Unnotarized Kexts - Introduced in High Sierra # noqa: E241 + "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE": False, # 0x400 - Override Executable Policy - Introduced in Mojave # noqa: E241 + "CSR_ALLOW_UNAUTHENTICATED_ROOT": False, # 0x800 - Allow Root Volume Mounting - Introduced in Big Sur # noqa: E241 + } + + root_patch_sip_mojave = [ + # Variables required to root patch in Mojave and Catalina + "CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1 + "CSR_ALLOW_UNRESTRICTED_FS", # 0x2 + "CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200 + "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400 + ] + + root_patch_sip_big_sur = [ + # Variables required to root patch in Big Sur and Monterey + "CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1 + "CSR_ALLOW_UNRESTRICTED_FS", # 0x2 + "CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200 + "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400 + "CSR_ALLOW_UNAUTHENTICATED_ROOT", # 0x800 + ] \ No newline at end of file diff --git a/Data/smbios_data.py b/Data/smbios_data.py new file mode 100644 index 000000000..3d3dab86a --- /dev/null +++ b/Data/smbios_data.py @@ -0,0 +1,1385 @@ +# Defines Model Data + +from Resources import device_probe +from Data import cpu_data, os_data, bluetooth_data + +smbios_dictionary = { + "MacBook1,1": { + "Board ID": "Mac-F4208CC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS Supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 13, + "UGA Graphics": True, + + }, + + "MacBook2,1": { + "Board ID": "Mac-F4208CA9", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 13, + "UGA Graphics": True, + }, + + "MacBook3,1": { + "Board ID": "Mac-F22788C8", + "FirmwareFeatures": "0xC0001407", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 13, + "UGA Graphics": True, + }, + + "MacBook4,1": { + "Board ID": "Mac-F22788A9", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + "UGA Graphics": True, + }, + + + "MacBook5,1": { + "Board ID": "Mac-F42D89C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBook5,2": { + "Board ID": "Mac-F22788AA", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBook6,1": { + "Board ID": "Mac-F22C8AC8", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 13, + }, + + + "MacBook7,1": { + "Board ID": "Mac-F22C89C8", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 13, + }, + + + "MacBook8,1": { + "Board ID": "Mac-BE0E8AC46FE800CC", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 12, + }, + + "MacBook9,1": { + "Board ID": "Mac-9AE82516C7C6B903", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 12, + }, + + "MacBook10,1": { + "Board ID": "Mac-EE2EBD4B90B839A8", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 12, + + }, + + "MacBookAir1,1": { + "Board ID": "Mac-F42C8CC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + "MacBookAir2,1": { + "Board ID": "Mac-F42D88C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBookAir3,1": { + "Board ID": "Mac-942452F5819B1C1B", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 11, + }, + + + "MacBookAir3,2": { + "Board ID": "Mac-942C5DF58193131B", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBookAir4,1": { + "Board ID": "Mac-C08A6BB70A942AC2", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 11, + }, + + + "MacBookAir4,2": { + "Board ID": "Mac-742912EFDBEE19B3", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 13, + }, + + + "MacBookAir5,1": { + "Board ID": "Mac-66F35F19FE2A0D05", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 11, + }, + + + "MacBookAir5,2": { + "Board ID": "Mac-2E6FAB96566FE58C", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 13, + }, + + + "MacBookAir6,1": { + "Board ID": "Mac-35C1E88140C3E6CF", + "FirmwareFeatures": "0xE00FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 11, + }, + + + "MacBookAir6,2": { + "Board ID": "Mac-7DF21CB3ED6977E5", + "FirmwareFeatures": "0xE00FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 13, + }, + + "MacBookAir7,1": { + "Board ID": "Mac-9F18E312C5C2BF0B", + "FirmwareFeatures": "0xFF0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 11, + }, + + "MacBookAir7,2": { + "Board ID": "Mac-937CB26E2E02BB01", + "FirmwareFeatures": "0xFF0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 13, + }, + + "MacBookAir8,1": { + "Board ID": "Mac-827FAC58A8FDFA22", + "FirmwareFeatures": "0xFD8FF42E", + "SecureBootModel": "j140kap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookAir8,2": { + "Board ID": "Mac-226CB3C6A851A671", + "FirmwareFeatures": "0xFD8FF42E", + "SecureBootModel": "j140aap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookAir9,1": { + "Board ID": "Mac-0CFF9C7C2B63DF8D", + "FirmwareFeatures": "0xFFAFF06E", + "SecureBootModel": "j230kap", + "CPU Generation": cpu_data.cpu_data.ice_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookPro1,1": { + "Board ID": "Mac-F425BEC8", + "FirmwareFeatures": "", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 15, + "UGA Graphics": True, + }, + + "MacBookPro1,2": { + "Board ID": "Mac-F42DBEC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 17, + "UGA Graphics": True, + }, + + "MacBookPro2,1": { + "Board ID": "Mac-F42189C8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 17, + "UGA Graphics": True, + }, + + "MacBookPro2,2": { + "Board ID": "Mac-F42187C8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 15, + "UGA Graphics": True, + }, + + "MacBookPro3,1": { + "Board ID": "Mac-F4238BC8", + "FirmwareFeatures": "0xC0001407", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Screen Size": 15, # Shipped with 17 as well + "UGA Graphics": True, + }, + + "MacBookPro4,1": { + "Board ID": "Mac-F42C89C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 15, # Shipped with 17 as well + "Switchable GPUs": True, + "UGA Graphics": True, + }, + + + "MacBookPro5,1": { + "Board ID": "Mac-F42D86C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro5,2": { + "Board ID": "Mac-F2268EC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 17, + "Switchable GPUs": True, + }, + + + "MacBookPro5,3": { + "Board ID": "Mac-F22587C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro5,4": { + "Board ID": "Mac-F22587A1", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro5,5": { + "Board ID": "Mac-F2268AC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBookPro6,1": { + "Board ID": "Mac-F22589C8", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 17, + "Switchable GPUs": True, + }, + + + "MacBookPro6,2": { + "Board ID": "Mac-F22586C8", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro7,1": { + "Board ID": "Mac-F222BEC8", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Screen Size": 13, + }, + + + "MacBookPro8,1": { + "Board ID": "Mac-94245B3640C91C81", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 13, + }, + + + "MacBookPro8,2": { + "Board ID": "Mac-94245A3940C91C80", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro8,3": { + "Board ID": "Mac-942459F5819B171B", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Screen Size": 17, + "Switchable GPUs": True, + }, + + + "MacBookPro9,1": { + "Board ID": "Mac-4B7AC7E43945597E", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro9,2": { + "Board ID": "Mac-6F01561E16C75D06", + "FirmwareFeatures": "0xC10DF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 13, + }, + + + "MacBookPro10,1": { + "Board ID": "Mac-C3EC7CD22292981F", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + + "MacBookPro10,2": { + "Board ID": "Mac-AFD8A9D944EA4843", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Screen Size": 13, + }, + + + "MacBookPro11,1": { + "Board ID": "Mac-189A3D4F975D5FFC", + "FirmwareFeatures": "0xEB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 13, + }, + + + "MacBookPro11,2": { + "Board ID": "Mac-3CBD00234E554E41", + "FirmwareFeatures": "0xEB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 15, + }, + + + "MacBookPro11,3": { + "Board ID": "Mac-2BD1B31983FE1663", + "FirmwareFeatures": "0xEB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro11,4": { + "Board ID": "Mac-06F11FD93F0323C5", + "FirmwareFeatures": "0xEB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 15, + }, + + "MacBookPro11,5": { + "Board ID": "Mac-06F11F11946D27C5", + "FirmwareFeatures": "0xEB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro12,1": { + "Board ID": "Mac-E43C1C25D4880AD6", + "FirmwareFeatures": "0xFD0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Screen Size": 13, + }, + + "MacBookPro13,1": { + "Board ID": "Mac-473D31EABEB93F9B", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 13, + }, + + "MacBookPro13,2": { + "Board ID": "Mac-66E35819EE2D0D05", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 13, + }, + + "MacBookPro13,3": { + "Board ID": "Mac-A5C67F76ED83108C", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro14,1": { + "Board ID": "Mac-B4831CEBD52A0C4C", + "FirmwareFeatures": "0xFF0FF57E", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 13, + }, + + "MacBookPro14,2": { + "Board ID": "Mac-CAD6701F7CEA0921", + "FirmwareFeatures": "0xFF0FF57E", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 13, + }, + + "MacBookPro14,3": { + "Board ID": "Mac-551B86E5744E2388", + "FirmwareFeatures": "0xFF0FF57E", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro15,1": { + "Board ID": "Mac-937A206F2EE63C01", + "FirmwareFeatures": "0xFD8FF426", + "SecureBootModel": "j680ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro15,2": { + "Board ID": "Mac-827FB448E656EC26", + "FirmwareFeatures": "0xFD8FF426", + "SecureBootModel": "j132ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookPro15,3": { + "Board ID": "Mac-1E7E29AD0135F9BC", + "FirmwareFeatures": "0xFD8FF426", + "SecureBootModel": "j780ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 15, + "Switchable GPUs": True, + }, + + "MacBookPro15,4": { + "Board ID": "Mac-53FDB3D8DB8CA971", + "FirmwareFeatures": "0xFD8FF426", + "SecureBootModel": "j213ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookPro16,1": { + "Board ID": "Mac-E1008331FDC96864", + "FirmwareFeatures": "0xFDAFF066", + "SecureBootModel": "j152fap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 16, + "Switchable GPUs": True, + }, + + "MacBookPro16,2": { + "Board ID": "Mac-5F9802EFE386AA28", + "FirmwareFeatures": "0xFFAFF06E", + "SecureBootModel": "j214kap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookPro16,3": { + "Board ID": "Mac-E7203C0F68AA0004", + "FirmwareFeatures": "0xFDAFF066", + "SecureBootModel": "j223ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 13, + }, + + "MacBookPro16,4": { + "Board ID": "Mac-A61BADE1FDAD7B05", + "FirmwareFeatures": "0xFDAFF066", + "SecureBootModel": "j215ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Screen Size": 16, + "Switchable GPUs": True, + }, + + "Macmini1,1": { + "Board ID": "Mac-F4208EC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + }, + + "Macmini2,1": { + "Board ID": "Mac-F4208EAA", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + }, + + "Macmini3,1": { + "Board ID": "Mac-F22C86C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "Macmini4,1": { + "Board ID": "Mac-F2208EC8", + "FirmwareFeatures": "0xC00C9423", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + }, + + + "Macmini5,1": { + "Board ID": "Mac-8ED6AF5B48C039E1", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + }, + + + "Macmini5,2": { + "Board ID": "Mac-4BC72D62AD45599E", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + }, + + + "Macmini5,3": { + "Board ID": "Mac-7BA5B2794B2CDB12", + "FirmwareFeatures": "0xD00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + }, + + + "Macmini6,1": { + "Board ID": "Mac-031AEE4D24BFF0B1", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + }, + + + "Macmini6,2": { + "Board ID": "Mac-F65AE981FFA204ED", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + }, + + "Macmini7,1": { + "Board ID": "Mac-35C5E08120C7EEAF", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "Macmini8,1": { + "Board ID": "Mac-7BA5B2DFE22DDD8C", + "FirmwareFeatures": "0xFD8FF466", + "SecureBootModel": "j174ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "iMac4,1": { + "Board ID": "Mac-F42786C8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "UGA Graphics": True, + }, + + "iMac4,2": { + "Board ID": "Mac-F4218EC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.yonah, + "Max OS supported": os_data.os_data.snow_leopard, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "UGA Graphics": True, + }, + + "iMac5,1": { + "Board ID": "Mac-F4228EC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "UGA Graphics": True, + }, + + "iMac5,2": { + "Board ID": "Mac-F4218EC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "UGA Graphics": True, + }, + + "iMac6,1": { + "Board ID": "Mac-F4218FC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "UGA Graphics": True, + }, + + "iMac7,1": { + "Board ID": "Mac-F42386C8", + "FirmwareFeatures": "0xC0001407", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, # Stock models shipped with Conroe + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "UGA Graphics": True, + }, + + + "iMac8,1": { + "Board ID": "Mac-F227BEC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "UGA Graphics": True, + }, + + + "iMac9,1": { + "Board ID": "Mac-F2218FA9", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac10,1": { + "Board ID": "Mac-F221DCC8", + # "Board ID": "Mac-F2268CC8", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac11,1": { + "Board ID": "Mac-F2268DAE", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac11,2": { + "Board ID": "Mac-F2238AC8", + "FirmwareFeatures": "0xC00C9423", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac11,3": { + "Board ID": "Mac-F2238BAE", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac12,1": { + "Board ID": "Mac-942B5BF58194151B", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac12,2": { + "Board ID": "Mac-942B59F58194171B", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "Max OS supported": os_data.os_data.high_sierra, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "iMac13,1": { + "Board ID": "Mac-00BE6ED71E35EB86", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + }, + + + "iMac13,2": { + "Board ID": "Mac-FC02E91DDD3FA6A4", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + }, + + + "iMac13,3": { + "Board ID": "Mac-7DF2A3B5E5D671ED", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + }, + + + "iMac14,1": { + "Board ID": "Mac-031B6874CF7F642A", + "FirmwareFeatures": "0xFB0FF577", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + + "iMac14,2": { + "Board ID": "Mac-27ADBB7B4CEE8E61", + "FirmwareFeatures": "0xE00FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + + "iMac14,3": { + "Board ID": "Mac-77EB7D7DAF985301", + "FirmwareFeatures": "0xE00FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.catalina, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + + "iMac14,4": { + "Board ID": "Mac-81E3E92DD6088272", + "FirmwareFeatures": "0xF00FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + + "iMac15,1": { + "Board ID": "Mac-42FD25EABCABB274", + "FirmwareFeatures": "0xF80FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.haswell, + "Max OS supported": os_data.os_data.big_sur, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "iMac16,1": { + "Board ID": "Mac-A369DDC4E67F1C45", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "iMac16,2": { + "Board ID": "Mac-FFE5EF870D7BA81A", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.broadwell, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "iMac17,1": { + "Board ID": "Mac-DB15BD556843C820", + # "Board ID": "Mac-65CE76090165799A", + # "Board ID": "Mac-B809C3757DA9BB8D", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "iMac18,1": { + "Board ID": "Mac-4B682C642B45593E", + "FirmwareFeatures": "0xFD0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + }, + + "iMac18,2": { + "Board ID": "Mac-77F17D7DA9285301", + "FirmwareFeatures": "0xFD0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + }, + + "iMac18,3": { + "Board ID": "Mac-BE088AF8C5EB4FA2", + "FirmwareFeatures": "0xFD0FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.kaby_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + }, + + "iMac19,1": { + "Board ID": "Mac-AA95B1DDAB278B95", + "FirmwareFeatures": "0xFD8FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "iMac19,2": { + "Board ID": "Mac-63001698E7A34814", + "FirmwareFeatures": "0xFD8FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "iMac20,1": { + "Board ID": "Mac-CFF7D910A743CAAF", + "FirmwareFeatures": "0xFD8FF576", + "SecureBootModel": "j185ap", + "CPU Generation": cpu_data.cpu_data.comet_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "iMac20,2": { + "Board ID": "Mac-AF89B6D9451A490B", + "FirmwareFeatures": "0xFD8FF576", + "SecureBootModel": "j185fap", + "CPU Generation": cpu_data.cpu_data.comet_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "iMacPro1,1": { + "Board ID": "Mac-7BA5B2D9E42DDD94", + "FirmwareFeatures": "0xFD8FF53E", + "SecureBootModel": "j137ap", + "CPU Generation": cpu_data.cpu_data.skylake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "MacPro1,1": { + "Board ID": "Mac-F4208DC8", + "FirmwareFeatures": "0x80000015", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "UGA Graphics": True, + }, + + "MacPro2,1": { + "Board ID": "Mac-F4208DA9", + "FirmwareFeatures": "0xC0000015", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "UGA Graphics": True, + }, + + "MacPro3,1": { + "Board ID": "Mac-F42C88C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "UGA Graphics": True, + }, + + + "MacPro4,1": { + "Board ID": "Mac-F221BEC8", + "FirmwareFeatures": "0xE001F537", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + + "MacPro5,1": { + "Board ID": "Mac-F221BEC8", + "FirmwareFeatures": "0xE80FE137", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.mojave, + "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + }, + + "MacPro6,1": { + "Board ID": "Mac-F60DEB81FF30ACF6", + "FirmwareFeatures": "0xE90FF576", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + }, + + "MacPro7,1": { + "Board ID": "Mac-27AD2F918AE68F61", + "FirmwareFeatures": "0xFDAFF066", + "SecureBootModel": "j160ap", + "CPU Generation": cpu_data.cpu_data.coffee_lake, + "Max OS supported": None, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + }, + + "Xserve1,1": { + "Board ID": "Mac-F4208AC8", + "FirmwareFeatures": None, + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.conroe, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + "UGA Graphics": True, + }, + + "Xserve2,1": { + "Board ID": "Mac-F42289C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.penryn, + "Max OS supported": os_data.os_data.lion, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + "UGA Graphics": True, + }, + + "Xserve3,1": { + "Board ID": "Mac-F223BEC8", + "FirmwareFeatures": "0xE001F537", + "SecureBootModel": None, + "CPU Generation": cpu_data.cpu_data.nahalem, + "Max OS supported": os_data.os_data.el_capitan, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, + +} \ No newline at end of file diff --git a/Resources/Build.py b/Resources/Build.py index d990dc3fa..fb1d2ddac 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -14,7 +14,8 @@ import ast from pathlib import Path from datetime import date -from Resources import Constants, ModelArray, Utilities, device_probe, SMBIOSData +from Resources import Constants, ModelArray, Utilities, device_probe +from Data import smbios_data, bluetooth_data, cpu_data def rmtree_handler(func, path, exc_info): @@ -71,9 +72,9 @@ class BuildOpenCore: firmwarefeature = Utilities.get_rom("firmware-features") if not firmwarefeature: print("- Failed to find FirmwareFeatures, falling back on defaults") - firmwarefeature = int(SMBIOSData.FirmwareFeatures[self.model], 16) + firmwarefeature = int(smbios_data.smbios_dictionary[self.model]["FirmwareFeatures"], 16) else: - firmwarefeature = int(SMBIOSData.FirmwareFeatures[self.model], 16) + firmwarefeature = int(smbios_data.smbios_dictionary[self.model]["FirmwareFeatures"], 16) firmwarefeature = Utilities.enable_apfs(firmwarefeature) firmwarefeature = Utilities.enable_apfs_extended(firmwarefeature) firmwarefeature = Utilities.enable_large_basesystem(firmwarefeature) @@ -152,8 +153,8 @@ class BuildOpenCore: ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False), # CPU patches ("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket), - ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: self.model in ModelArray.SSEEmulator), - ("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: self.model in ModelArray.MissingSSE42), + ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), + ("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), ( "CPUFriend.kext", self.constants.cpufriend_version, @@ -169,9 +170,8 @@ class BuildOpenCore: # IDE patch ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch), # Misc - ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: self.model in ModelArray.FeatureUnlockSupport), + ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake), ("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), ("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path, lambda: self.model in ["MacBook4,1", "MacBook5,2"]), ]: self.enable_kext(name, version, path, check) @@ -179,14 +179,16 @@ class BuildOpenCore: 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.smbios_set(self.model) in ModelArray.T2_Models or self.constants.override_smbios in ModelArray.T2_Models: + + if (smbios_data.smbios_dictionary[self.smbios_set(self.model) or self.constants.override_smbios]["SecureBootModel"]) != None: # Monterey T2 SMBIOS don't get OS updates without a T2 SBM # Forces VMM patch instead if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) - if self.model in ModelArray.PCIRaceCondition: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge: # Ref: https://github.com/reenigneorcim/SurPlus + # Enable for all systems missing RDRAND support print("- Adding SurPlus Patch for Race Condition") self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["Enabled"] = True self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["Enabled"] = True @@ -303,21 +305,25 @@ class BuildOpenCore: self.enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) self.get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True else: - if self.model in ModelArray.WifiBCM94331: + if smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4360: + print("- Enabling BCM943224 and BCM94331 Networking Support") wifi_fake_id(self) - elif self.model in ModelArray.WifiBCM94322: + elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4331: + print("- Enabling BCM94328 Networking Support") self.enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) self.enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) self.get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True - elif self.model in ModelArray.WifiBCM94328: + elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm43224: + print("- Enabling BCM94328 Networking Support") self.enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) self.enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) self.get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True - elif self.model in ModelArray.WifiAtheros: + elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Atheros.Chipsets.AirPortAtheros40: + print("- Enabling Atheros Networking Support") self.enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) self.enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) self.get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True - else: + elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirportBrcmNIC: self.enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path) # print(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}") # self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" brcmfx-country={self.computer.wifi.country_code}" @@ -334,18 +340,19 @@ class BuildOpenCore: self.get_kext_by_bundle_path("CPUFriendDataProvider.kext")["Enabled"] = True # HID patches - if self.model in ModelArray.LegacyHID: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn: print("- Adding IOHIDFamily patch") self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True # SSDT patches - if self.model in ModelArray.pciSSDT: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nahalem and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): print("- Adding SSDT-CPBG.aml") self.get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-CPBG.aml")["Enabled"] = True shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path) - if self.model in ModelArray.windows_audio: + if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge: # Based on: https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/ + # Apply to Sandy and Ivy Bridge Macs print("- Enabling Windows 10 UEFI Audio support") self.get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-PCI.aml")["Enabled"] = True self.get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "BUF0 to BUF1")["Enabled"] = True @@ -605,32 +612,16 @@ class BuildOpenCore: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) - elif self.computer.bluetooth_chipset == "BRCM20702 Hub" and self.model in ModelArray.Bluetooth_BRCM20702_v1: + elif self.computer.bluetooth_chipset == "BRCM20702 Hub" and smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] == bluetooth_data.bluetooth_data.BRCM20702_v1: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) - elif self.model in ModelArray.Bluetooth_BRCM2070 or self.model in ModelArray.Bluetooth_BRCM2046 or self.model in ModelArray.Bluetooth_BRCM20702_v1: + # smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] + elif smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) - if self.model in ModelArray.Bluetooth_BRCM2070 or self.model in ModelArray.Bluetooth_BRCM2046: + if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070: self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) - # Add XhciDxe if firmware doesn't have XHCI controller support and XCHI controller detected - # TODO: Fix XhciDxe to work on pre UEFI 2.0 Macs - # Ref: https://github.com/acidanthera/bugtracker/issues/1663 - # if self.model not in ModelArray.XhciSupport and not self.constants.custom_model: - # devices = plistlib.loads(subprocess.run("ioreg -c IOPCIDevice -r -d2 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) - # try: - # devices = [i for i in devices if i["class-code"] == binascii.unhexlify(self.constants.classcode_xhci)] - # vendor_id = Utilities.hexswap(binascii.hexlify(devices[0]["vendor-id"]).decode()[:4]) - # device_id = Utilities.hexswap(binascii.hexlify(devices[0]["device-id"]).decode()[:4]) - # print("- Found XHCI Controller, adding Boot Support") - # shutil.copy(self.constants.xhci_driver_path, self.constants.drivers_path) - # self.get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True - # except ValueError: - # print("- No XHCI Controller Found (V)") - # except IndexError: - # print("- No XHCI Controller Found (I)") - if self.constants.nvme_boot is True: print("- Enabling NVMe boot support") shutil.copy(self.constants.nvme_driver_path, self.constants.drivers_path) @@ -644,15 +635,19 @@ class BuildOpenCore: self.get_efi_binary_by_path("OpenRuntime.efi", "UEFI", "Drivers")["Enabled"] = True self.get_efi_binary_by_path("OpenLinuxBoot.efi", "UEFI", "Drivers")["Enabled"] = True # Exfat check - if self.model in ModelArray.NoExFat: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge: + # Sandy Bridge and newer Macs natively support ExFat print("- Adding ExFatDxeLegacy.efi") shutil.copy(self.constants.exfat_legacy_driver_path, self.constants.drivers_path) self.get_efi_binary_by_path("ExFatDxeLegacy.efi", "UEFI", "Drivers")["Enabled"] = True # Add UGA to GOP layer - if self.model in ModelArray.UGAtoGOP: + try: + smbios_data.smbios_dictionary[self.model]["UGA Graphics"] print("- Adding UGA to GOP Patch") self.config["UEFI"]["Output"]["GopPassThrough"] = "Apple" + except KeyError: + pass # ThirdPartDrives Check if self.model in ModelArray.SATAPatch and self.constants.allow_oc_everywhere is False: @@ -721,9 +716,13 @@ class BuildOpenCore: if self.constants.validate is False: print("- Adding bootmgfw.efi BlessOverride") self.config["Misc"]["BlessOverride"] += ["\\EFI\\Microsoft\\Boot\\bootmgfw.efi"] - if self.model in ModelArray.dGPU_switch and self.constants.dGPU_switch is True: - print("- Allowing GMUX switching in Windows") + try: + if self.constants.dGPU_switch is True: + smbios_data.smbios_dictionary[self.model]["Switchable GPUs"] + print("- Allowing GMUX switching in Windows") self.config["Booter"]["Quirks"]["SignalAppleOS"] = True + except KeyError: + pass if self.constants.allow_fv_root is True: # apfs.kext has an undocumented boot-arg that allows FileVault usage on broken APFS seals (-arv_allow_fv) # This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true @@ -742,7 +741,7 @@ class BuildOpenCore: spoofed_model = self.constants.override_smbios print(f"- Using Model ID: {spoofed_model}") try: - spoofed_board = self.constants.board_id[spoofed_model] + spoofed_board = smbios_data.smbios_dictionary[spoofed_model]["Board ID"] print(f"- Using Board ID: {spoofed_board}") except KeyError: spoofed_board = "" diff --git a/Resources/Constants.py b/Resources/Constants.py index 0619b0afc..7c113e6b3 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -631,41 +631,6 @@ class Constants: def legacy_wifi_libexec(self): return self.payload_apple_libexec_path / Path("Legacy-Wifi") - csr_values = { - # Source: macOS 11.4 (XNU's csr.h) - # https://opensource.apple.com/source/xnu/xnu-7195.121.3/bsd/sys/csr.h.auto.html - "CSR_ALLOW_UNTRUSTED_KEXTS": False, # 0x1 - Allows Unsigned Kexts - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_UNRESTRICTED_FS": False, # 0x2 - File System Access - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_TASK_FOR_PID": False, # 0x4 - Unrestricted task_for_pid() - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_KERNEL_DEBUGGER": False, # 0x8 - Allow Kernel Debugger - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_APPLE_INTERNAL": False, # 0x10 - Set AppleInternal Features - Introduced in El Capitan # noqa: E241 - # "CSR_ALLOW_DESTRUCTIVE_DTRACE": False, # 0x20 - Allow destructive DTrace - Deprecated # noqa: E241 - "CSR_ALLOW_UNRESTRICTED_DTRACE": False, # 0x20 - Unrestricted DTrace usage - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_UNRESTRICTED_NVRAM": False, # 0x40 - Unrestricted NVRAM write - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_DEVICE_CONFIGURATION": False, # 0x80 - Allow custom DeviceTree (iOS) - Introduced in El Capitan # noqa: E241 - "CSR_ALLOW_ANY_RECOVERY_OS": False, # 0x100 - Skip BaseSystem Verification - Introduced in Sierra # noqa: E241 - "CSR_ALLOW_UNAPPROVED_KEXTS": False, # 0x200 - Allow Unnotarized Kexts - Introduced in High Sierra # noqa: E241 - "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE": False, # 0x400 - Override Executable Policy - Introduced in Mojave # noqa: E241 - "CSR_ALLOW_UNAUTHENTICATED_ROOT": False, # 0x800 - Allow Root Volume Mounting - Introduced in Big Sur # noqa: E241 - } - - root_patch_sip_mojave = [ - # Variables required to root patch in Mojave and Catalina - "CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1 - "CSR_ALLOW_UNRESTRICTED_FS", # 0x2 - "CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200 - "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400 - ] - - root_patch_sip_big_sur = [ - # Variables required to root patch in Big Sur and Monterey - "CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1 - "CSR_ALLOW_UNRESTRICTED_FS", # 0x2 - "CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200 - "CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400 - "CSR_ALLOW_UNAUTHENTICATED_ROOT", # 0x800 - ] - sbm_values = [ "j137ap", # iMacPro1,1 "j680ap", # MacBookPro15,1 @@ -695,133 +660,6 @@ class Constants: "Mac-7BA5B2D9E42DDD94", # iMacPro1,1 ] - board_id = { - "MacBook1,1": "Mac-F4208CC8", - "MacBook2,1": "Mac-F4208CA9", - "MacBook3,1": "Mac-F22788C8", - "MacBook4,1": "Mac-F22788A9", - "MacBook5,1": "Mac-F42D89C8", - "MacBook5,2": "Mac-F22788AA", - "MacBook6,1": "Mac-F22C8AC8", - "MacBook7,1": "Mac-F22C89C8", - "MacBook8,1": "Mac-BE0E8AC46FE800CC", - "MacBook9,1": "Mac-9AE82516C7C6B903", - "MacBook10,1": "Mac-EE2EBD4B90B839A8", - "MacBookAir1,1": "Mac-F42C8CC8", - "MacBookAir2,1": "Mac-F42D88C8", - "MacBookAir3,1": "Mac-942452F5819B1C1B", - "MacBookAir3,2": "Mac-942C5DF58193131B", - "MacBookAir4,1": "Mac-C08A6BB70A942AC2", - "MacBookAir4,2": "Mac-742912EFDBEE19B3", - "MacBookAir5,1": "Mac-66F35F19FE2A0D05", - "MacBookAir5,2": "Mac-2E6FAB96566FE58C", - "MacBookAir6,1": "Mac-35C1E88140C3E6CF", - "MacBookAir6,2": "Mac-7DF21CB3ED6977E5", - "MacBookAir7,1": "Mac-9F18E312C5C2BF0B", - "MacBookAir7,2": "Mac-937CB26E2E02BB01", - "MacBookAir8,1": "Mac-827FAC58A8FDFA22", - "MacBookAir8,2": "Mac-226CB3C6A851A671", - "MacBookAir9,1": "Mac-0CFF9C7C2B63DF8D", - "MacBookPro1,1": "Mac-F425BEC8", - "MacBookPro1,2": "Mac-F42DBEC8", - "MacBookPro2,1": "Mac-F42189C8", - "MacBookPro2,2": "Mac-F42187C8", - "MacBookPro3,1": "Mac-F4238BC8", - "MacBookPro4,1": "Mac-F42C89C8", - "MacBookPro5,1": "Mac-F42D86C8", - "MacBookPro5,2": "Mac-F2268EC8", - "MacBookPro5,3": "Mac-F22587C8", - "MacBookPro5,4": "Mac-F22587A1", - "MacBookPro5,5": "Mac-F2268AC8", - "MacBookPro6,1": "Mac-F22589C8", - "MacBookPro6,2": "Mac-F22586C8", - "MacBookPro7,1": "Mac-F222BEC8", - "MacBookPro8,1": "Mac-94245B3640C91C81", - "MacBookPro8,2": "Mac-94245A3940C91C80", - "MacBookPro8,3": "Mac-942459F5819B171B", - "MacBookPro9,1": "Mac-4B7AC7E43945597E", - "MacBookPro9,2": "Mac-6F01561E16C75D06", - "MacBookPro10,1": "Mac-C3EC7CD22292981F", - "MacBookPro10,2": "Mac-AFD8A9D944EA4843", - "MacBookPro11,1": "Mac-189A3D4F975D5FFC", - "MacBookPro11,2": "Mac-3CBD00234E554E41", - "MacBookPro11,3": "Mac-2BD1B31983FE1663", - "MacBookPro11,4": "Mac-06F11FD93F0323C5", - "MacBookPro11,5": "Mac-06F11F11946D27C5", - "MacBookPro12,1": "Mac-E43C1C25D4880AD6", - "MacBookPro13,1": "Mac-473D31EABEB93F9B", - "MacBookPro13,2": "Mac-66E35819EE2D0D05", - "MacBookPro13,3": "Mac-A5C67F76ED83108C", - "MacBookPro14,1": "Mac-B4831CEBD52A0C4C", - "MacBookPro14,2": "Mac-CAD6701F7CEA0921", - "MacBookPro14,3": "Mac-551B86E5744E2388", - "MacBookPro15,1": "Mac-937A206F2EE63C01", - "MacBookPro15,2": "Mac-827FB448E656EC26", - "MacBookPro15,3": "Mac-1E7E29AD0135F9BC", - "MacBookPro15,4": "Mac-53FDB3D8DB8CA971", - "MacBookPro16,1": "Mac-E1008331FDC96864", - "MacBookPro16,2": "Mac-5F9802EFE386AA28", - "MacBookPro16,3": "Mac-E7203C0F68AA0004", - "MacBookPro16,4": "Mac-A61BADE1FDAD7B05", - "Macmini1,1": "Mac-F4208EC8", - "Macmini2,1": "Mac-F4208EAA", - "Macmini3,1": "Mac-F22C86C8", - "Macmini4,1": "Mac-F2208EC8", - "Macmini5,1": "Mac-8ED6AF5B48C039E1", - "Macmini5,2": "Mac-4BC72D62AD45599E", - "Macmini5,3": "Mac-7BA5B2794B2CDB12", - "Macmini6,1": "Mac-031AEE4D24BFF0B1", - "Macmini6,2": "Mac-F65AE981FFA204ED", - "Macmini7,1": "Mac-35C5E08120C7EEAF", - "Macmini8,1": "Mac-7BA5B2DFE22DDD8C", - "iMac4,1": "Mac-F42786C8", - "iMac4,2": "Mac-F4218EC8", - "iMac5,1": "Mac-F4228EC8", - "iMac5,2": "Mac-F4218EC8", - "iMac6,1": "Mac-F4218FC8", - "iMac7,1": "Mac-F42386C8", - "iMac8,1": "Mac-F227BEC8", - "iMac9,1": "Mac-F2218FA9", - "iMac10,1": "Mac-F221DCC8", - # "iMac10,1": "Mac-F2268CC8", - "iMac11,1": "Mac-F2268DAE", - "iMac11,2": "Mac-F2238AC8", - "iMac11,3": "Mac-F2238BAE", - "iMac12,1": "Mac-942B5BF58194151B", - "iMac12,2": "Mac-942B59F58194171B", - "iMac13,1": "Mac-00BE6ED71E35EB86", - "iMac13,2": "Mac-FC02E91DDD3FA6A4", - "iMac13,3": "Mac-7DF2A3B5E5D671ED", - "iMac14,1": "Mac-031B6874CF7F642A", - "iMac14,2": "Mac-27ADBB7B4CEE8E61", - "iMac14,3": "Mac-77EB7D7DAF985301", - "iMac14,4": "Mac-81E3E92DD6088272", - "iMac15,1": "Mac-42FD25EABCABB274", - "iMac16,1": "Mac-A369DDC4E67F1C45", - "iMac16,2": "Mac-FFE5EF870D7BA81A", - "iMac17,1": "Mac-DB15BD556843C820", - # iMac17,1": "Mac-65CE76090165799A", - # iMac17,1": "Mac-B809C3757DA9BB8D", - "iMac18,1": "Mac-4B682C642B45593E", - "iMac18,2": "Mac-77F17D7DA9285301", - "iMac18,3": "Mac-BE088AF8C5EB4FA2", - "iMac19,1": "Mac-AA95B1DDAB278B95", - "iMac19,2": "Mac-63001698E7A34814", - "iMac20,1": "Mac-CFF7D910A743CAAF", - "iMac20,2": "Mac-AF89B6D9451A490B", - "iMacPro1,1": "Mac-7BA5B2D9E42DDD94", - "MacPro1,1": "Mac-F4208DC8", - "MacPro2,1": "Mac-F4208DA9", - "MacPro3,1": "Mac-F42C88C8", - "MacPro4,1": "Mac-F221BEC8", - "MacPro5,1": "Mac-F221BEC8", - "MacPro6,1": "Mac-F60DEB81FF30ACF6", - "MacPro7,1": "Mac-27AD2F918AE68F61", - "Xserve1,1": "Mac-F4208AC8", - "Xserve2,1": "Mac-F42289C8", - "Xserve3,1": "Mac-F223BEC8", - } - target_type = { "ADP3,2": "J273", "MacBookAir10,1": "J313", diff --git a/Resources/ModelArray.py b/Resources/ModelArray.py index 95f41650a..78ab84b9d 100644 --- a/Resources/ModelArray.py +++ b/Resources/ModelArray.py @@ -71,44 +71,12 @@ SupportedSMBIOS = [ # Xserve "Xserve2,1", "Xserve3,1", - "Dortania1,1", ] # CPU patches -MissingSSE42 = [ - "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", - "MacBookPro7,1", - "Macmini3,1", - "Macmini4,1", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "MacPro3,1", - "Xserve2,1", - "Dortania1,1", -] - -SSEEmulator = ["MacPro3,1", "Xserve2,1", "Dortania1,1"] - DualSocket = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"] -pciSSDT = ["MacBookPro6,1", "MacBookPro6,2", "iMac11,1", "iMac11,2", "iMac11,3", "Dortania1,1"] - # Ethernet patches EthernetNvidia = [ @@ -148,57 +116,6 @@ EthernetBroadcom = [ "Dortania1,1", ] -# Wifi patches - -WifiAtheros = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "Dortania1,1"] - -WifiBCM94328 = ["MacBook4,1", "MacBookAir2,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "Dortania1,1"] - -WifiBCM94322 = [ - "MacBook5,1", - "MacBook5,2", - "MacBookAir3,1", - "MacBookAir3,2", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro7,1", - "Macmini3,1", - "iMac9,1", - "MacPro5,1", - "Dortania1,1", -] - -WifiBCM94331 = [ - "MacBook6,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0) - "MacBook7,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0) - "MacBookAir4,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookAir4,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookAir5,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookAir5,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro6,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro6,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro8,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro8,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro8,3", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro9,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro9,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro10,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "MacBookPro10,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "Macmini4,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0) - "Macmini5,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "Macmini5,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "Macmini5,3", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "Macmini6,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "Macmini6,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0) - "iMac13,1", # PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0) - "iMac13,2", # PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0) - "iMac13,3", # PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0) - "Dortania1,1", -] - # Audio LegacyAudio = [ @@ -389,150 +306,8 @@ LegacyBrightness = [ "iMac9,1", ] -LegacyHID = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBookAir2,1", - "MacBookAir3,1", - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro7,1", - "Macmini3,1", - "Macmini4,1", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "MacPro3,1", - "Dortania1,1", -] - NVMePatch = ["MacPro3,1", "MacPro4,1", "Xserve3,1", "Dortania1,1"] -XhciSupport = [ - "MacBookAir5,1", - "MacBookAir5,2", - "MacBookAir6,1", - "MacBookAir6,2", - "MacBookAir7,1", - "MacBookAir7,2", - "MacBookPro9,1", - "MacBookPro9,2", - "MacBookPro10,1", - "MacBookPro10,2", - "MacBookPro11,1", - "MacBookPro11,2", - "MacBookPro11,3", - "MacBookPro11,4", - "MacBookPro11,5", - "MacBookPro12,1", - "Macmini6,1", - "Macmini6,2", - "Macmini7,1", - "iMac13,1", - "iMac13,2", - "iMac13,3", - "iMac14,1", - "iMac14,2", - "iMac14,3", - "iMac15,1", - "iMac16,1", - "iMac16,2", - "MacPro6,1", - "Dortania1,1", -] - -FeatureUnlockSupport = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBook8,1", - "MacBookAir2,1", - "MacBookAir3,1", - "MacBookAir3,2", - "MacBookAir4,1", - "MacBookAir4,2", - "MacBookAir5,1", - "MacBookAir5,2", - "MacBookAir6,1", - "MacBookAir6,2", - "MacBookAir7,1", - "MacBookAir7,2", - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro6,1", - "MacBookPro6,2", - "MacBookPro7,1", - "MacBookPro8,1", - "MacBookPro8,2", - "MacBookPro8,3", - "MacBookPro9,1", - "MacBookPro9,2", - "MacBookPro10,1", - "MacBookPro10,2", - "MacBookPro11,1", - "MacBookPro11,2", - "MacBookPro11,3", - "MacBookPro11,4", - "MacBookPro11,5", - "MacBookPro12,1", - "MacBookPro13,1", - "MacBookPro13,2", - "MacBookPro13,3", - "MacBookPro14,1", - "MacBookPro14,2", - "MacBookPro14,3", - "Macmini3,1", - "Macmini4,1", - "Macmini5,1", - "Macmini5,2", - "Macmini5,3", - "Macmini6,1", - "Macmini6,2", - "Macmini7,1", - "Macmini8,1", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "iMac11,1", - "iMac11,2", - "iMac11,3", - "iMac12,1", - "iMac12,2", - "iMac13,1", - "iMac13,2", - "iMac13,3", - "iMac14,1", - "iMac14,2", - "iMac14,3", - "iMac15,1", - "iMac16,1", - "iMac16,2", - "iMac17,1", - "iMac18,1", - "iMac18,2", - "iMac18,3", - "MacPro3,1", - "MacPro4,1", - "MacPro5,1", - "MacPro6,1", - "Dortania1,1", -] - DualGPUPatch = [ "MacBookPro5,1", "MacBookPro5,2", @@ -653,15 +428,6 @@ iMac_iGPU = ["iMac13,1", "iMac13,3", "iMac14,1", "iMac14,4"] # Mac Pro and Xserve MacPro = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"] -UGAtoGOP = [ - "MacBook4,1", - "MacBookPro4,1", - "iMac7,1", - "iMac8,1", - "MacPro3,1", - "Xserve2,1", -] - SATAPatch = [ "MacBook4,1", "MacBook5,1", @@ -709,82 +475,6 @@ SATAPatch = [ "Dortania1,1", ] -NoAPFSsupport = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBookAir2,1", - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "Macmini3,1", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "MacPro3,1", - "MacPro4,1", - "Xserve2,1", - "Xserve3,1", - "Dortania1,1", -] - -NoExFat = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBookAir2,1", - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro6,1", - "MacBookPro6,2", - "MacBookPro7,1", - "Macmini3,1", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "iMac11,1", - "MacPro3,1", - "MacPro4,1", - "MacPro5,1", - "Xserve2,1", - "Xserve3,1", - "Dortania1,1", -] - -windows_audio = [ - "MacBookAir4,1", - "MacBookAir4,2", - "MacBookAir5,1", - "MacBookAir5,2", - "MacBookPro8,1", - "MacBookPro8,2", - "MacBookPro8,3", - "MacBookPro9,1", - "MacBookPro9,2", - "MacBookPro10,1", - "MacBookPro10,2", - "Macmini5,1", - "Macmini5,2", - "Macmini5,3", - "Macmini6,1", - "Macmini6,2", - "iMac12,1", - "iMac12,2", - "iMac13,1", - "iMac13,2", - "iMac13,3", -] - NoAGPMSupport = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "MacPro3,1", "Xserve2,1", "Dortania1,1"] AGDPSupport = [ @@ -819,39 +509,6 @@ NoFireWireSupport = [ "MacBookAir3,2", ] -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", - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "iMac11,1", - "iMac11,2", - "iMac11,3", - "MacPro3,1", - "MacPro4,1", - "MacPro5,1", - "Dortania1,1", -] - # Thunderbolt 1 Macs Thunderbolt_1 = [ "MacBookAir4,1", @@ -973,96 +630,4 @@ Missing_USB_Map = [ "MacPro4,1", "XServe2,1", "XServe3,1", -] - -dGPU_switch = [ - # Allows iGPU and dGPU switching in Windows - "MacBookPro8,2", - "MacBookPro8,3", - "MacBookPro9,1", - "MacBookPro10,1", - "MacBookPro11,3", - "MacBookPro11,5", - "MacBookPro13,3", - "MacBookPro14,3", - "MacBookPro15,1", - "MacBookPro15,3", - "MacBookPro16,1", - "MacBookPro16,4", -] - -Bluetooth_BRCM2046 = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBookAir2,1", - "MacBookAir3,1", - "MacBookAir3,2", - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro7,1", - "Macmini3,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "iMac11,1", - "iMac11,2", - "iMac11,3", - "iMac12,1", - "iMac12,2", - "MacPro4,1", - "MacPro5,1", -] - -Bluetooth_BRCM2070 = [ - "MacBook6,1", - "MacBook7,1", - "MacBookAir4,1", - "MacBookAir4,2", - "MacBookPro6,1", - "MacBookPro6,2", - "MacBookPro8,1", - "MacBookPro8,2", - "MacBookPro8,3", - "Macmini4,1", - "Macmini5,1", - "Macmini5,2", - "Macmini5,3", -] - -Bluetooth_BRCM20702_v1 = [ - "MacBookAir5,1", - "MacBookAir5,2", - "MacBookPro9,1", - "MacBookPro9,2", - "MacBookPro10,1", - "MacBookPro10,2", - "Macmini6,1", - "Macmini6,2", - "iMac13,1", - "iMac13,2", - "iMac13,3", -] - -T2_Models = [ - "MacBookAir8,1", - "MacBookAir8,2", - "MacBookAir9,1", - "MacBookPro15,1", - "MacBookPro15,2", - "MacBookPro15,3", - "MacBookPro15,4", - "MacBookPro16,1", - "MacBookPro16,2", - "MacBookPro16,3", - "MacBookPro16,4", - "Macmini8,1", - "iMac20,1", - "iMac20,2", - "iMacPro1,1", - "MacPro7,1", ] \ No newline at end of file diff --git a/Resources/SMBIOSData.py b/Resources/SMBIOSData.py deleted file mode 100644 index 2a96d99b5..000000000 --- a/Resources/SMBIOSData.py +++ /dev/null @@ -1,110 +0,0 @@ -FirmwareFeatures = { - "iMac7,1": "0xC0001407", - "iMac8,1": "0xC0001403", - "iMac9,1": "0xC0001403", - "iMac10,1": "0xE00DE137", - "iMac11,1": "0xE00DE137", - "iMac11,2": "0xC00C9423", - "iMac11,3": "0xE00DE137", - "iMac12,1": "0xE00DE137", - "iMac12,2": "0xE00DE137", - "iMac13,1": "0xE00DE137", - "iMac13,2": "0xE00DE137", - "iMac13,3": "0xE00DE137", - "iMac14,1": "0xFB0FF577", - "iMac14,2": "0xE00FE137", - "iMac14,3": "0xE00FE137", - "iMac14,4": "0xF00FE137", - "iMac15,1": "0xF80FE137", - "iMac16,1": "0xFC0FE137", - "iMac16,2": "0xFC0FE137", - "iMac17,1": "0xFC0FE137", - "iMac18,1": "0xFD0FF576", - "iMac18,2": "0xFD0FF576", - "iMac18,3": "0xFD0FF576", - "iMac19,1": "0xFD8FF576", - "iMac19,2": "0xFD8FF576", - "iMac20,1": "0xFD8FF576", - "iMac20,2": "0xFD8FF576", - "iMacPro1,1": "0xFD8FF53E", - "MacBook3,1": "0xC0001407", - "MacBook4,1": "0xC0001403", - "MacBook5,1": "0xC0001403", - "MacBook5,2": "0xC0001403", - "MacBook6,1": "0xFC0FE13F", - "MacBook7,1": "0xFC0FE13F", - "MacBook8,1": "0xFC0FE13F", - "MacBook9,1": "0xFC0FE13F", - "MacBook10,1": "0xFC0FE13F", - "MacBookAir1,1": "0xC0001403", - "MacBookAir2,1": "0xC0001403", - "MacBookAir3,1": "0xD00DE137", - "MacBookAir3,2": "0xD00DE137", - "MacBookAir4,1": "0xD00DE137", - "MacBookAir4,2": "0xD00DE137", - "MacBookAir5,1": "0xE00DE137", - "MacBookAir5,2": "0xE00DE137", - "MacBookAir6,1": "0xE00FE137", - "MacBookAir6,2": "0xE00FE137", - "MacBookAir7,1": "0xFF0FF576", - "MacBookAir7,2": "0xFF0FF576", - "MacBookAir8,1": "0xFD8FF42E", - "MacBookAir8,2": "0xFD8FF42E", - "MacBookAir9,1": "0xFFAFF06E", - "MacBookPro3,1": "0xC0001407", - "MacBookPro4,1": "0xC0001403", - "MacBookPro5,1": "0xC0001403", - "MacBookPro5,2": "0xC0001403", - "MacBookPro5,3": "0xC0001403", - "MacBookPro5,4": "0xC0001403", - "MacBookPro5,5": "0xC0001403", - "MacBookPro6,1": "0xC00DE137", - "MacBookPro6,2": "0xC00DE137", - "MacBookPro7,1": "0xC00DE137", - "MacBookPro8,1": "0xC00DE137", - "MacBookPro8,2": "0xC00DE137", - "MacBookPro8,3": "0xC00DE137", - "MacBookPro9,1": "0xC00DE137", - "MacBookPro9,2": "0xC10DF577", - "MacBookPro10,1": "0xE00DE137", - "MacBookPro10,2": "0xE00DE137", - "MacBookPro11,1": "0xEB0FF577", - "MacBookPro11,2": "0xEB0FF577", - "MacBookPro11,3": "0xEB0FF577", - "MacBookPro11,4": "0xEB0FF577", - "MacBookPro11,5": "0xEB0FF577", - "MacBookPro12,1": "0xFD0FF576", - "MacBookPro13,1": "0xFC0FE137", - "MacBookPro13,2": "0xFC0FE137", - "MacBookPro13,3": "0xFC0FE137", - "MacBookPro14,1": "0xFF0FF57E", - "MacBookPro14,2": "0xFF0FF57E", - "MacBookPro14,3": "0xFF0FF57E", - "MacBookPro15,1": "0xFD8FF426", - "MacBookPro15,2": "0xFD8FF426", - "MacBookPro15,3": "0xFD8FF426", - "MacBookPro15,4": "0xFD8FF426", - "MacBookPro16,1": "0xFDAFF066", - "MacBookPro16,2": "0xFFAFF06E", - "MacBookPro16,3": "0xFDAFF066", - "MacBookPro16,4": "0xFDAFF066", - "Macmini3,1": "0xC0001403", - "Macmini4,1": "0xC00C9423", - "Macmini5,1": "0xD00DE137", - "Macmini5,2": "0xD00DE137", - "Macmini5,3": "0xD00DE137", - "Macmini6,1": "0xE00DE137", - "Macmini6,2": "0xE00DE137", - "Macmini7,1": "0xE00DE137", - "Macmini8,1": "0xFD8FF466", - "MacPro1,1": "0x80000015", - "MacPro2,1": "0xC0000015", - "MacPro3,1": "0xC0001403", - "MacPro4,1": "0xE001F537", - "MacPro5,1": "0xE80FE137", - "MacPro6,1": "0xE90FF576", - "MacPro7,1": "0xFDAFF066", - "Xserve2,1": "0xC0001403", - "Xserve3,1": "0xE001F537", - "Dortania1,1": "0xFDAFF066", -} diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index f7981fae6..410e2e10c 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -12,6 +12,7 @@ import zipfile from pathlib import Path from Resources import Constants, device_probe, ModelArray, SysPatchArray, Utilities +from Data import sip_data class PatchSysVolume: @@ -758,8 +759,8 @@ set million colour before rebooting""" ) def verify_patch_allowed(self): - sip = self.constants.root_patch_sip_big_sur if self.constants.detected_os > self.constants.catalina else self.constants.root_patch_sip_mojave - if sip == self.constants.root_patch_sip_mojave: + sip = sip_data.system_integrity_protection.root_patch_sip_big_sur if self.constants.detected_os > self.constants.catalina else sip_data.system_integrity_protection.root_patch_sip_mojave + if sip == sip_data.system_integrity_protection.root_patch_sip_mojave: sip_value = "For Hackintoshes, please set csr-active-config to '03060000' (0x603)\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS" else: sip_value = ( diff --git a/Resources/Utilities.py b/Resources/Utilities.py index 298ee02b3..718861fe0 100644 --- a/Resources/Utilities.py +++ b/Resources/Utilities.py @@ -21,6 +21,7 @@ except ImportError: raise Exception("Missing requests library!\nPlease run the following before starting OCLP:\npip3 install requests") from Resources import Constants, ioreg, device_probe +from Data import sip_data def hexswap(input_hex: str): @@ -120,13 +121,13 @@ def csr_decode(csr_active_config, os_sip): csr_active_config = b"\x00\x00\x00\x00" sip_int = int.from_bytes(csr_active_config, byteorder="little") i = 0 - for current_sip_bit in Constants.Constants.csr_values: + for current_sip_bit in sip_data.system_integrity_protection.csr_values: if sip_int & (1 << i): - Constants.Constants.csr_values[current_sip_bit] = True + sip_data.system_integrity_protection.csr_values[current_sip_bit] = True i = i + 1 # Can be adjusted to whatever OS needs patching - sip_needs_change = all(Constants.Constants.csr_values[i] for i in os_sip) + sip_needs_change = all(sip_data.system_integrity_protection.csr_values[i] for i in os_sip) if sip_needs_change is True: return False else: diff --git a/Resources/device_probe.py b/Resources/device_probe.py index a8416b932..e2f06c38d 100644 --- a/Resources/device_probe.py +++ b/Resources/device_probe.py @@ -10,7 +10,8 @@ import subprocess from dataclasses import dataclass, field from typing import Any, ClassVar, Optional, Type, Union -from Resources import PCIIDArray, Utilities, ioreg +from Resources import Utilities, ioreg +from Data import pci_data @dataclass @@ -168,11 +169,11 @@ class NVIDIA(GPU): def detect_arch(self): # G80/G80GL - if self.device_id in PCIIDArray.nvidia_ids.tesla_ids: + if self.device_id in pci_data.nvidia_ids.tesla_ids: self.arch = NVIDIA.Archs.Tesla - elif self.device_id in PCIIDArray.nvidia_ids.fermi_ids: + elif self.device_id in pci_data.nvidia_ids.fermi_ids: self.arch = NVIDIA.Archs.Fermi - elif self.device_id in PCIIDArray.nvidia_ids.kepler_ids: + elif self.device_id in pci_data.nvidia_ids.kepler_ids: self.arch = NVIDIA.Archs.Kepler else: self.arch = NVIDIA.Archs.Unknown @@ -195,17 +196,17 @@ class AMD(GPU): arch: Archs = field(init=False) def detect_arch(self): - if self.device_id in PCIIDArray.amd_ids.legacy_gcn_ids: + if self.device_id in pci_data.amd_ids.legacy_gcn_ids: self.arch = AMD.Archs.Legacy_GCN - elif self.device_id in PCIIDArray.amd_ids.terascale_1_ids: + elif self.device_id in pci_data.amd_ids.terascale_1_ids: self.arch = AMD.Archs.TeraScale_1 - elif self.device_id in PCIIDArray.amd_ids.terascale_2_ids: + elif self.device_id in pci_data.amd_ids.terascale_2_ids: self.arch = AMD.Archs.TeraScale_2 - elif self.device_id in PCIIDArray.amd_ids.polaris_ids: + elif self.device_id in pci_data.amd_ids.polaris_ids: self.arch = AMD.Archs.Polaris - elif self.device_id in PCIIDArray.amd_ids.vega_ids: + elif self.device_id in pci_data.amd_ids.vega_ids: self.arch = AMD.Archs.Vega - elif self.device_id in PCIIDArray.amd_ids.navi_ids: + elif self.device_id in pci_data.amd_ids.navi_ids: self.arch = AMD.Archs.Navi else: self.arch = AMD.Archs.Unknown @@ -231,23 +232,23 @@ class Intel(GPU): arch: Archs = field(init=False) def detect_arch(self): - if self.device_id in PCIIDArray.intel_ids.iron_ids: + if self.device_id in pci_data.intel_ids.iron_ids: self.arch = Intel.Archs.Iron_Lake - elif self.device_id in PCIIDArray.intel_ids.sandy_ids: + elif self.device_id in pci_data.intel_ids.sandy_ids: self.arch = Intel.Archs.Sandy_Bridge - elif self.device_id in PCIIDArray.intel_ids.ivy_ids: + elif self.device_id in pci_data.intel_ids.ivy_ids: self.arch = Intel.Archs.Ivy_Bridge - elif self.device_id in PCIIDArray.intel_ids.haswell_ids: + elif self.device_id in pci_data.intel_ids.haswell_ids: self.arch = Intel.Archs.Haswell - elif self.device_id in PCIIDArray.intel_ids.broadwell_ids: + elif self.device_id in pci_data.intel_ids.broadwell_ids: self.arch = Intel.Archs.Broadwell - elif self.device_id in PCIIDArray.intel_ids.skylake_ids: + elif self.device_id in pci_data.intel_ids.skylake_ids: self.arch = Intel.Archs.Skylake - elif self.device_id in PCIIDArray.intel_ids.kaby_lake_ids: + elif self.device_id in pci_data.intel_ids.kaby_lake_ids: self.arch = Intel.Archs.Kaby_Lake - elif self.device_id in PCIIDArray.intel_ids.coffee_lake_ids: + elif self.device_id in pci_data.intel_ids.coffee_lake_ids: self.arch = Intel.Archs.Coffee_Lake - elif self.device_id in PCIIDArray.intel_ids.ice_lake_ids: + elif self.device_id in pci_data.intel_ids.ice_lake_ids: self.arch = Intel.Archs.Ice_Lake else: self.arch = Intel.Archs.Unknown @@ -259,6 +260,7 @@ class Broadcom(WirelessCard): class Chipsets(enum.Enum): # pylint: disable=invalid-name + AppleBCMWLANBusInterfacePCIe = "AppleBCMWLANBusInterfacePCIe supported" AirportBrcmNIC = "AirportBrcmNIC supported" AirPortBrcm4360 = "AirPortBrcm4360 supported" AirPortBrcm4331 = "AirPortBrcm4331 supported" @@ -268,13 +270,15 @@ class Broadcom(WirelessCard): chipset: Chipsets = field(init=False) def detect_chipset(self): - if self.device_id in PCIIDArray.broadcom_ids.AirPortBrcmNIC: + if self.device_id in pci_data.broadcom_ids.AppleBCMWLANBusInterfacePCIe: + self.chipset = Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe + elif self.device_id in pci_data.broadcom_ids.AirPortBrcmNIC: self.chipset = Broadcom.Chipsets.AirportBrcmNIC - elif self.device_id in PCIIDArray.broadcom_ids.AirPortBrcm4360: + elif self.device_id in pci_data.broadcom_ids.AirPortBrcm4360: self.chipset = Broadcom.Chipsets.AirPortBrcm4360 - elif self.device_id in PCIIDArray.broadcom_ids.AirPortBrcm4331: + elif self.device_id in pci_data.broadcom_ids.AirPortBrcm4331: self.chipset = Broadcom.Chipsets.AirPortBrcm4331 - elif self.device_id in PCIIDArray.broadcom_ids.AppleAirPortBrcm43224: + elif self.device_id in pci_data.broadcom_ids.AppleAirPortBrcm43224: self.chipset = Broadcom.Chipsets.AirPortBrcm43224 else: self.chipset = Broadcom.Chipsets.Unknown @@ -293,7 +297,7 @@ class Atheros(WirelessCard): chipset: Chipsets = field(init=False) def detect_chipset(self): - if self.device_id in PCIIDArray.atheros_ids.AtherosWifi: + if self.device_id in pci_data.atheros_ids.AtherosWifi: self.chipset = Atheros.Chipsets.AirPortAtheros40 else: self.chipset = Atheros.Chipsets.Unknown From 8b41cc6ff5ba141915f703703b2f92800cd0f6b5 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 00:17:47 -0600 Subject: [PATCH 02/30] Update .spec to include Data folder --- OCLP-CLI.spec | 2 +- OpenCore-Patcher.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OCLP-CLI.spec b/OCLP-CLI.spec index 837e2ce94..54123a204 100644 --- a/OCLP-CLI.spec +++ b/OCLP-CLI.spec @@ -6,7 +6,7 @@ block_cipher = None a = Analysis(['OCLP-CLI.command'], - pathex=['Resources'], + pathex=['Resources', 'Data'], binaries=[], datas=[('payloads', 'payloads')], hiddenimports=[], diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index 28a9bc688..4bf2756ab 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -6,7 +6,7 @@ block_cipher = None a = Analysis(['OpenCore-Patcher.command'], - pathex=['Resources'], + pathex=['Resources', 'Data'], binaries=[], datas=[('payloads', 'payloads')], hiddenimports=[], From 0e07273c8e79671cc196d07cc9d8b93316380508 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 09:45:34 -0600 Subject: [PATCH 03/30] Move SMBIOS generation to dedicated file --- Data/cpu_data.py | 2 +- Data/smbios_data.py | 324 +++++++++++++++++------------------ Resources/Build.py | 59 ++----- Resources/Constants.py | 2 +- Resources/ModelArray.py | 85 --------- Resources/generate_smbios.py | 53 ++++++ 6 files changed, 233 insertions(+), 292 deletions(-) create mode 100644 Resources/generate_smbios.py diff --git a/Data/cpu_data.py b/Data/cpu_data.py index d372f1103..31016f340 100644 --- a/Data/cpu_data.py +++ b/Data/cpu_data.py @@ -3,7 +3,7 @@ class cpu_data: yonah = 1 conroe = 2 penryn = 3 - nahalem = 4 # (Westmere included) + nehalem = 4 # (Westmere included) sandy_bridge = 5 # 2000 ivy_bridge = 6 # 3000 haswell = 7 # 4000 diff --git a/Data/smbios_data.py b/Data/smbios_data.py index 3d3dab86a..ae051de50 100644 --- a/Data/smbios_data.py +++ b/Data/smbios_data.py @@ -14,15 +14,15 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, "UGA Graphics": True, - + }, - + "MacBook2,1": { "Board ID": "Mac-F4208CA9", "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, @@ -34,7 +34,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001407", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, @@ -46,7 +46,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -59,7 +59,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -71,7 +71,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -83,7 +83,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, @@ -95,7 +95,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, @@ -107,41 +107,41 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, }, - + "MacBook9,1": { "Board ID": "Mac-9AE82516C7C6B903", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, }, - + "MacBook10,1": { "Board ID": "Mac-EE2EBD4B90B839A8", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, }, - + "MacBookAir1,1": { "Board ID": "Mac-F42C8CC8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -152,7 +152,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -164,7 +164,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 11, @@ -176,7 +176,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -188,7 +188,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 11, @@ -200,7 +200,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, @@ -212,7 +212,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 11, @@ -224,7 +224,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, @@ -236,7 +236,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 11, @@ -248,7 +248,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -259,7 +259,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 11, @@ -270,7 +270,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -281,9 +281,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF42E", "SecureBootModel": "j140kap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -292,9 +292,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF42E", "SecureBootModel": "j140aap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -303,9 +303,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFFAFF06E", "SecureBootModel": "j230kap", "CPU Generation": cpu_data.cpu_data.ice_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -314,7 +314,7 @@ smbios_dictionary = { "FirmwareFeatures": "", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.yonah, - "Max OS supported": os_data.os_data.snow_leopard, + "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 15, @@ -326,7 +326,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.yonah, - "Max OS supported": os_data.os_data.snow_leopard, + "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 17, @@ -338,7 +338,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 17, @@ -350,7 +350,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 15, @@ -362,10 +362,10 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001407", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, - "Screen Size": 15, # Shipped with 17 as well + "Screen Size": 15, # Shipped with 17 as well "UGA Graphics": True, }, @@ -374,10 +374,10 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, - "Screen Size": 15, # Shipped with 17 as well + "Screen Size": 15, # Shipped with 17 as well "Switchable GPUs": True, "UGA Graphics": True, }, @@ -388,7 +388,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, @@ -401,7 +401,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 17, @@ -414,7 +414,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, @@ -427,7 +427,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, @@ -440,7 +440,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -451,8 +451,8 @@ smbios_dictionary = { "Board ID": "Mac-F22589C8", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.high_sierra, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 17, @@ -464,8 +464,8 @@ smbios_dictionary = { "Board ID": "Mac-F22586C8", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.high_sierra, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 15, @@ -478,7 +478,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, @@ -490,7 +490,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, @@ -502,7 +502,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 15, @@ -515,7 +515,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 17, @@ -528,7 +528,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 15, @@ -541,7 +541,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC10DF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, @@ -553,7 +553,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 15, @@ -566,7 +566,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, @@ -578,7 +578,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -590,7 +590,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -602,7 +602,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -614,7 +614,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -625,7 +625,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -637,7 +637,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -648,9 +648,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, }, @@ -659,9 +659,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, }, @@ -670,9 +670,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, "Switchable GPUs": True, }, @@ -682,9 +682,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, }, @@ -693,9 +693,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, }, @@ -704,9 +704,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, - "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, "Switchable GPUs": True, }, @@ -716,9 +716,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j680ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, "Switchable GPUs": True, }, @@ -728,9 +728,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j132ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -739,9 +739,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j780ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, "Switchable GPUs": True, }, @@ -751,9 +751,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j213ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -762,9 +762,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j152fap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, "Switchable GPUs": True, }, @@ -774,9 +774,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFFAFF06E", "SecureBootModel": "j214kap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -785,9 +785,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j223ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, }, @@ -796,9 +796,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j215ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, "Switchable GPUs": True, }, @@ -808,7 +808,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.yonah, - "Max OS supported": os_data.os_data.snow_leopard, + "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, }, @@ -818,7 +818,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, }, @@ -828,7 +828,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -839,7 +839,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC00C9423", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, }, @@ -850,7 +850,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, }, @@ -861,7 +861,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, }, @@ -872,7 +872,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, }, @@ -883,7 +883,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, }, @@ -894,7 +894,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, }, @@ -904,7 +904,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -914,9 +914,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF466", "SecureBootModel": "j174ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "iMac4,1": { @@ -924,7 +924,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.yonah, - "Max OS supported": os_data.os_data.snow_leopard, + "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, @@ -935,7 +935,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.yonah, - "Max OS supported": os_data.os_data.snow_leopard, + "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, @@ -946,7 +946,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, @@ -957,7 +957,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, @@ -968,7 +968,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, @@ -978,8 +978,8 @@ smbios_dictionary = { "Board ID": "Mac-F42386C8", "FirmwareFeatures": "0xC0001407", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, # Stock models shipped with Conroe - "Max OS supported": os_data.os_data.el_capitan, + "CPU Generation": cpu_data.cpu_data.penryn, # Stock models shipped with Conroe + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, @@ -991,7 +991,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, @@ -1003,7 +1003,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1015,7 +1015,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1025,8 +1025,8 @@ smbios_dictionary = { "Board ID": "Mac-F2268DAE", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.high_sierra, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1036,8 +1036,8 @@ smbios_dictionary = { "Board ID": "Mac-F2238AC8", "FirmwareFeatures": "0xC00C9423", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.high_sierra, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1047,8 +1047,8 @@ smbios_dictionary = { "Board ID": "Mac-F2238BAE", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.high_sierra, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1059,7 +1059,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1070,7 +1070,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.sandy_bridge, - "Max OS supported": os_data.os_data.high_sierra, + "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1081,7 +1081,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, }, @@ -1092,7 +1092,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, }, @@ -1103,7 +1103,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, }, @@ -1114,7 +1114,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1125,7 +1125,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1136,7 +1136,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.catalina, + "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1147,7 +1147,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xF00FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1158,7 +1158,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xF80FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS supported": os_data.os_data.big_sur, + "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1168,7 +1168,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1178,7 +1178,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1190,7 +1190,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1200,7 +1200,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, }, @@ -1210,7 +1210,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, }, @@ -1220,7 +1220,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, }, @@ -1230,9 +1230,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "iMac19,2": { @@ -1240,9 +1240,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "iMac20,1": { @@ -1250,9 +1250,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": "j185ap", "CPU Generation": cpu_data.cpu_data.comet_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "iMac20,2": { @@ -1260,9 +1260,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": "j185fap", "CPU Generation": cpu_data.cpu_data.comet_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "iMacPro1,1": { @@ -1270,9 +1270,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF53E", "SecureBootModel": "j137ap", "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "MacPro1,1": { @@ -1280,7 +1280,7 @@ smbios_dictionary = { "FirmwareFeatures": "0x80000015", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, @@ -1291,7 +1291,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0000015", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, @@ -1302,7 +1302,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.el_capitan, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, @@ -1313,8 +1313,8 @@ smbios_dictionary = { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE001F537", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.el_capitan, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1324,8 +1324,8 @@ smbios_dictionary = { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE80FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.mojave, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.mojave, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, }, @@ -1335,7 +1335,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE90FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, @@ -1345,9 +1345,9 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j160ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS supported": None, + "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, - "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Bluetooth Model": bluetooth_data.bluetooth_data.UART, }, "Xserve1,1": { @@ -1355,7 +1355,7 @@ smbios_dictionary = { "FirmwareFeatures": None, "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.conroe, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "UGA Graphics": True, @@ -1366,7 +1366,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.penryn, - "Max OS supported": os_data.os_data.lion, + "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "UGA Graphics": True, @@ -1376,10 +1376,10 @@ smbios_dictionary = { "Board ID": "Mac-F223BEC8", "FirmwareFeatures": "0xE001F537", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nahalem, - "Max OS supported": os_data.os_data.el_capitan, + "CPU Generation": cpu_data.cpu_data.nehalem, + "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, }, -} \ No newline at end of file +} diff --git a/Resources/Build.py b/Resources/Build.py index fb1d2ddac..a07c36799 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -14,7 +14,7 @@ import ast from pathlib import Path from datetime import date -from Resources import Constants, ModelArray, Utilities, device_probe +from Resources import Constants, ModelArray, Utilities, device_probe, generate_smbios from Data import smbios_data, bluetooth_data, cpu_data @@ -30,39 +30,8 @@ class BuildOpenCore: self.config = None self.constants: Constants.Constants = versions self.computer = self.constants.computer - self.gfx0_path = None - def smbios_set(self, model): - if model in ModelArray.MacBookAir_11: - return "MacBookAir7,1" - elif model in ModelArray.MacBookAir_13: - return "MacBookAir7,2" - elif model in ModelArray.MacBook_12: - return "MacBook9,1" - elif model in ModelArray.MacBookPro_13: - return "MacBookPro12,1" - elif model in ModelArray.MacBookPro_15_iGPU: - return "MacBookPro11,4" - elif model in ModelArray.MacBookPro_15_dGPU: - return "MacBookPro11,5" - elif model in ModelArray.Macmini: - return "Macmini7,1" - elif model in ModelArray.iMac_iGPUless: - return "iMacPro1,1" - elif model in ModelArray.iMac_dGPU: - # Check for upgraded GPUs on iMacs - if self.constants.drm_support is True: - return "iMacPro1,1" - else: - return "iMac17,1" - elif model in ModelArray.iMac_iGPU: - return "iMac16,1" - elif model in ModelArray.MacPro: - return "MacPro7,1" - else: - return model - def patch_firmware_feature(self): # Adjust FirmwareFeature to support everything macOS requires # APFS Bit (19/20): 10.13+ (OSInstall) @@ -179,12 +148,12 @@ class BuildOpenCore: 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 (smbios_data.smbios_dictionary[self.smbios_set(self.model) or self.constants.override_smbios]["SecureBootModel"]) != None: - # Monterey T2 SMBIOS don't get OS updates without a T2 SBM - # Forces VMM patch instead - if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: - self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) + if self.constants.allow_oc_everywhere is False: + if (smbios_data.smbios_dictionary[generate_smbios.set_smbios_model_spoof(self.model) or self.constants.override_smbios]["SecureBootModel"]) != None: + # Monterey T2 SMBIOS don't get OS updates without a T2 SBM + # Forces VMM patch instead + if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: + self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge: # Ref: https://github.com/reenigneorcim/SurPlus @@ -345,14 +314,15 @@ class BuildOpenCore: self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True # SSDT patches - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nahalem and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nehalem and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): + # Applicable for consumer Nehalem print("- Adding SSDT-CPBG.aml") self.get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-CPBG.aml")["Enabled"] = True shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path) if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge: # Based on: https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/ - # Apply to Sandy and Ivy Bridge Macs + # Applicable for Sandy and Ivy Bridge Macs print("- Enabling Windows 10 UEFI Audio support") self.get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-PCI.aml")["Enabled"] = True self.get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "BUF0 to BUF1")["Enabled"] = True @@ -453,6 +423,7 @@ class BuildOpenCore: } # Enable FireWire Boot Support + # Applicable for both native FireWire and Thunderbolt to FireWire adapters if self.constants.firewire_boot is True and self.model not in ModelArray.NoFireWireSupport: print("- Enabling FireWire Boot Support") self.enable_kext("IOFireWireFamily.kext", self.constants.fw_kext, self.constants.fw_family_path) @@ -529,7 +500,8 @@ class BuildOpenCore: "class-code": binascii.unhexlify("FFFFFFFF"), } elif self.model == "iMac10,1": - self.enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path) + if self.get_kext_by_bundle_path("AAAMouSSE.kext")["Enabled"] is False: + self.enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path) # Check GPU Vendor if self.constants.metal_build is True: @@ -736,7 +708,7 @@ class BuildOpenCore: spoofed_model = self.model if self.constants.override_smbios == "Default": print("- Setting macOS Monterey Supported SMBIOS") - spoofed_model = self.smbios_set(self.model) + spoofed_model = generate_smbios.set_smbios_model_spoof(self.model) else: spoofed_model = self.constants.override_smbios print(f"- Using Model ID: {spoofed_model}") @@ -983,7 +955,8 @@ class BuildOpenCore: def build_opencore(self): self.build_efi() - self.set_smbios() + if self.constants.allow_oc_everywhere is False: + self.set_smbios() self.cleanup() self.sign_files() print("") diff --git a/Resources/Constants.py b/Resources/Constants.py index 7c113e6b3..69cb58055 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -75,7 +75,7 @@ class Constants: self.payload_path = self.current_path / Path("payloads") # Patcher Settings - self.allow_oc_everywhere = False # Set whether Patcher can be run on unsupported Macs + self.allow_oc_everywhere = True # Set whether Patcher can be run on unsupported Macs self.gui_mode = False # Determine whether running in a GUI or TUI self.disk = "" # Set installation ESP self.patch_disk = "" # Set Root Volume to patch diff --git a/Resources/ModelArray.py b/Resources/ModelArray.py index 78ab84b9d..e1265cf11 100644 --- a/Resources/ModelArray.py +++ b/Resources/ModelArray.py @@ -340,91 +340,6 @@ IntelNvidiaDRM = [ IDEPatch = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "MacPro3,1", "Xserve2,1", "Dortania1,1"] -# 11" Air -MacBookAir_11 = [ - "MacBookAir3,1", - "MacBookAir4,1", - "MacBookAir5,1", - "MacBookAir6,1", -] - -# Classic MacBook and 13" Air -MacBookAir_13 = [ - "MacBook4,1", - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBookAir2,1", - "MacBookAir3,2", - "MacBookAir4,2", - "MacBookAir5,2", - "MacBookAir6,2", -] - -# Retina MacBook -MacBook_12 = [ - "MacBook8,1", -] - -# MacBook Pro 13" - -MacBookPro_13 = [ - "MacBookPro5,5", - "MacBookPro7,1", - "MacBookPro8,1", - "MacBookPro9,2", - "MacBookPro10,2", - "MacBookPro11,1", -] - -# MacBook Pro 15" (iGPU) - -MacBookPro_15_iGPU = ["MacBookPro11,2"] - -# MacBook Pro 15" and 17" (dGPU) - -MacBookPro_15_dGPU = [ - "MacBookPro4,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro6,1", - "MacBookPro6,2", - "MacBookPro8,2", - "MacBookPro8,3", - "MacBookPro9,1", - "MacBookPro10,1", - "MacBookPro11,3", -] - -# Mac Mini - -Macmini = ["Macmini3,1", "Macmini4,1", "Macmini5,1", "Macmini5,2", "Macmini5,3", "Macmini6,1", "Macmini6,2"] -# iMacPro = dGPU only iMacs -iMac_iGPUless = [ - "iMac7,1", - "iMac8,1", - "iMac9,1", - "iMac10,1", - "iMac11,1", - "iMac11,2", - "iMac11,3", - "iMac12,1", - "iMac12,2", -] - -# iMac = AMD and Nvidia GPU with iGPU -iMac_dGPU = [ - "iMac13,2", - "iMac14,2", - "iMac14,3", - "iMac15,1", -] -# iMac = Intel iGPU -iMac_iGPU = ["iMac13,1", "iMac13,3", "iMac14,1", "iMac14,4"] - # Mac Pro and Xserve MacPro = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"] diff --git a/Resources/generate_smbios.py b/Resources/generate_smbios.py new file mode 100644 index 000000000..78c5b7bbe --- /dev/null +++ b/Resources/generate_smbios.py @@ -0,0 +1,53 @@ +from Data import smbios_data, os_data + +def set_smbios_model_spoof(model): + try: + smbios_data.smbios_dictionary[model]["Screen Size"] + # Found mobile SMBIOS + if model.startswith("MacBookAir"): + if smbios_data.smbios_dictionary[model]["Screen Size"] == 13: + return "MacBookAir7,2" + elif smbios_data.smbios_dictionary[model]["Screen Size"] == 11: + return "MacBookAir7,1" + else: + # Unknown Model + raise Exception + elif model.startswith("MacBookPro"): + if smbios_data.smbios_dictionary[model]["Screen Size"] == 13: + return "MacBookPro12,1" + elif smbios_data.smbios_dictionary[model]["Screen Size"] >= 15: + # 15" and 17" + try: + smbios_data.smbios_dictionary[model]["Switchable GPUs"] + return "MacBookPro11,5" + except KeyError: + return "MacBookPro11,4" + else: + # Unknown Model + raise Exception + elif model.startswith("MacBook"): + if smbios_data.smbios_dictionary[model]["Screen Size"] == 13: + return "MacBookAir7,2" + elif smbios_data.smbios_dictionary[model]["Screen Size"] == 12: + return "MacBook9,1" + else: + # Unknown Model + raise Exception + else: + # Unknown Model + raise Exception + except KeyError: + # Found desktop model + if model.startswith("MacPro") or model.startswith("Xserve"): + return "MacPro7,1" + elif model.startswith("Macmini"): + return "Macmini7,1" + elif model.startswith("iMac"): + if smbios_data.smbios_dictionary[model]["Max OS Supported"] <= os_data.os_data.high_sierra: + # Models dropped in Mojave either do not have an iGPU, or should have them disabled + return "iMacPro1,1" + else: + return "iMac17,1" + else: + # Unknown Model + raise Exception \ No newline at end of file From fe359f7ea6e189d895e27dba64e8f5410ae34e1f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 09:58:31 -0600 Subject: [PATCH 04/30] Move FirmwareFeature generation --- Resources/Build.py | 20 ++------------------ Resources/Constants.py | 2 +- Resources/Utilities.py | 34 ---------------------------------- Resources/generate_smbios.py | 24 +++++++++++++++++++++++- 4 files changed, 26 insertions(+), 54 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index a07c36799..24dc63dfe 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -32,23 +32,6 @@ class BuildOpenCore: self.computer = self.constants.computer self.gfx0_path = None - 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/tree/2f76673546ac3e32d2e2d528095fddcd66ad6a23/Include/Apple/IndustryStandard/AppleFeatures.h - if not self.constants.custom_model: - firmwarefeature = Utilities.get_rom("firmware-features") - if not firmwarefeature: - print("- Failed to find FirmwareFeatures, falling back on defaults") - firmwarefeature = int(smbios_data.smbios_dictionary[self.model]["FirmwareFeatures"], 16) - else: - firmwarefeature = int(smbios_data.smbios_dictionary[self.model]["FirmwareFeatures"], 16) - firmwarefeature = Utilities.enable_apfs(firmwarefeature) - firmwarefeature = Utilities.enable_apfs_extended(firmwarefeature) - firmwarefeature = Utilities.enable_large_basesystem(firmwarefeature) - return firmwarefeature - def disk_type(self): drive_host_info = plistlib.loads(subprocess.run(f"diskutil info -plist {self.constants.disk}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) sd_type = drive_host_info["MediaName"] @@ -725,7 +708,8 @@ class BuildOpenCore: # Setup menu def minimal_serial_patch(self): # Generate Firmware Features - fw_feature = self.patch_firmware_feature() + fw_feature = generate_smbios.generate_fw_features(self.model, self.constants.custom_model) + # fw_feature = self.patch_firmware_feature() fw_feature = hex(fw_feature).lstrip("0x").rstrip("L").strip() print(f"- Setting Firmware Feature: {fw_feature}") fw_feature = Utilities.string_to_hex(fw_feature) diff --git a/Resources/Constants.py b/Resources/Constants.py index 69cb58055..7c113e6b3 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -75,7 +75,7 @@ class Constants: self.payload_path = self.current_path / Path("payloads") # Patcher Settings - self.allow_oc_everywhere = True # Set whether Patcher can be run on unsupported Macs + self.allow_oc_everywhere = False # Set whether Patcher can be run on unsupported Macs self.gui_mode = False # Determine whether running in a GUI or TUI self.disk = "" # Set installation ESP self.patch_disk = "" # Set Root Volume to patch diff --git a/Resources/Utilities.py b/Resources/Utilities.py index 718861fe0..2e02c23d0 100644 --- a/Resources/Utilities.py +++ b/Resources/Utilities.py @@ -92,30 +92,6 @@ def check_seal(): return False -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 = "1" - boot_args = get_nvram("boot-args", decode=False) - # boot_args = "latebloom=200 lb_range=40 lb_debug=0 keepsyms=1 debug=0x100 -lilubetaall" - if boot_args: - # TODO: This crashes if latebloom=xxx is the very first entry in boot-args - if "latebloom=" in boot_args: - lb_delay = re.search(r"(?:[, ])latebloom=(\d+)", boot_args) - lb_delay = lb_delay[1] - if "lb_range=" in boot_args: - lb_range = re.search(r"(?:[, ])lb_range=(\d+)", boot_args) - lb_range = lb_range[1] - if "lb_debug=" in boot_args: - lb_debug = re.search(r"(?:[, ])lb_debug=(\d+)", boot_args) - lb_debug = lb_debug[1] - return int(lb_delay), 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" @@ -323,17 +299,7 @@ def download_file(link, location): return checksum -def enable_apfs(fw_feature): - fw_feature |= 2 ** 19 # Enable FW_FEATURE_SUPPORTS_APFS - return fw_feature -def enable_apfs_extended(fw_feature): - fw_feature |= 2 ** 20 # Enable FW_FEATURE_SUPPORTS_APFS_EXTRA - return fw_feature - -def enable_large_basesystem(fw_feature): - fw_feature |= 2 ** 35 # Enable FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM - return fw_feature # def menu(title, prompt, menu_options, add_quit=True, auto_number=False, in_between=[], top_level=False): diff --git a/Resources/generate_smbios.py b/Resources/generate_smbios.py index 78c5b7bbe..5a8732b14 100644 --- a/Resources/generate_smbios.py +++ b/Resources/generate_smbios.py @@ -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 \ No newline at end of file + 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 \ No newline at end of file From 3a28ba699f1d6532c3c8fb1c22be879d36af0e74 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 10:16:30 -0600 Subject: [PATCH 05/30] Allow iGPU always on iMac13,x --- Resources/Build.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index 24dc63dfe..51f47d74b 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -374,19 +374,6 @@ class BuildOpenCore: else: self.config["DeviceProperties"]["Add"][self.gfx0_path] = {"agdpmod": "vit9696"} - if self.model in ["iMac13,1", "iMac13,2", "iMac13,3"]: - if not self.constants.custom_model and self.computer.dgpu: - if self.constants.allow_ivy_igpu is False: - print("- Disabling iGPU to fix sleep support in macOS 12") - self.config["DeviceProperties"]["Add"][self.gfx0_path] = {"agdpmod": "vit9696", "shikigva": 256} - self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = { - "name": binascii.unhexlify("23646973706C6179"), - "IOName": "#display", - "class-code": binascii.unhexlify("FFFFFFFF"), - } - else: - print("- Enabling iGPU upon request") - # Audio Patch if self.model in ModelArray.LegacyAudio: print("- Adding audio properties") From 2e613600de1c5f0cf590340d0d15f62d1ce197ce Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 10:22:12 -0600 Subject: [PATCH 06/30] Sync changelog --- CHANGELOG.md | 4 ++++ Resources/Build.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03f349827..52067cc12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,10 @@ - Limit MacBookPro6,2 G State - Works around crashing when switching GPUs - Fix OTA updates on T2 SMBIOS +- Allow iMac13,x iGPU usage always + - Due to both Kepler and Ivy needing root patching, no benefit to disable the iGPU +- Refactor Hardware Model building +- Resolve dGPU output on MacBookPro10,1 ## 0.2.5 diff --git a/Resources/Build.py b/Resources/Build.py index 51f47d74b..62ff20957 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -335,6 +335,9 @@ class BuildOpenCore: Path(self.constants.amc_contents_folder).mkdir() shutil.copy(amc_map_path, self.constants.amc_contents_folder) self.get_kext_by_bundle_path("AMC-Override.kext")["Enabled"] = True + elif self.model == "MacBookPro10,1": + self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696"} + if self.model not in ModelArray.NoAGPMSupport: print("- Adding AppleGraphicsPowerManagement Override") From 9f4ac80083da216dd379acae6a405c920293e4a0 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 12:28:28 -0600 Subject: [PATCH 07/30] Update SMBIOS data Include Ethernet and Chipset information --- Data/smbios_data.py | 138 +++++++++++++++++++++++++++++++++- OpenCore-Patcher.command | 4 +- Resources/Build.py | 103 ++++++++++++++++--------- Resources/ModelArray.py | 157 +-------------------------------------- 4 files changed, 208 insertions(+), 194 deletions(-) diff --git a/Data/smbios_data.py b/Data/smbios_data.py index ae051de50..5b212f1aa 100644 --- a/Data/smbios_data.py +++ b/Data/smbios_data.py @@ -14,7 +14,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, "UGA Graphics": True, - + "Ethernet Chipset": "Marvell", }, "MacBook2,1": { @@ -27,6 +27,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBook3,1": { @@ -39,6 +40,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 13, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBook4,1": { @@ -51,6 +53,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, @@ -63,6 +66,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -75,6 +80,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -87,6 +94,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -99,6 +108,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -111,6 +122,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, + "Ethernet Chipset": None, }, "MacBook9,1": { @@ -122,6 +134,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, + "Ethernet Chipset": None, }, "MacBook10,1": { @@ -133,6 +146,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, + "Ethernet Chipset": None, }, @@ -145,6 +159,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookAir2,1": { @@ -156,6 +171,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "nForce Chipset": True, + "Ethernet Chipset": None, }, @@ -168,6 +185,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 11, + "nForce Chipset": True, + "Ethernet Chipset": None, }, @@ -180,6 +199,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "nForce Chipset": True, + "Ethernet Chipset": None, }, @@ -192,6 +213,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 11, + "Ethernet Chipset": "Broadcom", # Set for Apple Thunderbolt Adapter }, @@ -204,6 +226,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, + "Ethernet Chipset": "Broadcom", # Set for Apple Thunderbolt Adapter }, @@ -216,6 +239,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 11, + "Ethernet Chipset": None, }, @@ -228,6 +252,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, + "Ethernet Chipset": None, }, @@ -240,6 +265,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 11, + "Ethernet Chipset": None, }, @@ -252,6 +278,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookAir7,1": { @@ -263,6 +290,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 11, + "Ethernet Chipset": None, }, "MacBookAir7,2": { @@ -274,6 +302,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookAir8,1": { @@ -285,6 +314,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookAir8,2": { @@ -296,6 +326,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookAir9,1": { @@ -307,6 +338,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro1,1": { @@ -319,6 +351,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 15, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBookPro1,2": { @@ -331,6 +364,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 17, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBookPro2,1": { @@ -343,6 +377,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 17, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBookPro2,2": { @@ -355,6 +390,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 15, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBookPro3,1": { @@ -367,6 +403,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Screen Size": 15, # Shipped with 17 as well "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "MacBookPro4,1": { @@ -380,6 +417,7 @@ smbios_dictionary = { "Screen Size": 15, # Shipped with 17 as well "Switchable GPUs": True, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, @@ -393,6 +431,8 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -406,6 +446,8 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 17, "Switchable GPUs": True, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -419,6 +461,8 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -432,6 +476,8 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -444,6 +490,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -457,6 +505,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 17, "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", }, @@ -470,6 +519,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", }, @@ -482,6 +532,8 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Screen Size": 13, + "Ethernet Chipset": "Broadcom", + "nForce Chipset": True, }, @@ -494,6 +546,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 13, + "Ethernet Chipset": "Broadcom", }, @@ -507,6 +560,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", }, @@ -520,6 +574,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Screen Size": 17, "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", }, @@ -533,6 +588,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", }, @@ -545,6 +601,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, + "Ethernet Chipset": "Broadcom", }, @@ -558,6 +615,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, @@ -570,6 +628,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Screen Size": 13, + "Ethernet Chipset": None, }, @@ -582,6 +641,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, + "Ethernet Chipset": None, }, @@ -594,6 +654,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, + "Ethernet Chipset": None, }, @@ -607,6 +668,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro11,4": { @@ -618,6 +680,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, + "Ethernet Chipset": None, }, "MacBookPro11,5": { @@ -630,6 +693,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro12,1": { @@ -641,6 +705,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro13,1": { @@ -652,6 +717,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro13,2": { @@ -663,6 +729,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro13,3": { @@ -675,6 +742,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro14,1": { @@ -686,6 +754,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro14,2": { @@ -697,6 +766,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro14,3": { @@ -709,6 +779,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro15,1": { @@ -721,6 +792,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro15,2": { @@ -732,6 +804,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro15,3": { @@ -744,6 +817,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro15,4": { @@ -755,6 +829,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro16,1": { @@ -767,6 +842,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "MacBookPro16,2": { @@ -778,6 +854,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro16,3": { @@ -789,6 +866,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, + "Ethernet Chipset": None, }, "MacBookPro16,4": { @@ -801,6 +879,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, "Switchable GPUs": True, + "Ethernet Chipset": None, }, "Macmini1,1": { @@ -811,6 +890,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Ethernet Chipset": "Marvell", }, "Macmini2,1": { @@ -821,6 +901,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, + "Ethernet Chipset": "Marvell", }, "Macmini3,1": { @@ -831,6 +912,8 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -842,6 +925,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Ethernet Chipset": "Broadcom", }, @@ -853,6 +937,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Ethernet Chipset": "Broadcom", }, @@ -864,6 +949,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Ethernet Chipset": "Broadcom", }, @@ -875,6 +961,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, + "Ethernet Chipset": "Broadcom", }, @@ -886,6 +973,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Ethernet Chipset": "Broadcom", }, @@ -897,6 +985,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Ethernet Chipset": "Broadcom", }, "Macmini7,1": { @@ -907,6 +996,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "Macmini8,1": { @@ -917,6 +1007,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "iMac4,1": { @@ -928,6 +1019,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "iMac4,2": { @@ -939,6 +1031,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "iMac5,1": { @@ -950,6 +1043,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "iMac5,2": { @@ -961,6 +1055,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "iMac6,1": { @@ -972,6 +1067,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, "iMac7,1": { @@ -983,6 +1079,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, @@ -995,6 +1092,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "UGA Graphics": True, + "Ethernet Chipset": "Marvell", }, @@ -1006,6 +1104,8 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -1018,6 +1118,8 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, }, @@ -1029,6 +1131,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Broadcom", }, @@ -1040,6 +1143,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Broadcom", }, @@ -1051,6 +1155,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Broadcom", }, @@ -1062,6 +1167,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Broadcom", }, @@ -1073,6 +1179,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Broadcom", }, @@ -1084,6 +1191,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Ethernet Chipset": "Broadcom", }, @@ -1095,6 +1203,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Ethernet Chipset": "Broadcom", }, @@ -1106,6 +1215,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, + "Ethernet Chipset": "Broadcom", }, @@ -1117,6 +1227,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, @@ -1128,6 +1239,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, @@ -1139,6 +1251,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, @@ -1150,6 +1263,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, @@ -1161,6 +1275,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "iMac16,1": { @@ -1171,6 +1286,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "iMac16,2": { @@ -1181,6 +1297,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "iMac17,1": { @@ -1193,6 +1310,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "iMac18,1": { @@ -1203,6 +1321,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + "Ethernet Chipset": "Broadcom", }, "iMac18,2": { @@ -1213,6 +1332,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + "Ethernet Chipset": "Broadcom", }, "iMac18,3": { @@ -1223,6 +1343,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, + "Ethernet Chipset": "Broadcom", }, "iMac19,1": { @@ -1233,6 +1354,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "iMac19,2": { @@ -1243,6 +1365,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "iMac20,1": { @@ -1253,6 +1376,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "iMac20,2": { @@ -1263,6 +1387,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "iMacPro1,1": { @@ -1273,6 +1398,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "MacPro1,1": { @@ -1284,6 +1410,7 @@ smbios_dictionary = { "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, + "Ethernet Chipset": "Intel 80003ES2LAN", }, "MacPro2,1": { @@ -1295,6 +1422,7 @@ smbios_dictionary = { "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, + "Ethernet Chipset": "Intel 80003ES2LAN", }, "MacPro3,1": { @@ -1306,6 +1434,7 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "UGA Graphics": True, + "Ethernet Chipset": "Intel 80003ES2LAN", }, @@ -1317,6 +1446,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Intel 82574L", }, @@ -1328,6 +1458,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.mojave, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, + "Ethernet Chipset": "Intel 82574L", }, "MacPro6,1": { @@ -1338,6 +1469,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, + "Ethernet Chipset": "Broadcom", }, "MacPro7,1": { @@ -1348,6 +1480,7 @@ smbios_dictionary = { "Max OS Supported": None, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, + "Ethernet Chipset": "Broadcom", }, "Xserve1,1": { @@ -1359,6 +1492,7 @@ smbios_dictionary = { "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "UGA Graphics": True, + "Ethernet Chipset": "Intel 80003ES2LAN", }, "Xserve2,1": { @@ -1370,6 +1504,7 @@ smbios_dictionary = { "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "UGA Graphics": True, + "Ethernet Chipset": "Intel 80003ES2LAN", }, "Xserve3,1": { @@ -1380,6 +1515,7 @@ smbios_dictionary = { "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + "Ethernet Chipset": "Intel 82574L", }, } diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index a27fe900c..626766007 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -8,7 +8,7 @@ import subprocess import sys from Resources import Build, CliMenu, Constants, ModelArray, SysPatch, Utilities, device_probe - +from Data import smbios_data, cpu_data class OpenCoreLegacyPatcher: def __init__(self): @@ -166,7 +166,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [ [f"Set SurPlus Settings:\tCurrently {self.constants.force_surplus}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_surplus] ] - if ((self.constants.custom_model or self.computer.real_model) in ModelArray.PCIRaceCondition) + if (smbios_data.smbios_dictionary[self.constants.custom_model or self.computer.real_model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge) else [] ) diff --git a/Resources/Build.py b/Resources/Build.py index 62ff20957..a04f0ea4f 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -15,7 +15,7 @@ from pathlib import Path from datetime import date from Resources import Constants, ModelArray, Utilities, device_probe, generate_smbios -from Data import smbios_data, bluetooth_data, cpu_data +from Data import smbios_data, bluetooth_data, cpu_data, os_data def rmtree_handler(func, path, exc_info): @@ -104,7 +104,7 @@ class BuildOpenCore: ("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path, lambda: self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1"]), ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False), # CPU patches - ("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket), + ("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model.startswith("MacPro") or self.model.startswith("Xserve")), ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), ("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), ( @@ -114,9 +114,8 @@ class BuildOpenCore: lambda: self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.allow_oc_everywhere is False and self.constants.disallow_cpufriend is False, ), # Ethernet patches - ("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: self.model in ModelArray.EthernetNvidia), - ("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: self.model in ModelArray.EthernetMarvell), - ("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path, lambda: self.model in ModelArray.EthernetBroadcom), + ("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvel"), + ("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia"), # Legacy audio ("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: (self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro) and self.constants.set_alc_usage is True), # IDE patch @@ -131,6 +130,13 @@ class BuildOpenCore: if self.constants.allow_oc_everywhere is False: self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True + # Ethernet Patch Sets + if smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Broadcom": + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge: + # Required due to Big Sur's BCM5701 requiring VT-x support + # Applicable for pre-Ivy Bridge models + self.enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path) + if self.constants.allow_oc_everywhere is False: if (smbios_data.smbios_dictionary[generate_smbios.set_smbios_model_spoof(self.model) or self.constants.override_smbios]["SecureBootModel"]) != None: # Monterey T2 SMBIOS don't get OS updates without a T2 SBM @@ -196,19 +202,21 @@ class BuildOpenCore: arpt_path = self.computer.wifi.pci_path print(f"- Found ARPT device at {arpt_path}") else: - if self.model in ModelArray.nvidiaHDEF: + try: + smbios_data.smbios_dictionary[self.model]["nForce Chipset"] # Nvidia chipsets all have the same path to ARPT arpt_path = "PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)" - elif self.model in ("iMac7,1", "iMac8,1", "MacPro3,1", "MacBookPro4,1"): - arpt_path = "PciRoot(0x0)/Pci(0x1C,0x4)/Pci(0x0,0x0)" - elif self.model in ("iMac13,1", "iMac13,2"): - arpt_path = "PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0)" - elif self.model in ("MacPro4,1", "MacPro5,1"): - arpt_path = "PciRoot(0x0)/Pci(0x1C,0x5)/Pci(0x0,0x0)" - else: - # Assumes we have a laptop with Intel chipset - # iMac11,x-12,x also apply - arpt_path = "PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)" + except KeyError: + if self.model in ("iMac7,1", "iMac8,1", "MacPro3,1", "MacBookPro4,1"): + arpt_path = "PciRoot(0x0)/Pci(0x1C,0x4)/Pci(0x0,0x0)" + elif self.model in ("iMac13,1", "iMac13,2"): + arpt_path = "PciRoot(0x0)/Pci(0x1C,0x3)/Pci(0x0,0x0)" + elif self.model in ("MacPro4,1", "MacPro5,1"): + arpt_path = "PciRoot(0x0)/Pci(0x1C,0x5)/Pci(0x0,0x0)" + else: + # Assumes we have a laptop with Intel chipset + # iMac11,x-12,x also apply + arpt_path = "PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)" print(f"- Using known DevicePath {arpt_path}") # self.config["DeviceProperties"]["Add"][arpt_path] = {"device-id": binascii.unhexlify("ba430000"), "compatible": "pci14e4,43ba"} if not self.constants.custom_model and self.computer.wifi and self.constants.validate is False and self.computer.wifi.country_code: @@ -338,7 +346,6 @@ class BuildOpenCore: elif self.model == "MacBookPro10,1": self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696"} - if self.model not in ModelArray.NoAGPMSupport: print("- Adding AppleGraphicsPowerManagement Override") agpm_map_path = Path(self.constants.plist_folder_path) / Path("AppleGraphicsPowerManagement/Info.plist") @@ -378,26 +385,50 @@ class BuildOpenCore: self.config["DeviceProperties"]["Add"][self.gfx0_path] = {"agdpmod": "vit9696"} # Audio Patch - if self.model in ModelArray.LegacyAudio: - print("- Adding audio properties") - hdef_path = "PciRoot(0x0)/Pci(0x8,0x0)" if self.model in ModelArray.nvidiaHDEF else "PciRoot(0x0)/Pci(0x1b,0x0)" - # In AppleALC, MacPro3,1's original layout is already in use, forcing layout 13 instead - if self.model == "MacPro3,1": - self.config["DeviceProperties"]["Add"][hdef_path] = { - "apple-layout-id": 90, - "use-apple-layout-id": 1, - "alc-layout-id": 13, - } - else: - self.config["DeviceProperties"]["Add"][hdef_path] = { - "apple-layout-id": 90, - "use-apple-layout-id": 1, - "use-layout-id": 1, - } + if self.constants.set_alc_usage is True: + if smbios_data.smbios_dictionary[self.model]["Max OS Supported"] <= os_data.os_data.high_sierra: + # Models dropped in Mojave also lost Audio support + # Xserves and MacPro4,1 are exceptions + # iMac7,1 and iMac8,1 require AppleHDA/IOAudioFamily downgrade + if not (self.model.startswith("Xserve") or self.model == "MacPro4,1"): + try: + smbios_data.smbios_dictionary[self.model]["nForce Chipset"] + hdef_path = "PciRoot(0x0)/Pci(0x8,0x0)" + except KeyError: + hdef_path = "PciRoot(0x0)/Pci(0x1b,0x0)" + # In AppleALC, MacPro3,1's original layout is already in use, forcing layout 13 instead + if self.model == "MacPro3,1": + self.config["DeviceProperties"]["Add"][hdef_path] = { + "apple-layout-id": 90, + "use-apple-layout-id": 1, + "alc-layout-id": 13, + } + else: + self.config["DeviceProperties"]["Add"][hdef_path] = { + "apple-layout-id": 90, + "use-apple-layout-id": 1, + "use-layout-id": 1, + } + self.enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) + elif self.model.startswith("MacPro") or self.model.startswith("Xserve"): + # Used to enable Audio support for non-standard dGPUs + self.enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) - # Enable FireWire Boot Support - # Applicable for both native FireWire and Thunderbolt to FireWire adapters - if self.constants.firewire_boot is True and self.model not in ModelArray.NoFireWireSupport: + + def check_firewire(model): + # MacBooks never supported FireWire + # Pre-Thunderbolt MacBook Airs as well + if model.startswith("MacBook"): + return False + elif model.startswith("MacBookAir"): + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge: + return False + else: + return True + + if self.constants.firewire_boot is True and check_firewire() is True: + # Enable FireWire Boot Support + # Applicable for both native FireWire and Thunderbolt to FireWire adapters print("- Enabling FireWire Boot Support") self.enable_kext("IOFireWireFamily.kext", self.constants.fw_kext, self.constants.fw_family_path) self.enable_kext("IOFireWireSBP2.kext", self.constants.fw_kext, self.constants.fw_sbp2_path) diff --git a/Resources/ModelArray.py b/Resources/ModelArray.py index e1265cf11..f668a7ce3 100644 --- a/Resources/ModelArray.py +++ b/Resources/ModelArray.py @@ -73,49 +73,6 @@ SupportedSMBIOS = [ "Xserve3,1", ] -# CPU patches - -DualSocket = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"] - -# Ethernet patches - -EthernetNvidia = [ - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "Macmini3,1", - "iMac9,1", - "iMac10,1", - "Dortania1,1", -] -EthernetMarvell = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "Dortania1,1"] -EthernetBroadcom = [ - "MacBookAir4,1", - "MacBookAir4,2", - "MacBookPro6,1", - "MacBookPro6,2", - "MacBookPro7,1", - "MacBookPro8,1", - "MacBookPro8,2", - "MacBookPro8,3", - "Macmini4,1", - "Macmini5,1", - "Macmini5,2", - "Macmini5,3", - "iMac11,1", - "iMac11,2", - "iMac11,3", - "iMac12,1", - "iMac12,2", - "Dortania1,1", -] - # Audio LegacyAudio = [ @@ -159,26 +116,6 @@ LegacyAudio = [ "Dortania1,1", ] -nvidiaHDEF = [ - "MacBook5,1", - "MacBook5,2", - "MacBook6,1", - "MacBook7,1", - "MacBookAir2,1", - "MacBookAir3,1", - "MacBookAir3,2", - "MacBookPro5,1", - "MacBookPro5,2", - "MacBookPro5,3", - "MacBookPro5,4", - "MacBookPro5,5", - "MacBookPro7,1", - "Macmini3,1", - "Macmini4,1", - "iMac9,1", - "iMac10,1", -] - # GPU ModernGPU = [ @@ -414,96 +351,6 @@ AGDPSupport = [ # "MacPro6,1", ] -NoFireWireSupport = [ - "MacBook5,1", - "MacBook6,1", - "MacBook7,1", - "MacBookAir1,1", - "MacBookAir2,1", - "MacBookAir3,1", - "MacBookAir3,2", -] - -# Thunderbolt 1 Macs -Thunderbolt_1 = [ - "MacBookAir4,1", - "MacBookAir4,2", - "MacBookAir5,1", - "MacBookAir5,2", - "MacBookAir6,1", - "MacBookAir6,2", - "MacBookPro8,1", - "MacBookPro8,2", - "MacBookPro8,3", - "MacBookPro9,1", - "MacBookPro9,2", - "MacBookPro10,1", - "MacBookPro10,2", - "Macmini5,1", - "Macmini5,2", - "Macmini5,3", - "Macmini6,1", - "Macmini6,2", - "iMac12,1", - "iMac12,2", - "iMac13,1", - "iMac13,2", - "iMac13,3", - "iMac14,1", - "iMac14,2", - "iMac14,3", - "iMac14,4", - "Dortania1,1", -] - -# Thunderbolt 2 Macs -Thunderbolt_2 = [ - "MacBookAir7,1", - "MacBookAir7,2", - "MacBookPro11,1", - "MacBookPro11,2", - "MacBookPro11,3", - "MacBookPro11,4", - "MacBookPro11,5", - "MacBookPro12,1", - "Macmini7,1", - "iMac15,1", - "iMac16,1", - "iMac17,1", - "iMac16,2", - "MacPro6,1", -] - -# Thunderbolt 3 Macs -Thunderbolt_3 = [ - "MacBookAir8,1", - "MacBookAir8,2", - "MacBookAir9,1", - "MacBookPro13,1", - "MacBookPro13,2", - "MacBookPro13,3", - "MacBookPro14,1", - "MacBookPro14,2", - "MacBookPro14,3", - "MacBookPro15,1", - "MacBookPro15,2", - "MacBookPro15,3", - "MacBookPro15,4", - "MacBookPro16,1", - "MacBookPro16,2", - "MacBookPro16,3", - "MacBookPro16,4", - "Macmini8,1", - "iMac18,1", - "iMac18,2", - "iMac18,3", - "iMac19,1", - "iMac19,2", - "iMac20,1", - "iMac20,2", - "MacPro7,1", -] - Missing_USB_Map = [ "MacBook4,1", "MacBook5,1", @@ -543,6 +390,6 @@ Missing_USB_Map = [ "iMac12,2", "MacPro3,1", "MacPro4,1", - "XServe2,1", - "XServe3,1", + "Xserve2,1", + "Xserve3,1", ] \ No newline at end of file From 426c572ce2f051fd6c79652567ba2cf22ea45e45 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Oct 2021 18:00:53 -0600 Subject: [PATCH 08/30] Fix AppleALC building --- Resources/Build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index a04f0ea4f..b141d828c 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -114,8 +114,8 @@ class BuildOpenCore: lambda: self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.allow_oc_everywhere is False and self.constants.disallow_cpufriend is False, ), # Ethernet patches - ("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvel"), - ("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia"), + ("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia"), + ("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvell"), # Legacy audio ("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: (self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro) and self.constants.set_alc_usage is True), # IDE patch @@ -390,8 +390,8 @@ class BuildOpenCore: # Models dropped in Mojave also lost Audio support # Xserves and MacPro4,1 are exceptions # iMac7,1 and iMac8,1 require AppleHDA/IOAudioFamily downgrade - if not (self.model.startswith("Xserve") or self.model == "MacPro4,1"): - try: + if not (self.model.startswith("Xserve") or self.model in ["MacPro4,1", "iMac7,1", "iMac8,1"]): + try: smbios_data.smbios_dictionary[self.model]["nForce Chipset"] hdef_path = "PciRoot(0x0)/Pci(0x8,0x0)" except KeyError: From a5f489d48b7b657619ade353de125339f53e7669 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 10:44:13 -0600 Subject: [PATCH 09/30] Depreciate dedicated OCLP-CLI binary OpenCore-Patcher now supports both CLI and TUI mode --- .github/workflows/build-app.yml | 1 - .github/workflows/build-gui.yml | 9 +- Data/os_data.py | 3 +- Data/smbios_data.py | 78 ++++---- OCLP-CLI.command | 313 -------------------------------- OCLP-CLI.spec | 35 ---- OpenCore-Patcher.command | 247 +++---------------------- Resources/Build.py | 5 +- Resources/CliMenu.py | 162 ++++++++++++++++- Resources/Constants.py | 2 +- Resources/arguments.py | 195 ++++++++++++++++++++ Resources/defaults.py | 74 ++++++++ Resources/mount_root.py | 19 ++ Resources/os_probe.py | 19 ++ 14 files changed, 543 insertions(+), 619 deletions(-) delete mode 100755 OCLP-CLI.command delete mode 100644 OCLP-CLI.spec create mode 100644 Resources/arguments.py create mode 100644 Resources/defaults.py create mode 100644 Resources/mount_root.py create mode 100644 Resources/os_probe.py diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 1ceb3268c..d8d4f83e8 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -12,7 +12,6 @@ jobs: runs-on: x86_64_mojave steps: - uses: actions/checkout@v2 - - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index aeeeaa928..ec48c357d 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -13,11 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OCLP-CLI.spec - - run: cd dist; cp OCLP-CLI ../; cd .. - - run: zip OCLP-CLI.zip OCLP-CLI + - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec + - run: cd dist; cp OpenCore-Patcher ../; cd ..; mv OpenCore-Patcher OCLP-CLI - name: Download latest nightly OCLP-GUI - run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip + run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip --insecure - run: unzip -o OpenCore-Patcher-GUI.app.zip - run: unzip OpenCore-Patcher-GUI.app.zip; rm OpenCore-Patcher-GUI.app.zip - name: Merge new GUI @@ -37,7 +36,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: OCLP-CLI - path: OCLP-CLI.zip + path: OCLP-CLI - name: Upload to Release if: github.event_name == 'release' uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d diff --git a/Data/os_data.py b/Data/os_data.py index 19ce05dce..3b8405f40 100644 --- a/Data/os_data.py +++ b/Data/os_data.py @@ -13,4 +13,5 @@ class os_data: mojave = 18 catalina = 19 big_sur = 20 - monterey = 21 \ No newline at end of file + monterey = 21 + max_os = 99 \ No newline at end of file diff --git a/Data/smbios_data.py b/Data/smbios_data.py index 5b212f1aa..ffa881d68 100644 --- a/Data/smbios_data.py +++ b/Data/smbios_data.py @@ -130,7 +130,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, @@ -142,7 +142,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, @@ -286,7 +286,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 11, @@ -298,7 +298,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -310,7 +310,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF42E", "SecureBootModel": "j140kap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -322,7 +322,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF42E", "SecureBootModel": "j140aap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -334,7 +334,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFFAFF06E", "SecureBootModel": "j230kap", "CPU Generation": cpu_data.cpu_data.ice_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -676,7 +676,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -688,7 +688,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 15, @@ -701,7 +701,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Screen Size": 13, @@ -713,7 +713,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, @@ -725,7 +725,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, @@ -737,7 +737,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, @@ -750,7 +750,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, @@ -762,7 +762,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 13, @@ -774,7 +774,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 15, @@ -787,7 +787,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j680ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, @@ -800,7 +800,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j132ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -812,7 +812,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j780ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 15, @@ -825,7 +825,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF426", "SecureBootModel": "j213ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -837,7 +837,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j152fap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, @@ -850,7 +850,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFFAFF06E", "SecureBootModel": "j214kap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -862,7 +862,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j223ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 13, @@ -874,7 +874,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j215ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Screen Size": 16, @@ -993,7 +993,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.haswell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", @@ -1004,7 +1004,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF466", "SecureBootModel": "j174ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1283,7 +1283,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", @@ -1294,7 +1294,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.broadwell, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", @@ -1307,7 +1307,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", @@ -1318,7 +1318,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", @@ -1329,7 +1329,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", @@ -1340,7 +1340,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.kaby_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", @@ -1351,7 +1351,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1362,7 +1362,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1373,7 +1373,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": "j185ap", "CPU Generation": cpu_data.cpu_data.comet_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1384,7 +1384,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": "j185fap", "CPU Generation": cpu_data.cpu_data.comet_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1395,7 +1395,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFD8FF53E", "SecureBootModel": "j137ap", "CPU Generation": cpu_data.cpu_data.skylake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", @@ -1466,7 +1466,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xE90FF576", "SecureBootModel": None, "CPU Generation": cpu_data.cpu_data.ivy_bridge, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", @@ -1477,7 +1477,7 @@ smbios_dictionary = { "FirmwareFeatures": "0xFDAFF066", "SecureBootModel": "j160ap", "CPU Generation": cpu_data.cpu_data.coffee_lake, - "Max OS Supported": None, + "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", diff --git a/OCLP-CLI.command b/OCLP-CLI.command deleted file mode 100755 index e3f0478bc..000000000 --- a/OCLP-CLI.command +++ /dev/null @@ -1,313 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (C) 2020-2021 Mykola Grymalyuk - -from __future__ import print_function - -import subprocess -import sys -import platform -import argparse -from pathlib import Path - -from Resources import Build, ModelArray, Constants, SysPatch, device_probe, Utilities, ModelExample - - -class OpenCoreLegacyPatcher: - def __init__(self): - print("Loading...") - Utilities.disable_cls() - self.constants = Constants.Constants() - self.constants.computer = device_probe.Computer.probe() - self.computer = self.constants.computer - self.constants.detected_os = int(platform.uname().release.partition(".")[0]) - self.constants.detected_os_minor = int(platform.uname().release.partition(".")[2].partition(".")[0]) - detected_os_build: str = subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() - self.constants.detected_os_build = detected_os_build - - custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) - if custom_cpu_model_value is not None: - # TODO: Fix to not use two separate variables - self.constants.custom_cpu_model = 1 - self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0] - - if "-v" in (Utilities.get_nvram("boot-args") or ""): - self.constants.verbose_debug = True - - # Check if running in RecoveryOS - self.constants.recovery_status = Utilities.check_recovery() - - parser = argparse.ArgumentParser() - - # Generic building args - parser.add_argument("--build", help="Build OpenCore", action="store_true", required=False) - parser.add_argument("--verbose", help="Enable verbose boot", action="store_true", required=False) - parser.add_argument("--debug_oc", help="Enable OpenCore DEBUG", action="store_true", required=False) - parser.add_argument("--debug_kext", help="Enable kext DEBUG", action="store_true", required=False) - parser.add_argument("--hide_picker", help="Hide OpenCore picker", action="store_true", required=False) - parser.add_argument("--disable_sip", help="Disable SIP", action="store_true", required=False) - parser.add_argument("--disable_smb", help="Disable SecureBootModel", action="store_true", required=False) - parser.add_argument("--vault", help="Enable OpenCore Vaulting", action="store_true", required=False) - parser.add_argument("--support_all", help="Allow OpenCore on natively supported Models", action="store_true", required=False) - parser.add_argument("--firewire", help="Enable FireWire Booting", action="store_true", required=False) - parser.add_argument("--nvme", help="Enable NVMe Booting", action="store_true", required=False) - parser.add_argument("--wlan", help="Enable Wake on WLAN support", action="store_true", required=False) - # parser.add_argument("--disable_amfi", help="Disable AMFI", action="store_true", required=False) - parser.add_argument("--moderate_smbios", help="Moderate SMBIOS Patching", action="store_true", required=False) - parser.add_argument("--moj_cat_accel", help="Allow Root Patching on Mojave and Catalina", action="store_true", required=False) - parser.add_argument("--disable_thunderbolt", help="Disable Thunderbolt on 2013-2014 MacBook Pros", action="store_true", required=False) - parser.add_argument("--force_surplus", help="Force SurPlus in all newer OSes", action="store_true", required=False) - - # Building args requiring value values (ie. --model iMac12,2) - parser.add_argument("--model", action="store", help="Set custom model", required=False) - parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False) - parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) - # parser.add_argument("--lb_delay", action="store", help="Set Latebloom delay in ms", required=False) - # parser.add_argument("--lb_range", action="store", help="Set Latebloom range in ms", required=False) - # parser.add_argument("--lb_debug", action="store", help="Set Latebloom debug", required=False) - - # SysPatch args - parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) - parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) - # parser.add_argument("--patch_disk", action="store", help="Specifies disk to root patch", required=False) - - parser.add_argument("--validate", help="Validate", action="store_true", required=False) - - args = parser.parse_args() - - self.constants.gui_mode = True - self.constants.current_path = Path.cwd() - - if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): - print("- Rerouting payloads location") - self.constants.payload_path = sys._MEIPASS / Path("payloads") - else: - print("- Using default payloads location") - - if args.disk: - print(f"- Install Disk set: {args.disk}") - self.constants.disk = args.disk - if args.validate: - self.validate() - # if args.patch_disk: - # print(f"- Patch Disk set: {args.patch_disk}") - # self.constants.patch_disk = args.patch_disk - if args.verbose: - print("- Set verbose configuration") - self.constants.verbose_debug = True - if args.debug_oc: - print("- Set OpenCore DEBUG configuration") - self.constants.opencore_debug = True - self.constants.opencore_build = "DEBUG" - if args.debug_kext: - print("- Set kext DEBUG configuration") - self.constants.kext_debug = True - if args.hide_picker: - print("- Set HidePicker configuration") - self.constants.showpicker = False - if args.disable_sip: - print("- Set Disable SIP configuration") - self.constants.sip_status = False - if args.disable_smb: - print("- Set Disable SecureBootModel configuration") - self.constants.secure_status = False - if args.vault: - print("- Set Vault configuration") - self.constants.vault = True - if args.firewire: - print("- Set FireWire Boot configuration") - self.constants.firewire_boot = True - if args.nvme: - print("- Set NVMe Boot configuration") - self.constants.nvme_boot = True - # if args.disable_amfi: - # print("- Set Disable AMFI configuration") - # self.constants.amfi_status = False - if args.wlan: - print("- Set Wake on WLAN configuration") - self.constants.enable_wake_on_wlan = True - if args.disable_thunderbolt: - print("- Set Disable Thunderbolt configuration") - self.constants.disable_thunderbolt = True - if args.force_surplus: - print("- Forcing SurPlus override configuration") - self.constants.force_surplus = True - if args.moderate_smbios: - print("- Set Moderate SMBIOS Patching configuration") - self.constants.serial_settings = "Moderate" - if args.smbios_spoof: - if args.smbios_spoof == "Minimal": - self.constants.serial_settings = "Minimal" - elif args.smbios_spoof == "Moderate": - self.constants.serial_settings = "Moderate" - elif args.smbios_spoof == "Advanced": - self.constants.serial_settings = "Advanced" - else: - print(f"- Unknown SMBIOS arg passed: {args.smbios_spoof}") - - # if args.lb_delay: - # try: - # self.constants.latebloom_delay = int(args.lb_delay) - # print(f"- Set LateBloom delay: {args.lb_delay}") - # except ValueError: - # print(f"- Invalid LateBloom delay: {args.lb_delay}") - - # if args.lb_range: - # try: - # self.constants.latebloom_range = int(args.lb_range) - # print(f"- Set LateBloom range: {args.lb_range}") - # except ValueError: - # print(f"- Invalid LateBloom range: {args.lb_range}") - - # if args.lb_debug: - # try: - # self.constants.latebloom_debug = int(args.lb_debug) - # if self.constants.latebloom_debug in [0, 1]: - # print(f"- Set LateBloom debug: {args.lb_debug}") - # else: - # print(f"- Invalid LateBloom debug: {args.lb_debug}") - # except ValueError: - # print(f"- Invalid LateBloom range: {args.lb_debug}") - - if args.support_all: - print("- Building for natively supported model") - self.constants.allow_oc_everywhere = True - self.constants.serial_settings = "None" - - if args.build: - if args.model: - print(f"- Using custom model: {args.model}") - self.constants.custom_model = args.model - self.set_defaults(self.constants.custom_model, False) - self.build_opencore() - elif self.computer.real_model not in ModelArray.SupportedSMBIOS and self.constants.allow_oc_everywhere is False: - print( - """Your model is not supported by this patcher for running unsupported OSes!" - -If you plan to create the USB for another machine, please select the "Change Model" option in the menu.""" - ) - sys.exit(1) - else: - print(f"- Using detected model: {self.constants.computer.real_model}") - self.set_defaults(self.constants.custom_model, True) - self.build_opencore() - if args.patch_sys_vol: - if args.moj_cat_accel: - print("- Set Mojave/Catalina root patch configuration") - self.constants.moj_cat_accel = True - print("- Set System Volume patching") - self.patch_vol() - elif args.unpatch_sys_vol: - print("- Set System Volume unpatching") - self.unpatch_vol() - - def set_defaults(self, model, host_is_target): - if host_is_target: - if Utilities.check_metal_support(device_probe, self.computer) is False: - self.constants.disable_cs_lv = True - if self.computer.dgpu and self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: - self.constants.sip_status = False - self.constants.amfi_status = True - self.constants.allow_fv_root = True # Allow FileVault on broken seal - if ( - isinstance(self.computer.wifi, device_probe.Broadcom) - and self.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224] - ) or (isinstance(self.computer.wifi, device_probe.Atheros) and self.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): - self.constants.sip_status = False - self.constants.allow_fv_root = True # Allow FileVault on broken seal - elif model in ModelArray.LegacyGPU: - self.constants.disable_cs_lv = True - if model in ModelArray.LegacyGPU: - if host_is_target and Utilities.check_metal_support(device_probe, self.computer) is True: - # Building on device and we have a native, supported GPU - if self.computer.dgpu and self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: - self.constants.sip_status = False - # self.constants.secure_status = True # Monterey - self.constants.amfi_status = True - self.constants.allow_fv_root = True # Allow FileVault on broken seal - else: - self.constants.sip_status = True - # self.constants.secure_status = True # Monterey - self.constants.amfi_status = True - else: - self.constants.sip_status = False # Unsigned kexts - self.constants.secure_status = False # Root volume modified - self.constants.amfi_status = False # Unsigned binaries - self.constants.allow_fv_root = True # Allow FileVault on broken seal - if model in ModelArray.ModernGPU: - self.constants.sip_status = False # Unsigned kexts - self.constants.secure_status = False # Modified root volume - self.constants.allow_fv_root = True # Allow FileVault on broken seal - # self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently - if model == "MacBook8,1": - # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing - self.constants.serial_settings == "Moderate" - - # if self.constants.latebloom_delay == 0: - # self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model) - - if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9", decode=True): - self.constants.allow_ts2_accel = False - - def patch_vol(self): - SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch() - - def unpatch_vol(self): - SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_unpatch() - - def build_opencore(self): - Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore() - - def install_opencore(self): - Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi() - - def validate(self): - # Runs through ocvalidate to check for errors - - valid_dumps = [ - ModelExample.MacBookPro.MacBookPro92_Stock, - # ModelExample.MacBookPro.MacBookPro171_Stock, - # ModelExample.Macmini.Macmini91_Stock, - ModelExample.iMac.iMac81_Stock, - ModelExample.iMac.iMac112_Stock, - ModelExample.iMac.iMac122_Upgraded, - ModelExample.MacPro.MacPro31_Stock, - ModelExample.MacPro.MacPro31_Upgrade, - ModelExample.MacPro.MacPro31_Modern_AMD, - ModelExample.MacPro.MacPro31_Modern_Kepler, - ModelExample.MacPro.MacPro41_Upgrade, - ModelExample.MacPro.MacPro41_Modern_AMD, - ModelExample.MacPro.MacPro41_51__Flashed_Modern_AMD, - ] - self.constants.validate = True - - for model in ModelArray.SupportedSMBIOS: - print(f"Validating predefined model: {model}") - self.constants.custom_model = model - self.build_opencore() - result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {model}") - else: - print(f"Validation succeeded for predefined model: {model}") - - for model in valid_dumps: - self.constants.computer = model - self.computer = self.constants.computer - self.constants.custom_model = "" - print(f"Validating dumped model: {self.computer.real_model}") - self.build_opencore() - result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {self.computer.real_model}") - else: - print(f"Validation succeeded for predefined model: {self.computer.real_model}") - - -OpenCoreLegacyPatcher() - -# Example arg for OCLP command line -# ./OCLP-CLI --build --verbose --debug_oc --debug_kext --model iMac11,2 diff --git a/OCLP-CLI.spec b/OCLP-CLI.spec deleted file mode 100644 index 54123a204..000000000 --- a/OCLP-CLI.spec +++ /dev/null @@ -1,35 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- -import sys, os -sys.path.append(os.path.abspath(os.getcwd())) -from Resources import Constants -block_cipher = None - - -a = Analysis(['OCLP-CLI.command'], - pathex=['Resources', 'Data'], - binaries=[], - datas=[('payloads', 'payloads')], - hiddenimports=[], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [('u', None, 'OPTION')], - name='OCLP-CLI', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True ) \ No newline at end of file diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 626766007..04eb4021c 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -3,97 +3,39 @@ from __future__ import print_function -import platform import subprocess import sys +from pathlib import Path -from Resources import Build, CliMenu, Constants, ModelArray, SysPatch, Utilities, device_probe +from Resources import Build, CliMenu, Constants, ModelArray, SysPatch, Utilities, device_probe, os_probe, defaults, arguments from Data import smbios_data, cpu_data class OpenCoreLegacyPatcher: def __init__(self): - print("Loading...") + print("- Loading...") self.constants = Constants.Constants() - self.constants.computer = device_probe.Computer.probe() - self.computer = self.constants.computer - self.constants.detected_os = int(platform.uname().release.partition(".")[0]) - self.constants.detected_os_minor = int(platform.uname().release.partition(".")[2].partition(".")[0]) - detected_os_build: str = subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() - self.constants.detected_os_build = detected_os_build - self.set_defaults(self.computer.real_model, True) - - def set_defaults(self, model, host_is_target): - # Defaults - self.constants.sip_status = True - self.constants.secure_status = False # Default false for Monterey - self.constants.amfi_status = True - - if host_is_target: - if Utilities.check_metal_support(device_probe, self.computer) is False: - self.constants.disable_cs_lv = True - if self.computer.dgpu and self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: - self.constants.sip_status = False - self.constants.amfi_status = True - self.constants.allow_fv_root = True # Allow FileVault on broken seal - if ( - isinstance(self.computer.wifi, device_probe.Broadcom) - and self.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224] - ) or (isinstance(self.computer.wifi, device_probe.Atheros) and self.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): - self.constants.sip_status = False - self.constants.allow_fv_root = True # Allow FileVault on broken seal - elif model in ModelArray.LegacyGPU: - self.constants.disable_cs_lv = True - - if model in ModelArray.LegacyGPU: - if host_is_target and Utilities.check_metal_support(device_probe, self.computer) is True: - # Building on device and we have a native, supported GPU - if self.computer.dgpu and self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: - self.constants.sip_status = False - # self.constants.secure_status = True # Monterey - self.constants.allow_fv_root = True # Allow FileVault on broken seal - else: - self.constants.sip_status = True - # self.constants.secure_status = True # Monterey - self.constants.amfi_status = True - else: - self.constants.sip_status = False # Unsigned kexts - self.constants.secure_status = False # Root volume modified - self.constants.amfi_status = False # Unsigned binaries - self.constants.allow_fv_root = True # Allow FileVault on broken seal - if model in ModelArray.ModernGPU: - # Systems with Ivy or Kepler GPUs, Monterey requires root patching for accel - self.constants.sip_status = False # Unsigned kexts - self.constants.secure_status = False # Modified root volume - self.constants.allow_fv_root = True # Allow FileVault on broken seal - # self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently + self.generate_base_data() + if arguments.arguments().check_cli() is False: + self.main_menu() - - if model == "MacBook8,1": - # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing - self.constants.serial_settings = "Moderate" - - custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) - if custom_cpu_model_value is not None: - # TODO: Fix to not use two separate variables - self.constants.custom_cpu_model = 1 - self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0] - - if "-v" in (Utilities.get_nvram("boot-args") or ""): - self.constants.verbose_debug = True - - if Utilities.amfi_status() is False: - self.constants.amfi_status = False - - if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9"): - # Users disabling TS2 most likely have a faulty dGPU - # users can override this in settings - self.constants.allow_ts2_accel = False - - # if self.constants.latebloom_delay == 0: - # self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model) - - # Check if running in RecoveryOS + def generate_base_data(self): + self.constants.detected_os = os_probe.detect_kernel_major() + self.constants.detected_os_minor = os_probe.detect_kernel_minor() + self.constants.detected_os_build = os_probe.detect_kernel_build() + self.constants.computer = device_probe.Computer.probe() self.constants.recovery_status = Utilities.check_recovery() + self.computer = self.constants.computer + defaults.generate_defaults.probe(self.computer.real_model, True, self.constants) + if arguments.arguments().check_cli() is True: + print("- Detected arguments, switching to CLI mode") + self.constants.gui_mode = True # Assumes no user interaction is required + self.constants.current_path = Path.cwd() + if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): + print("- Rerouting payloads location") + self.constants.payload_path = sys._MEIPASS / Path("payloads") + arguments.arguments().parse_arguments(self.constants) + else: + print("- No arguments present, loading TUI") def build_opencore(self): Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore() @@ -101,30 +43,6 @@ class OpenCoreLegacyPatcher: def install_opencore(self): Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi() - def change_model(self): - Utilities.cls() - Utilities.header(["Select Different Model"]) - print( - """ -Tip: Run the following command on the target machine to find the model identifier: - -system_profiler SPHardwareDataType | grep 'Model Identifier' - """ - ) - self.constants.custom_model = input("Please enter the model identifier of the target machine: ").strip() - if self.constants.custom_model not in ModelArray.SupportedSMBIOS: - print( - f""" -{self.constants.custom_model} is not a valid SMBIOS Identifier for macOS {self.constants.os_support}! -""" - ) - print_models = input(f"Print list of valid options for macOS {self.constants.os_support}? (y/n)") - if print_models.lower() in {"y", "yes"}: - print("\n".join(ModelArray.SupportedSMBIOS)) - input("\nPress [ENTER] to continue") - else: - self.set_defaults(self.constants.custom_model, False) - def patcher_settings(self): response = None while not (response and response == -1): @@ -145,7 +63,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_native_models, ], - ["Advanced Settings, for developers only", self.advanced_patcher_settings], + ["Advanced Settings, for developers only", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).advanced_patcher_settings], ] for option in options: @@ -243,8 +161,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [f"Set Ivy iMac iGPU:\t\tCurrently {self.constants.allow_ivy_igpu}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_ivy], [f"Set TeraScale 2 Accel:\tCurrently {self.constants.allow_ts2_accel}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).terascale_2_accel], [ - f"Disable Thunderbolt:\tCurrently {self.constants.disable_thunderbolt}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).disable_thunderbolt, + f"Disable Thunderbolt:\tCurrently {self.constants.disable_tb}", + CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).disable_tb, ], [f"Set AppleALC Usage:\t\tCurrently {self.constants.set_alc_usage}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).applealc_support], [f"Set Windows GMUX support:\tCurrently {self.constants.dGPU_switch}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).dGPU_switch_support], @@ -275,111 +193,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = menu.start() - def credits(self): - Utilities.TUIOnlyPrint( - ["Credits"], - "Press [Enter] to go back.\n", - [ - """Many thanks to the following: - - - Acidanthera:\tOpenCore, kexts and other tools - - Khronokernel:\tWriting and maintaining this patcher - - DhinakG:\t\tWriting and maintaining this patcher - - ASentientBot:\tLegacy Acceleration Patches - - Ausdauersportler:\tLinking fixes for SNBGraphicsFB and AMDX3000 - - Syncretic:\t\tAAAMouSSE and telemetrap - - cdf:\t\tNightShiftEnabler and Innie""" - ], - ).start() - - def PatchVolume(self): - Utilities.cls() - Utilities.header(["Patching System Volume"]) - big_sur = """Patches Root volume to fix misc issues such as: - -- Non-Metal Graphics Acceleration - - Intel: Ironlake - Sandy Bridge - - Nvidia: Tesla - Fermi (8000-500 series) - - AMD: TeraScale 1 and 2 (2000-6000 series) -- Audio support for iMac7,1 and iMac8,1 - -WARNING: Root Volume Patching is still in active development, please -have all important user data backed up. Note when the system volume -is patched, you can no longer have Delta updates. - -Supported Options: - -1. Patch System Volume -2. Unpatch System Volume (Experimental) -B. Exit - """ - monterey = """Patches Root volume to fix misc issues such as: - -- Metal Graphics Acceleration - - Intel: Ivy Bridge (4000 series iGPUs) - - Nvidia: Kepler (600-700) -- Non-Metal Graphics Accelertation - - Intel: Ironlake - Sandy Bridge - - Nvidia: Tesla - Fermi (8000-500 series) - - AMD: TeraScale 1 and 2 (2000-6000 series) -- Audio support for iMac7,1 and iMac8,1 -- Wifi support for BCM94328, BCM94322 and Atheros cards - -WARNING: Root Volume Patching is still in active development, please -have all important user data backed up. Note when the system volume -is patched, you can no longer have Delta updates. - -Supported Options: - -1. Patch System Volume -2. Unpatch System Volume (Experimental) -B. Exit - """ - mojave_catalina = """Patches Root volume to fix misc issues such as: - -- Non-Metal Graphics Acceleration - - Intel: Ironlake - Sandy Bridge - - Nvidia: Tesla - Fermi (8000-500 series) - - AMD: TeraScale 1 and 2 (2000-6000 series) -- Audio support for iMac7,1 and iMac8,1 - -WARNING: Root Volume Patching is still in active development, please -have all important user data backed up. Note when the system volume -is patched, you can no longer have Delta updates. - -Supported Options: - -1. Patch System Volume -2. Unpatch System Volume (Experimental) -B. Exit - """ - - default = """ -This OS has no root patches available to apply, please ensure you're patching a booted -install that requires root patches such as macOS Big Sur or Monterey - -Supported Options: - -B. Exit - """ - no_patch = False - if self.constants.detected_os == self.constants.monterey: - print(monterey) - elif self.constants.detected_os == self.constants.big_sur: - print(big_sur) - elif self.constants.detected_os in [self.constants.mojave, self.constants.catalina] and self.constants.moj_cat_accel == True: - print(mojave_catalina) - else: - print(default) - no_patch = True - change_menu = input("Patch System Volume?: ") - if no_patch is not True and change_menu == "1": - SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_patch() - elif no_patch is not True and change_menu == "2": - SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_unpatch() - else: - print("Returning to main menu") - def main_menu(self): response = None while not (response and response == -1): @@ -415,10 +228,10 @@ B. Exit else [] ) + [ ["Install OpenCore to USB/internal drive", self.install_opencore], - ["Post-Install Volume Patch", self.PatchVolume], - ["Change Model", self.change_model], + ["Post-Install Volume Patch", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], + ["Change Model", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], ["Patcher Settings", self.patcher_settings], - ["Credits", self.credits], + ["Credits", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], ] for option in options: @@ -430,4 +243,4 @@ B. Exit subprocess.run("""osascript -e 'tell application "Terminal" to close first window' & exit""", shell=True) -OpenCoreLegacyPatcher().main_menu() +OpenCoreLegacyPatcher() diff --git a/Resources/Build.py b/Resources/Build.py index b141d828c..71b757b31 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -219,6 +219,7 @@ class BuildOpenCore: arpt_path = "PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)" print(f"- Using known DevicePath {arpt_path}") # self.config["DeviceProperties"]["Add"][arpt_path] = {"device-id": binascii.unhexlify("ba430000"), "compatible": "pci14e4,43ba"} + if not self.constants.custom_model and self.computer.wifi and self.constants.validate is False and self.computer.wifi.country_code: print(f"- Applying fake ID for WiFi, setting Country Code: {self.computer.wifi.country_code}") self.config["DeviceProperties"]["Add"][arpt_path] = {"brcmfx-country": self.computer.wifi.country_code} @@ -426,7 +427,7 @@ class BuildOpenCore: else: return True - if self.constants.firewire_boot is True and check_firewire() is True: + if self.constants.firewire_boot is True and check_firewire(self.model) is True: # Enable FireWire Boot Support # Applicable for both native FireWire and Thunderbolt to FireWire adapters print("- Enabling FireWire Boot Support") @@ -571,7 +572,7 @@ class BuildOpenCore: print("- Adding Mac Pro, Xserve DRM patches") self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree" - if self.constants.disable_thunderbolt is True and self.model in ["MacBookPro11,1", "MacBookPro11,2", "MacBookPro11,3", "MacBookPro11,4", "MacBookPro11,5"]: + if self.constants.disable_tb is True and self.model in ["MacBookPro11,1", "MacBookPro11,2", "MacBookPro11,3", "MacBookPro11,4", "MacBookPro11,5"]: print("- Disabling 2013-2014 laptop Thunderbolt Controller") if self.model in ["MacBookPro11,3", "MacBookPro11,5"]: # 15" dGPU models: IOACPIPlane:/_SB/PCI0@0/PEG1@10001/UPSB@0/DSB0@0/NHI0@0 diff --git a/Resources/CliMenu.py b/Resources/CliMenu.py index f3dd62d0f..a397c1e17 100644 --- a/Resources/CliMenu.py +++ b/Resources/CliMenu.py @@ -3,7 +3,7 @@ from __future__ import print_function import subprocess -from Resources import Constants, Utilities +from Resources import Constants, Utilities, defaults, ModelArray, SysPatch class MenuOptions: @@ -574,7 +574,7 @@ Note: for the average user, we recommend using dosdude1's legacy patcher: else: self.allow_moj_cat_patch() - def disable_thunderbolt(self): + def disable_tb(self): Utilities.cls() Utilities.header(["Disable Thunderbolt on 2013-14 MacBook Pros"]) print( @@ -592,13 +592,13 @@ other devices that benefit from this fix. change_menu = input("Disable Thunderbolt?(y/n/q): ") if change_menu in {"y", "Y", "yes", "Yes"}: - self.constants.disable_thunderbolt = True + self.constants.disable_tb = True elif change_menu in {"n", "N", "no", "No"}: - self.constants.disable_thunderbolt = False + self.constants.disable_tb = False elif change_menu in {"q", "Q", "Quit", "quit"}: print("Returning to previous menu") else: - self.disable_thunderbolt() + self.disable_tb() def terascale_2_accel(self): Utilities.cls() @@ -702,3 +702,155 @@ the event there's issues. print("Returning to previous menu") else: self.set_surplus() + + def credits(self): + Utilities.TUIOnlyPrint( + ["Credits"], + "Press [Enter] to go back.\n", + [ + """Many thanks to the following: + + - Acidanthera:\tOpenCore, kexts and other tools + - Khronokernel:\tWriting and maintaining this patcher + - DhinakG:\t\tWriting and maintaining this patcher + - ASentientBot:\tLegacy Acceleration Patches + - Ausdauersportler:\tLinking fixes for SNBGraphicsFB and AMDX3000 + - Syncretic:\t\tAAAMouSSE and telemetrap + - cdf:\t\tNightShiftEnabler and Innie""" + ], + ).start() + + def change_model(self): + Utilities.cls() + Utilities.header(["Select Different Model"]) + print( + """ +Tip: Run the following command on the target machine to find the model identifier: + +system_profiler SPHardwareDataType | grep 'Model Identifier' + """ + ) + self.constants.custom_model = input("Please enter the model identifier of the target machine: ").strip() + if self.constants.custom_model not in ModelArray.SupportedSMBIOS: + print( + f""" +{self.constants.custom_model} is not a valid SMBIOS Identifier for macOS {self.constants.os_support}! +""" + ) + print_models = input(f"Print list of valid options for macOS {self.constants.os_support}? (y/n)") + if print_models.lower() in {"y", "yes"}: + print("\n".join(ModelArray.SupportedSMBIOS)) + input("\nPress [ENTER] to continue") + else: + defaults.generate_defaults.probe(self.constants.custom_model, False, self.constants) + + def PatchVolume(self): + Utilities.cls() + Utilities.header(["Patching System Volume"]) + + no_patch = False + if self.constants.detected_os == self.constants.monterey: + print(MenuOptions.monterey) + elif self.constants.detected_os == self.constants.big_sur: + print(MenuOptions.big_sur) + elif self.constants.detected_os in [self.constants.mojave, self.constants.catalina] and self.constants.moj_cat_accel == True: + print(MenuOptions.mojave_catalina) + else: + print(MenuOptions.default) + no_patch = True + change_menu = input("Patch System Volume?: ") + if no_patch is not True and change_menu == "1": + SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch() + elif no_patch is not True and change_menu == "2": + SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_unpatch() + else: + print("Returning to main menu") + + def advanced_patcher_settings(self): + response = None + while not (response and response == -1): + title = ["Adjust Advanced Patcher Settings, for developers ONLY"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Set Metal GPU Status:\t\tCurrently {self.constants.imac_vendor}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_metal], + [f"Set DRM Preferences:\t\tCurrently {self.constants.drm_support}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).drm_setting], + [f"Set Generic Bootstrap:\t\tCurrently {self.constants.boot_efi}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).bootstrap_setting], + [ + f"Disable CPU Friend:\t\t\tCurrently {self.constants.disallow_cpufriend}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).disable_cpufriend, + ], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + + big_sur = """Patches Root volume to fix misc issues such as: + +- Non-Metal Graphics Acceleration + - Intel: Ironlake - Sandy Bridge + - Nvidia: Tesla - Fermi (8000-500 series) + - AMD: TeraScale 1 and 2 (2000-6000 series) +- Audio support for iMac7,1 and iMac8,1 + +WARNING: Root Volume Patching is still in active development, please +have all important user data backed up. Note when the system volume +is patched, you can no longer have Delta updates. + +Supported Options: + +1. Patch System Volume +2. Unpatch System Volume (Experimental) +B. Exit + """ + monterey = """Patches Root volume to fix misc issues such as: + +- Metal Graphics Acceleration + - Intel: Ivy Bridge (4000 series iGPUs) + - Nvidia: Kepler (600-700) +- Non-Metal Graphics Accelertation + - Intel: Ironlake - Sandy Bridge + - Nvidia: Tesla - Fermi (8000-500 series) + - AMD: TeraScale 1 and 2 (2000-6000 series) +- Audio support for iMac7,1 and iMac8,1 +- Wifi support for BCM94328, BCM94322 and Atheros cards + +WARNING: Root Volume Patching is still in active development, please +have all important user data backed up. Note when the system volume +is patched, you can no longer have Delta updates. + +Supported Options: + +1. Patch System Volume +2. Unpatch System Volume (Experimental) +B. Exit + """ + mojave_catalina = """Patches Root volume to fix misc issues such as: + +- Non-Metal Graphics Acceleration + - Intel: Ironlake - Sandy Bridge + - Nvidia: Tesla - Fermi (8000-500 series) + - AMD: TeraScale 1 and 2 (2000-6000 series) +- Audio support for iMac7,1 and iMac8,1 + +WARNING: Root Volume Patching is still in active development, please +have all important user data backed up. Note when the system volume +is patched, you can no longer have Delta updates. + +Supported Options: + +1. Patch System Volume +2. Unpatch System Volume (Experimental) +B. Exit + """ + + default = """ +This OS has no root patches available to apply, please ensure you're patching a booted +install that requires root patches such as macOS Big Sur or Monterey + +Supported Options: + +B. Exit + """ \ No newline at end of file diff --git a/Resources/Constants.py b/Resources/Constants.py index 7c113e6b3..2c173e9f7 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -140,7 +140,7 @@ class Constants: ## Miscellaneous self.disallow_cpufriend = False # Disable CPUFriend self.enable_wake_on_wlan = False # Allow Wake on WLAN for modern Broadcom - self.disable_thunderbolt = False # Disable Thunderbolt Controller + self.disable_tb = False # Disable Thunderbolt Controller self.set_alc_usage = True # Set AppleALC usage self.dGPU_switch = True # Set Display GPU Switching for Windows self.force_surplus = False # Force SurPlus patch in newer OSes diff --git a/Resources/arguments.py b/Resources/arguments.py new file mode 100644 index 000000000..d5787b74b --- /dev/null +++ b/Resources/arguments.py @@ -0,0 +1,195 @@ +import argparse +import sys +import subprocess +from Resources import ModelArray, defaults, Build, ModelExample + +# Generic building args +class arguments: + def __init__(self): + parser = argparse.ArgumentParser() + parser.add_argument("--build", help="Build OpenCore", action="store_true", required=False) + parser.add_argument("--verbose", help="Enable verbose boot", action="store_true", required=False) + parser.add_argument("--debug_oc", help="Enable OpenCore DEBUG", action="store_true", required=False) + parser.add_argument("--debug_kext", help="Enable kext DEBUG", action="store_true", required=False) + parser.add_argument("--hide_picker", help="Hide OpenCore picker", action="store_true", required=False) + parser.add_argument("--disable_sip", help="Disable SIP", action="store_true", required=False) + parser.add_argument("--disable_smb", help="Disable SecureBootModel", action="store_true", required=False) + parser.add_argument("--vault", help="Enable OpenCore Vaulting", action="store_true", required=False) + parser.add_argument("--support_all", help="Allow OpenCore on natively supported Models", action="store_true", required=False) + parser.add_argument("--firewire", help="Enable FireWire Booting", action="store_true", required=False) + parser.add_argument("--nvme", help="Enable NVMe Booting", action="store_true", required=False) + parser.add_argument("--wlan", help="Enable Wake on WLAN support", action="store_true", required=False) + # parser.add_argument("--disable_amfi", help="Disable AMFI", action="store_true", required=False) + parser.add_argument("--moderate_smbios", help="Moderate SMBIOS Patching", action="store_true", required=False) + parser.add_argument("--moj_cat_accel", help="Allow Root Patching on Mojave and Catalina", action="store_true", required=False) + parser.add_argument("--disable_tb", help="Disable Thunderbolt on 2013-2014 MacBook Pros", action="store_true", required=False) + parser.add_argument("--force_surplus", help="Force SurPlus in all newer OSes", action="store_true", required=False) + + # Building args requiring value values (ie. --model iMac12,2) + parser.add_argument("--model", action="store", help="Set custom model", required=False) + parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False) + parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) + + # SysPatch args + parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) + parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) + parser.add_argument("--validate", help="Runs Validation Tests for CI", action="store_true", required=False) + self.args = parser.parse_args() + + def check_cli(self): + # If no core arguments are present, assume we're running in TUI + # - build + # - patch_sys_vol + # - unpatch_sys_vol + # - validate + if not( + self.args.build or self.args.patch_sys_vol or self.args.unpatch_sys_vol or self.args.validate + ): + return False + else: + return True + + def parse_arguments(self, settings): + if self.args.disk: + print(f"- Install Disk set: {self.args.disk}") + settings.disk = self.args.disk + if self.args.validate: + self.validate(settings) + if self.args.verbose: + print("- Set verbose configuration") + settings.verbose_debug = True + if self.args.debug_oc: + print("- Set OpenCore DEBUG configuration") + settings.opencore_debug = True + settings.opencore_build = "DEBUG" + if self.args.debug_kext: + print("- Set kext DEBUG configuration") + settings.kext_debug = True + if self.args.hide_picker: + print("- Set HidePicker configuration") + settings.showpicker = False + if self.args.disable_sip: + print("- Set Disable SIP configuration") + settings.sip_status = False + if self.args.disable_smb: + print("- Set Disable SecureBootModel configuration") + settings.secure_status = False + if self.args.vault: + print("- Set Vault configuration") + settings.vault = True + if self.args.firewire: + print("- Set FireWire Boot configuration") + settings.firewire_boot = True + if self.args.nvme: + print("- Set NVMe Boot configuration") + settings.nvme_boot = True + # if self.args.disable_amfi: + # print("- Set Disable AMFI configuration") + # settings.amfi_status = False + if self.args.wlan: + print("- Set Wake on WLAN configuration") + settings.enable_wake_on_wlan = True + if self.args.disable_tb: + print("- Set Disable Thunderbolt configuration") + settings.disable_tb = True + if self.args.force_surplus: + print("- Forcing SurPlus override configuration") + settings.force_surplus = True + if self.args.moderate_smbios: + print("- Set Moderate SMBIOS Patching configuration") + settings.serial_settings = "Moderate" + if self.args.smbios_spoof: + if self.args.smbios_spoof == "Minimal": + settings.serial_settings = "Minimal" + elif self.args.smbios_spoof == "Moderate": + settings.serial_settings = "Moderate" + elif self.args.smbios_spoof == "Advanced": + settings.serial_settings = "Advanced" + else: + print(f"- Unknown SMBIOS arg passed: {self.args.smbios_spoof}") + + if self.args.support_all: + print("- Building for natively supported model") + settings.allow_oc_everywhere = True + settings.serial_settings = "None" + + if self.args.build: + if self.args.model: + print(f"- Using custom model: {self.args.model}") + settings.custom_model = self.args.model + #self.set_defaults(settings.custom_model, False) + defaults.generate_defaults.probe(settings.custom_model, False, settings) + #self.build_opencore() + Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + elif settings.computer.real_model not in ModelArray.SupportedSMBIOS and settings.allow_oc_everywhere is False: + print( + """Your model is not supported by this patcher for running unsupported OSes!" + +If you plan to create the USB for another machine, please select the "Change Model" option in the menu.""" + ) + sys.exit(1) + else: + print(f"- Using detected model: {settings.computer.real_model}") + #self.set_defaults(settings.custom_model, True) + defaults.generate_defaults.probe(settings.custom_model, True, settings) + # self.build_opencore() + Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + if self.args.patch_sys_vol: + if self.args.moj_cat_accel: + print("- Set Mojave/Catalina root patch configuration") + settings.moj_cat_accel = True + print("- Set System Volume patching") + self.patch_vol() + elif self.args.unpatch_sys_vol: + print("- Set System Volume unpatching") + self.unpatch_vol() + + def validate(self, settings): + # Runs through ocvalidate to check for errors + + valid_dumps = [ + # ModelExample.MacBookPro.MacBookPro92_Stock, + # ModelExample.MacBookPro.MacBookPro171_Stock, + # ModelExample.Macmini.Macmini91_Stock, + #ModelExample.iMac.iMac81_Stock, + ModelExample.iMac.iMac112_Stock, + #ModelExample.iMac.iMac122_Upgraded, + ModelExample.MacPro.MacPro31_Stock, + ModelExample.MacPro.MacPro31_Upgrade, + ModelExample.MacPro.MacPro31_Modern_AMD, + ModelExample.MacPro.MacPro31_Modern_Kepler, + ModelExample.MacPro.MacPro41_Upgrade, + ModelExample.MacPro.MacPro41_Modern_AMD, + ModelExample.MacPro.MacPro41_51__Flashed_Modern_AMD, + ] + settings.validate = True + + for model in ModelArray.SupportedSMBIOS: + print(f"Validating predefined model: {model}") + settings.custom_model = model + # self.build_opencore() + Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {model}") + else: + print(f"Validation succeeded for predefined model: {model}") + + for model in valid_dumps: + settings.computer = model + + # self.computer = settings.computer + settings.custom_model = "" + print(f"Validating dumped model: {settings.computer.real_model}") + # self.build_opencore() + Build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {settings.computer.real_model}") + else: + print(f"Validation succeeded for predefined model: {settings.computer.real_model}") + diff --git a/Resources/defaults.py b/Resources/defaults.py new file mode 100644 index 000000000..94f6d0aec --- /dev/null +++ b/Resources/defaults.py @@ -0,0 +1,74 @@ +# Generate Default Data +from Resources import Utilities, device_probe, ModelArray + +class generate_defaults(): + def probe(model, host_is_target, settings): + # Generate Default Data + # Takes in Settings data set, and returns updated Settings + settings.sip_status = True + settings.secure_status = False # Default false for Monterey + settings.amfi_status = True + + if host_is_target: + if Utilities.check_metal_support(device_probe, settings.computer) is False: + settings.disable_cs_lv = True + if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: + settings.sip_status = False + settings.amfi_status = True + settings.allow_fv_root = True # Allow FileVault on broken seal + if ( + isinstance(settings.computer.wifi, device_probe.Broadcom) + and settings.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224] + ) or (isinstance(settings.computer.wifi, device_probe.Atheros) and settings.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): + settings.sip_status = False + settings.allow_fv_root = True # Allow FileVault on broken seal + elif model in ModelArray.LegacyGPU: + settings.disable_cs_lv = True + + if model in ModelArray.LegacyGPU: + if host_is_target and Utilities.check_metal_support(device_probe, settings.computer) is True: + # Building on device and we have a native, supported GPU + if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: + settings.sip_status = False + # settings.secure_status = True # Monterey + settings.allow_fv_root = True # Allow FileVault on broken seal + else: + settings.sip_status = True + # settings.secure_status = True # Monterey + settings.amfi_status = True + else: + settings.sip_status = False # Unsigned kexts + settings.secure_status = False # Root volume modified + settings.amfi_status = False # Unsigned binaries + settings.allow_fv_root = True # Allow FileVault on broken seal + if model in ModelArray.ModernGPU: + # Systems with Ivy or Kepler GPUs, Monterey requires root patching for accel + settings.sip_status = False # Unsigned kexts + settings.secure_status = False # Modified root volume + settings.allow_fv_root = True # Allow FileVault on broken seal + # settings.amfi_status = True # Signed bundles, Don't need to explicitly set currently + + + if model == "MacBook8,1": + # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing + settings.serial_settings = "Moderate" + + custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) + if custom_cpu_model_value is not None: + # TODO: Fix to not use two separate variables + settings.custom_cpu_model = 1 + settings.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0] + + if "-v" in (Utilities.get_nvram("boot-args") or ""): + settings.verbose_debug = True + + if Utilities.amfi_status() is False: + settings.amfi_status = False + + if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9"): + # Users disabling TS2 most likely have a faulty dGPU + # users can override this in settings + settings.allow_ts2_accel = False + + # Check if running in RecoveryOS + settings.recovery_status = Utilities.check_recovery() \ No newline at end of file diff --git a/Resources/mount_root.py b/Resources/mount_root.py new file mode 100644 index 000000000..bcaf282e8 --- /dev/null +++ b/Resources/mount_root.py @@ -0,0 +1,19 @@ +# Logic for mounting root volume +from Data import os_data +from Resources import Utilities +import plistlib +import subprocess + +def mount_root_volume(os_version, root_disk): + + if os_version >= os_data.os_data.big_sur: + mount_location = "/System/Volumes/Update/mnt1/" + else: + mount_location = "/" + +def find_root_volume(): + root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) + root_mount_path = root_partition_info["DeviceIdentifier"] + root_mount_path = root_mount_path[:-2] if root_mount_path.count("s") > 1 else root_mount_path + return root_mount_path + diff --git a/Resources/os_probe.py b/Resources/os_probe.py new file mode 100644 index 000000000..38596d5f8 --- /dev/null +++ b/Resources/os_probe.py @@ -0,0 +1,19 @@ +# Probe for OS data + +import platform +import subprocess + +def detect_kernel_major(): + # Return Major Kernel Version + # Example Output: 21 (integer) + return int(platform.uname().release.partition(".")[0]) + +def detect_kernel_minor(): + # Return Minor Kernel Version + # Example Output: 1 (integer) + return int(platform.uname().release.partition(".")[2].partition(".")[0]) + +def detect_kernel_build(): + # Return OS build + # Example Output: 21A5522h (string) + return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() \ No newline at end of file From c0350e036e67b91aabc08ce30ebc5059a547c177 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 13:24:51 -0600 Subject: [PATCH 10/30] Enforce Snake Style naming scheme for files --- Data/bluetooth_data.py | 7 +- Data/cpu_data.py | 9 +- .../ModelExample.py => Data/example_data.py | 0 Data/os_data.py | 4 +- Data/smbios_data.py | 341 +++++++++++------- .../sys_patch_data.py | 2 +- OpenCore-Patcher.command | 160 +------- Resources/Build.py | 28 +- Resources/Constants.py | 11 +- Resources/arguments.py | 154 ++++---- Resources/{CliMenu.py => cli_menu.py} | 160 +++++++- Resources/{SysPatch.py => sys_patch.py} | 80 ++-- 12 files changed, 526 insertions(+), 430 deletions(-) rename Resources/ModelExample.py => Data/example_data.py (100%) rename Resources/SysPatchArray.py => Data/sys_patch_data.py (99%) rename Resources/{CliMenu.py => cli_menu.py} (75%) rename Resources/{SysPatch.py => sys_patch.py} (92%) diff --git a/Data/bluetooth_data.py b/Data/bluetooth_data.py index 10a1daae3..c2dad8031 100644 --- a/Data/bluetooth_data.py +++ b/Data/bluetooth_data.py @@ -1,4 +1,6 @@ -class bluetooth_data: +import enum + +class bluetooth_data(enum.IntEnum): # Bluetooth Chipsets NonApplicable = 0 BRCM2045 = 1 # TODO: Rename chipset, currently guessing MacPro1,1-3,1 name @@ -8,4 +10,5 @@ class bluetooth_data: BRCM20702_v2 = 5 # BT 4.0 - 2013+ BRCM20703 = 6 # BT 4.2 BRCM20703_UART = 9 # BRCM20703 over UART, BT 4.2 - UART = 10 \ No newline at end of file + UART = 10 # T2 + PCIe = 20 # Apple Silicon \ No newline at end of file diff --git a/Data/cpu_data.py b/Data/cpu_data.py index 31016f340..0e1e77e2c 100644 --- a/Data/cpu_data.py +++ b/Data/cpu_data.py @@ -1,4 +1,6 @@ -class cpu_data: +import enum + +class cpu_data(enum.IntEnum): pentium_4 = 0 yonah = 1 conroe = 2 @@ -13,3 +15,8 @@ class cpu_data: coffee_lake = 11 # 8000 comet_lake = 12 # 9000 ice_lake = 13 # 10000 + + + apple_dtk = 112 # A12 + apple_m1 = 114 # A14 + apple_m2 = 115 # A15 \ No newline at end of file diff --git a/Resources/ModelExample.py b/Data/example_data.py similarity index 100% rename from Resources/ModelExample.py rename to Data/example_data.py diff --git a/Data/os_data.py b/Data/os_data.py index 3b8405f40..dd206fa48 100644 --- a/Data/os_data.py +++ b/Data/os_data.py @@ -1,4 +1,6 @@ -class os_data: +import enum + +class os_data(enum.IntEnum): # OS Versions, Based off Major Kernel Version tiger = 8 leopard = 9 diff --git a/Data/smbios_data.py b/Data/smbios_data.py index ffa881d68..d0a85723c 100644 --- a/Data/smbios_data.py +++ b/Data/smbios_data.py @@ -8,7 +8,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208CC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -21,7 +21,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208CA9", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -34,7 +34,7 @@ smbios_dictionary = { "Board ID": "Mac-F22788C8", "FirmwareFeatures": "0xC0001407", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -47,7 +47,7 @@ smbios_dictionary = { "Board ID": "Mac-F22788A9", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -61,7 +61,7 @@ smbios_dictionary = { "Board ID": "Mac-F42D89C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -75,7 +75,7 @@ smbios_dictionary = { "Board ID": "Mac-F22788AA", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -89,7 +89,7 @@ smbios_dictionary = { "Board ID": "Mac-F22C8AC8", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -103,7 +103,7 @@ smbios_dictionary = { "Board ID": "Mac-F22C89C8", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -117,7 +117,7 @@ smbios_dictionary = { "Board ID": "Mac-BE0E8AC46FE800CC", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -129,7 +129,7 @@ smbios_dictionary = { "Board ID": "Mac-9AE82516C7C6B903", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.skylake, + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -141,7 +141,7 @@ smbios_dictionary = { "Board ID": "Mac-EE2EBD4B90B839A8", "FirmwareFeatures": "0xFC0FE13F", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -154,7 +154,7 @@ smbios_dictionary = { "Board ID": "Mac-F42C8CC8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -166,7 +166,7 @@ smbios_dictionary = { "Board ID": "Mac-F42D88C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -180,7 +180,7 @@ smbios_dictionary = { "Board ID": "Mac-942452F5819B1C1B", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -194,7 +194,7 @@ smbios_dictionary = { "Board ID": "Mac-942C5DF58193131B", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -208,7 +208,7 @@ smbios_dictionary = { "Board ID": "Mac-C08A6BB70A942AC2", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -221,7 +221,7 @@ smbios_dictionary = { "Board ID": "Mac-742912EFDBEE19B3", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -234,7 +234,7 @@ smbios_dictionary = { "Board ID": "Mac-66F35F19FE2A0D05", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -247,7 +247,7 @@ smbios_dictionary = { "Board ID": "Mac-2E6FAB96566FE58C", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -260,7 +260,7 @@ smbios_dictionary = { "Board ID": "Mac-35C1E88140C3E6CF", "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -273,7 +273,7 @@ smbios_dictionary = { "Board ID": "Mac-7DF21CB3ED6977E5", "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -285,7 +285,7 @@ smbios_dictionary = { "Board ID": "Mac-9F18E312C5C2BF0B", "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -297,7 +297,7 @@ smbios_dictionary = { "Board ID": "Mac-937CB26E2E02BB01", "FirmwareFeatures": "0xFF0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -308,8 +308,8 @@ smbios_dictionary = { "MacBookAir8,1": { "Board ID": "Mac-827FAC58A8FDFA22", "FirmwareFeatures": "0xFD8FF42E", - "SecureBootModel": "j140kap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j140k", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -320,8 +320,8 @@ smbios_dictionary = { "MacBookAir8,2": { "Board ID": "Mac-226CB3C6A851A671", "FirmwareFeatures": "0xFD8FF42E", - "SecureBootModel": "j140aap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j140a", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -332,8 +332,8 @@ smbios_dictionary = { "MacBookAir9,1": { "Board ID": "Mac-0CFF9C7C2B63DF8D", "FirmwareFeatures": "0xFFAFF06E", - "SecureBootModel": "j230kap", - "CPU Generation": cpu_data.cpu_data.ice_lake, + "SecureBootModel": "j230k", + "CPU Generation": cpu_data.cpu_data.ice_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -341,11 +341,22 @@ smbios_dictionary = { "Ethernet Chipset": None, }, + "MacBookAir10,1": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j313", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": None, + }, + "MacBookPro1,1": { "Board ID": "Mac-F425BEC8", "FirmwareFeatures": "", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -358,7 +369,7 @@ smbios_dictionary = { "Board ID": "Mac-F42DBEC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -371,7 +382,7 @@ smbios_dictionary = { "Board ID": "Mac-F42189C8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -384,7 +395,7 @@ smbios_dictionary = { "Board ID": "Mac-F42187C8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -397,7 +408,7 @@ smbios_dictionary = { "Board ID": "Mac-F4238BC8", "FirmwareFeatures": "0xC0001407", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -410,7 +421,7 @@ smbios_dictionary = { "Board ID": "Mac-F42C89C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -425,7 +436,7 @@ smbios_dictionary = { "Board ID": "Mac-F42D86C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -440,7 +451,7 @@ smbios_dictionary = { "Board ID": "Mac-F2268EC8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -455,7 +466,7 @@ smbios_dictionary = { "Board ID": "Mac-F22587C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -470,7 +481,7 @@ smbios_dictionary = { "Board ID": "Mac-F22587A1", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -485,7 +496,7 @@ smbios_dictionary = { "Board ID": "Mac-F2268AC8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -499,7 +510,7 @@ smbios_dictionary = { "Board ID": "Mac-F22589C8", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -513,7 +524,7 @@ smbios_dictionary = { "Board ID": "Mac-F22586C8", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -527,7 +538,7 @@ smbios_dictionary = { "Board ID": "Mac-F222BEC8", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -541,7 +552,7 @@ smbios_dictionary = { "Board ID": "Mac-94245B3640C91C81", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -554,7 +565,7 @@ smbios_dictionary = { "Board ID": "Mac-94245A3940C91C80", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -568,7 +579,7 @@ smbios_dictionary = { "Board ID": "Mac-942459F5819B171B", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -582,7 +593,7 @@ smbios_dictionary = { "Board ID": "Mac-4B7AC7E43945597E", "FirmwareFeatures": "0xC00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -596,7 +607,7 @@ smbios_dictionary = { "Board ID": "Mac-6F01561E16C75D06", "FirmwareFeatures": "0xC10DF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -609,7 +620,7 @@ smbios_dictionary = { "Board ID": "Mac-C3EC7CD22292981F", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -623,7 +634,7 @@ smbios_dictionary = { "Board ID": "Mac-AFD8A9D944EA4843", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -636,7 +647,7 @@ smbios_dictionary = { "Board ID": "Mac-189A3D4F975D5FFC", "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -649,7 +660,7 @@ smbios_dictionary = { "Board ID": "Mac-3CBD00234E554E41", "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -662,7 +673,7 @@ smbios_dictionary = { "Board ID": "Mac-2BD1B31983FE1663", "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -675,7 +686,7 @@ smbios_dictionary = { "Board ID": "Mac-06F11FD93F0323C5", "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -687,7 +698,7 @@ smbios_dictionary = { "Board ID": "Mac-06F11F11946D27C5", "FirmwareFeatures": "0xEB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -700,7 +711,7 @@ smbios_dictionary = { "Board ID": "Mac-E43C1C25D4880AD6", "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -712,7 +723,7 @@ smbios_dictionary = { "Board ID": "Mac-473D31EABEB93F9B", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.skylake, + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -724,7 +735,7 @@ smbios_dictionary = { "Board ID": "Mac-66E35819EE2D0D05", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.skylake, + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -736,7 +747,7 @@ smbios_dictionary = { "Board ID": "Mac-A5C67F76ED83108C", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.skylake, + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -749,7 +760,7 @@ smbios_dictionary = { "Board ID": "Mac-B4831CEBD52A0C4C", "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -761,7 +772,7 @@ smbios_dictionary = { "Board ID": "Mac-CAD6701F7CEA0921", "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -773,7 +784,7 @@ smbios_dictionary = { "Board ID": "Mac-551B86E5744E2388", "FirmwareFeatures": "0xFF0FF57E", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, @@ -785,8 +796,8 @@ smbios_dictionary = { "MacBookPro15,1": { "Board ID": "Mac-937A206F2EE63C01", "FirmwareFeatures": "0xFD8FF426", - "SecureBootModel": "j680ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j680", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -798,8 +809,8 @@ smbios_dictionary = { "MacBookPro15,2": { "Board ID": "Mac-827FB448E656EC26", "FirmwareFeatures": "0xFD8FF426", - "SecureBootModel": "j132ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j132", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -810,8 +821,8 @@ smbios_dictionary = { "MacBookPro15,3": { "Board ID": "Mac-1E7E29AD0135F9BC", "FirmwareFeatures": "0xFD8FF426", - "SecureBootModel": "j780ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j780", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -823,8 +834,8 @@ smbios_dictionary = { "MacBookPro15,4": { "Board ID": "Mac-53FDB3D8DB8CA971", "FirmwareFeatures": "0xFD8FF426", - "SecureBootModel": "j213ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j213", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -835,8 +846,8 @@ smbios_dictionary = { "MacBookPro16,1": { "Board ID": "Mac-E1008331FDC96864", "FirmwareFeatures": "0xFDAFF066", - "SecureBootModel": "j152fap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j152f", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -848,8 +859,8 @@ smbios_dictionary = { "MacBookPro16,2": { "Board ID": "Mac-5F9802EFE386AA28", "FirmwareFeatures": "0xFFAFF06E", - "SecureBootModel": "j214kap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j214k", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -860,8 +871,8 @@ smbios_dictionary = { "MacBookPro16,3": { "Board ID": "Mac-E7203C0F68AA0004", "FirmwareFeatures": "0xFDAFF066", - "SecureBootModel": "j223ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j223", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -872,8 +883,8 @@ smbios_dictionary = { "MacBookPro16,4": { "Board ID": "Mac-A61BADE1FDAD7B05", "FirmwareFeatures": "0xFDAFF066", - "SecureBootModel": "j215ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j215", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -882,11 +893,22 @@ smbios_dictionary = { "Ethernet Chipset": None, }, + "MacBookPro17,1": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j293", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": None, + }, + "Macmini1,1": { "Board ID": "Mac-F4208EC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -897,7 +919,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208EAA", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -908,7 +930,7 @@ smbios_dictionary = { "Board ID": "Mac-F22C86C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -921,7 +943,7 @@ smbios_dictionary = { "Board ID": "Mac-F2208EC8", "FirmwareFeatures": "0xC00C9423", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -933,7 +955,7 @@ smbios_dictionary = { "Board ID": "Mac-8ED6AF5B48C039E1", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -945,7 +967,7 @@ smbios_dictionary = { "Board ID": "Mac-4BC72D62AD45599E", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -957,7 +979,7 @@ smbios_dictionary = { "Board ID": "Mac-7BA5B2794B2CDB12", "FirmwareFeatures": "0xD00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, @@ -969,7 +991,7 @@ smbios_dictionary = { "Board ID": "Mac-031AEE4D24BFF0B1", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -981,7 +1003,7 @@ smbios_dictionary = { "Board ID": "Mac-F65AE981FFA204ED", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -992,7 +1014,7 @@ smbios_dictionary = { "Board ID": "Mac-35C5E08120C7EEAF", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1002,19 +1024,30 @@ smbios_dictionary = { "Macmini8,1": { "Board ID": "Mac-7BA5B2DFE22DDD8C", "FirmwareFeatures": "0xFD8FF466", - "SecureBootModel": "j174ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j174", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, + "Macmini9,1": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j274", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": "Broadcom", + }, + "iMac4,1": { "Board ID": "Mac-F42786C8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -1026,7 +1059,7 @@ smbios_dictionary = { "Board ID": "Mac-F4218EC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.yonah, + "CPU Generation": cpu_data.cpu_data.yonah.value, "Max OS Supported": os_data.os_data.snow_leopard, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -1038,7 +1071,7 @@ smbios_dictionary = { "Board ID": "Mac-F4228EC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1050,7 +1083,7 @@ smbios_dictionary = { "Board ID": "Mac-F4218EC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1062,7 +1095,7 @@ smbios_dictionary = { "Board ID": "Mac-F4218FC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1087,7 +1120,7 @@ smbios_dictionary = { "Board ID": "Mac-F227BEC8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1100,7 +1133,7 @@ smbios_dictionary = { "Board ID": "Mac-F2218FA9", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1114,7 +1147,7 @@ smbios_dictionary = { # "Board ID": "Mac-F2268CC8", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1127,7 +1160,7 @@ smbios_dictionary = { "Board ID": "Mac-F2268DAE", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1139,7 +1172,7 @@ smbios_dictionary = { "Board ID": "Mac-F2238AC8", "FirmwareFeatures": "0xC00C9423", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1151,7 +1184,7 @@ smbios_dictionary = { "Board ID": "Mac-F2238BAE", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1163,7 +1196,7 @@ smbios_dictionary = { "Board ID": "Mac-942B5BF58194151B", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1175,7 +1208,7 @@ smbios_dictionary = { "Board ID": "Mac-942B59F58194171B", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.sandy_bridge, + "CPU Generation": cpu_data.cpu_data.sandy_bridge.value, "Max OS Supported": os_data.os_data.high_sierra, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1187,7 +1220,7 @@ smbios_dictionary = { "Board ID": "Mac-00BE6ED71E35EB86", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -1199,7 +1232,7 @@ smbios_dictionary = { "Board ID": "Mac-FC02E91DDD3FA6A4", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -1211,7 +1244,7 @@ smbios_dictionary = { "Board ID": "Mac-7DF2A3B5E5D671ED", "FirmwareFeatures": "0xE00DE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4360, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, @@ -1223,7 +1256,7 @@ smbios_dictionary = { "Board ID": "Mac-031B6874CF7F642A", "FirmwareFeatures": "0xFB0FF577", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1235,7 +1268,7 @@ smbios_dictionary = { "Board ID": "Mac-27ADBB7B4CEE8E61", "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1247,7 +1280,7 @@ smbios_dictionary = { "Board ID": "Mac-77EB7D7DAF985301", "FirmwareFeatures": "0xE00FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.catalina, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1259,7 +1292,7 @@ smbios_dictionary = { "Board ID": "Mac-81E3E92DD6088272", "FirmwareFeatures": "0xF00FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1271,7 +1304,7 @@ smbios_dictionary = { "Board ID": "Mac-42FD25EABCABB274", "FirmwareFeatures": "0xF80FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.haswell, + "CPU Generation": cpu_data.cpu_data.haswell.value, "Max OS Supported": os_data.os_data.big_sur, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1282,7 +1315,7 @@ smbios_dictionary = { "Board ID": "Mac-A369DDC4E67F1C45", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1293,7 +1326,7 @@ smbios_dictionary = { "Board ID": "Mac-FFE5EF870D7BA81A", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.broadwell, + "CPU Generation": cpu_data.cpu_data.broadwell.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1306,7 +1339,7 @@ smbios_dictionary = { # "Board ID": "Mac-B809C3757DA9BB8D", "FirmwareFeatures": "0xFC0FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.skylake, + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1317,7 +1350,7 @@ smbios_dictionary = { "Board ID": "Mac-4B682C642B45593E", "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, @@ -1328,7 +1361,7 @@ smbios_dictionary = { "Board ID": "Mac-77F17D7DA9285301", "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, @@ -1339,7 +1372,7 @@ smbios_dictionary = { "Board ID": "Mac-BE088AF8C5EB4FA2", "FirmwareFeatures": "0xFD0FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.kaby_lake, + "CPU Generation": cpu_data.cpu_data.kaby_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, @@ -1350,7 +1383,7 @@ smbios_dictionary = { "Board ID": "Mac-AA95B1DDAB278B95", "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -1361,7 +1394,7 @@ smbios_dictionary = { "Board ID": "Mac-63001698E7A34814", "FirmwareFeatures": "0xFD8FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -1371,8 +1404,8 @@ smbios_dictionary = { "iMac20,1": { "Board ID": "Mac-CFF7D910A743CAAF", "FirmwareFeatures": "0xFD8FF576", - "SecureBootModel": "j185ap", - "CPU Generation": cpu_data.cpu_data.comet_lake, + "SecureBootModel": "j185", + "CPU Generation": cpu_data.cpu_data.comet_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -1382,19 +1415,42 @@ smbios_dictionary = { "iMac20,2": { "Board ID": "Mac-AF89B6D9451A490B", "FirmwareFeatures": "0xFD8FF576", - "SecureBootModel": "j185fap", - "CPU Generation": cpu_data.cpu_data.comet_lake, + "SecureBootModel": "j185f", + "CPU Generation": cpu_data.cpu_data.comet_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, + "iMac21,1": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j456", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": "Broadcom", + }, + + "iMac21,2": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j457", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": "Broadcom", + }, + + "iMacPro1,1": { "Board ID": "Mac-7BA5B2D9E42DDD94", "FirmwareFeatures": "0xFD8FF53E", - "SecureBootModel": "j137ap", - "CPU Generation": cpu_data.cpu_data.skylake, + "SecureBootModel": "j137", + "CPU Generation": cpu_data.cpu_data.skylake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -1405,7 +1461,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208DC8", "FirmwareFeatures": "0x80000015", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -1417,7 +1473,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208DA9", "FirmwareFeatures": "0xC0000015", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -1429,7 +1485,7 @@ smbios_dictionary = { "Board ID": "Mac-F42C88C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm43224, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, @@ -1442,7 +1498,7 @@ smbios_dictionary = { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE001F537", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": device_probe.Atheros.Chipsets.AirPortAtheros40, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1454,7 +1510,7 @@ smbios_dictionary = { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE80FE137", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.mojave, "Wireless Model": device_probe.Broadcom.Chipsets.AirPortBrcm4331, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, @@ -1465,7 +1521,7 @@ smbios_dictionary = { "Board ID": "Mac-F60DEB81FF30ACF6", "FirmwareFeatures": "0xE90FF576", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.ivy_bridge, + "CPU Generation": cpu_data.cpu_data.ivy_bridge.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, @@ -1475,8 +1531,8 @@ smbios_dictionary = { "MacPro7,1": { "Board ID": "Mac-27AD2F918AE68F61", "FirmwareFeatures": "0xFDAFF066", - "SecureBootModel": "j160ap", - "CPU Generation": cpu_data.cpu_data.coffee_lake, + "SecureBootModel": "j160", + "CPU Generation": cpu_data.cpu_data.coffee_lake.value, "Max OS Supported": os_data.os_data.max_os, "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, "Bluetooth Model": bluetooth_data.bluetooth_data.UART, @@ -1487,7 +1543,7 @@ smbios_dictionary = { "Board ID": "Mac-F4208AC8", "FirmwareFeatures": None, "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.conroe, + "CPU Generation": cpu_data.cpu_data.conroe.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, @@ -1499,7 +1555,7 @@ smbios_dictionary = { "Board ID": "Mac-F42289C8", "FirmwareFeatures": "0xC0001403", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.penryn, + "CPU Generation": cpu_data.cpu_data.penryn.value, "Max OS Supported": os_data.os_data.lion, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, @@ -1511,11 +1567,22 @@ smbios_dictionary = { "Board ID": "Mac-F223BEC8", "FirmwareFeatures": "0xE001F537", "SecureBootModel": None, - "CPU Generation": cpu_data.cpu_data.nehalem, + "CPU Generation": cpu_data.cpu_data.nehalem.value, "Max OS Supported": os_data.os_data.el_capitan, "Wireless Model": None, "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "Ethernet Chipset": "Intel 82574L", }, -} + "ADP3,2": { + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j293", + "CPU Generation": cpu_data.cpu_data.apple_dtk.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe, + "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, + "Ethernet Chipset": "Broadcom", + }, + +} \ No newline at end of file diff --git a/Resources/SysPatchArray.py b/Data/sys_patch_data.py similarity index 99% rename from Resources/SysPatchArray.py rename to Data/sys_patch_data.py index 75b40ab0a..509cd3080 100644 --- a/Resources/SysPatchArray.py +++ b/Data/sys_patch_data.py @@ -1,4 +1,4 @@ -# Lists Root patches used by SysPatch.py +# Lists Root patches used by sys_patch.py # Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk DeleteNvidiaAccel11 = [ "AMDRadeonX4000.kext", diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 04eb4021c..639215903 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,7 +7,7 @@ import subprocess import sys from pathlib import Path -from Resources import Build, CliMenu, Constants, ModelArray, SysPatch, Utilities, device_probe, os_probe, defaults, arguments +from Resources import Build, cli_menu, Constants, ModelArray, sys_patch, Utilities, device_probe, os_probe, defaults, arguments from Data import smbios_data, cpu_data class OpenCoreLegacyPatcher: @@ -43,156 +43,6 @@ class OpenCoreLegacyPatcher: def install_opencore(self): Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi() - def patcher_settings(self): - response = None - while not (response and response == -1): - title = ["Adjust Patcher Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - ["Debug Settings", self.patcher_setting_debug], - ["Security Settings", self.patcher_settings_security], - ["SMBIOS Settings", self.patcher_settings_smbios], - ["Boot Volume Settings", self.patcher_settings_boot], - ["Miscellaneous Settings", self.patcher_settings_misc], - ["Dump detected hardware", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).dump_hardware], - [ - f"Allow Accel on Mojave/Catalina:\tCurrently {self.constants.moj_cat_accel}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_moj_cat_patch, - ], - [ - f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_native_models, - ], - ["Advanced Settings, for developers only", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).advanced_patcher_settings], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def patcher_setting_debug(self): - response = None - while not (response and response == -1): - title = ["Adjust Debug Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - [f"Enable Verbose Mode:\tCurrently {self.constants.verbose_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_verbose], - [f"Enable OpenCore DEBUG:\tCurrently {self.constants.opencore_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_oc], - [f"Enable Kext DEBUG:\t\tCurrently {self.constants.kext_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_kext], - ] + ( - [ - [f"Set SurPlus Settings:\tCurrently {self.constants.force_surplus}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_surplus] - ] - if (smbios_data.smbios_dictionary[self.constants.custom_model or self.computer.real_model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge) - else [] - ) - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def patcher_settings_security(self): - response = None - while not (response and response == -1): - title = ["Adjust Security Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - # [ - # f"Set Apple Mobile File Integrity (AMFI):\tCurrently {self.constants.amfi_status}", - # CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_amfi, - # ], - [ - f"Set System Intrgity Protection (SIP):\tCurrently {self.constants.sip_status}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_sip, - ], - [ - f"Set Secure Boot Model (SBM):\t\tCurrently {self.constants.secure_status}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_sbm, - ], - [f"Set Vault Mode:\t\t\t\tCurrently {self.constants.vault}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_vault], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def patcher_settings_smbios(self): - response = None - while not (response and response == -1): - title = ["Adjust SMBIOS Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - [f"Set SMBIOS Spoof Level:\tCurrently {self.constants.serial_settings}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_serial], - [f"Set SMBIOS Spoof Model:\tCurrently {self.constants.override_smbios}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_smbios], - [f"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).custom_cpu], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def patcher_settings_boot(self): - response = None - while not (response and response == -1): - title = ["Adjust Bootable Volume Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - [f"Set FireWire Boot:\tCurrently {self.constants.firewire_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_firewire], - [f"Set NVMe Boot:\tCurrently {self.constants.nvme_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_nvme], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def patcher_settings_misc(self): - response = None - while not (response and response == -1): - title = ["Adjust Miscellaneous Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - [f"Set ShowPicker Mode:\tCurrently {self.constants.showpicker}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_showpicker], - [f"Set Wake on WLAN:\t\tCurrently {self.constants.enable_wake_on_wlan}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_wowl], - [f"Set Ivy iMac iGPU:\t\tCurrently {self.constants.allow_ivy_igpu}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_ivy], - [f"Set TeraScale 2 Accel:\tCurrently {self.constants.allow_ts2_accel}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).terascale_2_accel], - [ - f"Disable Thunderbolt:\tCurrently {self.constants.disable_tb}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).disable_tb, - ], - [f"Set AppleALC Usage:\t\tCurrently {self.constants.set_alc_usage}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).applealc_support], - [f"Set Windows GMUX support:\tCurrently {self.constants.dGPU_switch}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).dGPU_switch_support], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - - def advanced_patcher_settings(self): - response = None - while not (response and response == -1): - title = ["Adjust Advanced Patcher Settings, for developers ONLY"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) - options = [ - [f"Set Metal GPU Status:\t\tCurrently {self.constants.imac_vendor}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_metal], - [f"Set DRM Preferences:\t\tCurrently {self.constants.drm_support}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).drm_setting], - [f"Set Generic Bootstrap:\t\tCurrently {self.constants.boot_efi}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).bootstrap_setting], - [ - f"Disable CPU Friend:\t\t\tCurrently {self.constants.disallow_cpufriend}", - CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).disable_cpufriend, - ], - ] - - for option in options: - menu.add_menu_option(option[0], function=option[1]) - - response = menu.start() - def main_menu(self): response = None while not (response and response == -1): @@ -228,10 +78,10 @@ class OpenCoreLegacyPatcher: else [] ) + [ ["Install OpenCore to USB/internal drive", self.install_opencore], - ["Post-Install Volume Patch", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], - ["Change Model", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], - ["Patcher Settings", self.patcher_settings], - ["Credits", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], + ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], + ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], + ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], + ["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], ] for option in options: diff --git a/Resources/Build.py b/Resources/Build.py index 71b757b31..fa0606ee0 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -105,8 +105,8 @@ class BuildOpenCore: ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False), # CPU patches ("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model.startswith("MacPro") or self.model.startswith("Xserve")), - ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), - ("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn), + ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value), + ("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value), ( "CPUFriend.kext", self.constants.cpufriend_version, @@ -121,7 +121,7 @@ class BuildOpenCore: # IDE patch ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch), # Misc - ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake), + ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value), ("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True), ("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path, lambda: self.model in ["MacBook4,1", "MacBook5,2"]), ]: @@ -132,7 +132,7 @@ class BuildOpenCore: # Ethernet Patch Sets if smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Broadcom": - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value: # Required due to Big Sur's BCM5701 requiring VT-x support # Applicable for pre-Ivy Bridge models self.enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path) @@ -144,7 +144,7 @@ class BuildOpenCore: if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value: # Ref: https://github.com/reenigneorcim/SurPlus # Enable for all systems missing RDRAND support print("- Adding SurPlus Patch for Race Condition") @@ -301,18 +301,18 @@ class BuildOpenCore: self.get_kext_by_bundle_path("CPUFriendDataProvider.kext")["Enabled"] = True # HID patches - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value: print("- Adding IOHIDFamily patch") self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True # SSDT patches - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nehalem and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nehalem.value and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): # Applicable for consumer Nehalem print("- Adding SSDT-CPBG.aml") self.get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-CPBG.aml")["Enabled"] = True shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path) - if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge: + if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value: # Based on: https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/ # Applicable for Sandy and Ivy Bridge Macs print("- Enabling Windows 10 UEFI Audio support") @@ -422,7 +422,7 @@ class BuildOpenCore: if model.startswith("MacBook"): return False elif model.startswith("MacBookAir"): - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value: return False else: return True @@ -589,14 +589,14 @@ class BuildOpenCore: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) - elif self.computer.bluetooth_chipset == "BRCM20702 Hub" and smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] == bluetooth_data.bluetooth_data.BRCM20702_v1: + elif self.computer.bluetooth_chipset == "BRCM20702 Hub" and smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] == bluetooth_data.bluetooth_data.BRCM20702_v1.value: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) # smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] - elif smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1: + elif smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1.value: print("- Fixing Legacy Bluetooth for macOS Monterey") self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) - if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070: + if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value: self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) if self.constants.nvme_boot is True: @@ -612,7 +612,7 @@ class BuildOpenCore: self.get_efi_binary_by_path("OpenRuntime.efi", "UEFI", "Drivers")["Enabled"] = True self.get_efi_binary_by_path("OpenLinuxBoot.efi", "UEFI", "Drivers")["Enabled"] = True # Exfat check - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge: + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value: # Sandy Bridge and newer Macs natively support ExFat print("- Adding ExFatDxeLegacy.efi") shutil.copy(self.constants.exfat_legacy_driver_path, self.constants.drivers_path) @@ -706,7 +706,7 @@ class BuildOpenCore: # Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3) print("- Allowing FileVault on Root Patched systems") self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.filesystems.apfs")["Enabled"] = True - # Lets us check in SysPatch.py if config supports FileVault + # Lets us check in sys_patch.py if config supports FileVault self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv" def set_smbios(self): diff --git a/Resources/Constants.py b/Resources/Constants.py index 2c173e9f7..2be9badd6 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -658,13 +658,4 @@ class Constants: "Mac-937CB26E2E02BB01", # MacBookAir7,2 "Mac-35C5E08120C7EEAF", # Macmini7,1 "Mac-7BA5B2D9E42DDD94", # iMacPro1,1 - ] - - target_type = { - "ADP3,2": "J273", - "MacBookAir10,1": "J313", - "MacBookPro17,1": "J293", - "Macmini9,1": "J274", - "iMac21,1": "J256", - "iMac21,2": "J257", - } + ] \ No newline at end of file diff --git a/Resources/arguments.py b/Resources/arguments.py index d5787b74b..5193cc478 100644 --- a/Resources/arguments.py +++ b/Resources/arguments.py @@ -1,7 +1,8 @@ import argparse import sys import subprocess -from Resources import ModelArray, defaults, Build, ModelExample +from Resources import ModelArray, defaults, Build +from Data import example_data # Generic building args class arguments: @@ -30,7 +31,7 @@ class arguments: parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False) parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) - # SysPatch args + # sys_patch args parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) parser.add_argument("--validate", help="Runs Validation Tests for CI", action="store_true", required=False) @@ -38,10 +39,7 @@ class arguments: def check_cli(self): # If no core arguments are present, assume we're running in TUI - # - build - # - patch_sys_vol - # - unpatch_sys_vol - # - validate + # build, patch_sys_vol, unpatch_sys_vol, validate if not( self.args.build or self.args.patch_sys_vol or self.args.unpatch_sys_vol or self.args.validate ): @@ -50,6 +48,22 @@ class arguments: return True def parse_arguments(self, settings): + if self.args.model: + if self.args.model: + print(f"- Using custom model: {self.args.model}") + settings.custom_model = self.args.model + defaults.generate_defaults.probe(settings.custom_model, False, settings) + elif settings.computer.real_model not in ModelArray.SupportedSMBIOS and settings.allow_oc_everywhere is False: + print( + """Your model is not supported by this patcher for running unsupported OSes!" + +If you plan to create the USB for another machine, please select the "Change Model" option in the menu.""" + ) + sys.exit(1) + else: + print(f"- Using detected model: {settings.computer.real_model}") + defaults.generate_defaults.probe(settings.custom_model, True, settings) + if self.args.disk: print(f"- Install Disk set: {self.args.disk}") settings.disk = self.args.disk @@ -58,6 +72,8 @@ class arguments: if self.args.verbose: print("- Set verbose configuration") settings.verbose_debug = True + else: + settings.verbose_debug = False # Override Defaults detected if self.args.debug_oc: print("- Set OpenCore DEBUG configuration") settings.opencore_debug = True @@ -71,9 +87,13 @@ class arguments: if self.args.disable_sip: print("- Set Disable SIP configuration") settings.sip_status = False + else: + settings.sip_status = True # Override Defaults detected if self.args.disable_smb: print("- Set Disable SecureBootModel configuration") settings.secure_status = False + else: + settings.secure_status = True # Override Defaults detected if self.args.vault: print("- Set Vault configuration") settings.vault = True @@ -113,28 +133,10 @@ class arguments: settings.allow_oc_everywhere = True settings.serial_settings = "None" + # Avoid running the root patcher if we're just building if self.args.build: - if self.args.model: - print(f"- Using custom model: {self.args.model}") - settings.custom_model = self.args.model - #self.set_defaults(settings.custom_model, False) - defaults.generate_defaults.probe(settings.custom_model, False, settings) - #self.build_opencore() - Build.BuildOpenCore(settings.custom_model, settings).build_opencore() - elif settings.computer.real_model not in ModelArray.SupportedSMBIOS and settings.allow_oc_everywhere is False: - print( - """Your model is not supported by this patcher for running unsupported OSes!" - -If you plan to create the USB for another machine, please select the "Change Model" option in the menu.""" - ) - sys.exit(1) - else: - print(f"- Using detected model: {settings.computer.real_model}") - #self.set_defaults(settings.custom_model, True) - defaults.generate_defaults.probe(settings.custom_model, True, settings) - # self.build_opencore() - Build.BuildOpenCore(settings.custom_model, settings).build_opencore() - if self.args.patch_sys_vol: + Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + elif self.args.patch_sys_vol: if self.args.moj_cat_accel: print("- Set Mojave/Catalina root patch configuration") settings.moj_cat_accel = True @@ -148,48 +150,68 @@ If you plan to create the USB for another machine, please select the "Change Mod # Runs through ocvalidate to check for errors valid_dumps = [ - # ModelExample.MacBookPro.MacBookPro92_Stock, - # ModelExample.MacBookPro.MacBookPro171_Stock, - # ModelExample.Macmini.Macmini91_Stock, - #ModelExample.iMac.iMac81_Stock, - ModelExample.iMac.iMac112_Stock, - #ModelExample.iMac.iMac122_Upgraded, - ModelExample.MacPro.MacPro31_Stock, - ModelExample.MacPro.MacPro31_Upgrade, - ModelExample.MacPro.MacPro31_Modern_AMD, - ModelExample.MacPro.MacPro31_Modern_Kepler, - ModelExample.MacPro.MacPro41_Upgrade, - ModelExample.MacPro.MacPro41_Modern_AMD, - ModelExample.MacPro.MacPro41_51__Flashed_Modern_AMD, + example_data.MacBookPro.MacBookPro92_Stock, + # example_data.MacBookPro.MacBookPro171_Stock, + # example_data.Macmini.Macmini91_Stock, + example_data.iMac.iMac81_Stock, + example_data.iMac.iMac112_Stock, + example_data.iMac.iMac122_Upgraded, + example_data.MacPro.MacPro31_Stock, + example_data.MacPro.MacPro31_Upgrade, + example_data.MacPro.MacPro31_Modern_AMD, + example_data.MacPro.MacPro31_Modern_Kepler, + example_data.MacPro.MacPro41_Upgrade, + example_data.MacPro.MacPro41_Modern_AMD, + example_data.MacPro.MacPro41_51__Flashed_Modern_AMD, ] settings.validate = True + def build_prebuilt(): + for model in ModelArray.SupportedSMBIOS: + print(f"Validating predefined model: {model}") + settings.custom_model = model + Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {model}") + else: + print(f"Validation succeeded for predefined model: {model}") + + def build_dumps(): + for model in valid_dumps: + settings.computer = model + settings.custom_model = "" + print(f"Validating dumped model: {settings.computer.real_model}") + Build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {settings.computer.real_model}") + else: + print(f"Validation succeeded for predefined model: {settings.computer.real_model}") + + # First run is with default settings + build_prebuilt() + build_dumps() + # Second run, flip all settings + settings.verbose_debug = True + settings.opencore_debug = True + settings.opencore_build = "DEBUG" + settings.kext_debug = True + settings.showpicker = False + settings.sip_status = False + settings.secure_status = True + settings.firewire_boot = True + settings.nvme_boot = True + settings.enable_wake_on_wlan = True + settings.disable_tb = True + settings.force_surplus = True + build_prebuilt() + build_dumps() + - for model in ModelArray.SupportedSMBIOS: - print(f"Validating predefined model: {model}") - settings.custom_model = model - # self.build_opencore() - Build.BuildOpenCore(settings.custom_model, settings).build_opencore() - result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {model}") - else: - print(f"Validation succeeded for predefined model: {model}") - for model in valid_dumps: - settings.computer = model - # self.computer = settings.computer - settings.custom_model = "" - print(f"Validating dumped model: {settings.computer.real_model}") - # self.build_opencore() - Build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() - result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {settings.computer.real_model}") - else: - print(f"Validation succeeded for predefined model: {settings.computer.real_model}") diff --git a/Resources/CliMenu.py b/Resources/cli_menu.py similarity index 75% rename from Resources/CliMenu.py rename to Resources/cli_menu.py index a397c1e17..49b411559 100644 --- a/Resources/CliMenu.py +++ b/Resources/cli_menu.py @@ -3,7 +3,8 @@ from __future__ import print_function import subprocess -from Resources import Constants, Utilities, defaults, ModelArray, SysPatch +from Resources import Constants, Utilities, defaults, ModelArray, sys_patch +from Data import cpu_data, smbios_data class MenuOptions: @@ -760,9 +761,9 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' no_patch = True change_menu = input("Patch System Volume?: ") if no_patch is not True and change_menu == "1": - SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch() + sys_patch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch() elif no_patch is not True and change_menu == "2": - SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_unpatch() + sys_patch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_unpatch() else: print("Returning to main menu") @@ -785,6 +786,159 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' menu.add_menu_option(option[0], function=option[1]) response = menu.start() + + + def patcher_settings(self): + response = None + while not (response and response == -1): + title = ["Adjust Patcher Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + ["Debug Settings", self.patcher_setting_debug], + ["Security Settings", self.patcher_settings_security], + ["SMBIOS Settings", self.patcher_settings_smbios], + ["Boot Volume Settings", self.patcher_settings_boot], + ["Miscellaneous Settings", self.patcher_settings_misc], + ["Dump detected hardware", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).dump_hardware], + [ + f"Allow Accel on Mojave/Catalina:\tCurrently {self.constants.moj_cat_accel}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_moj_cat_patch, + ], + [ + f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_native_models, + ], + ["Advanced Settings, for developers only", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).advanced_patcher_settings], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def patcher_setting_debug(self): + response = None + while not (response and response == -1): + title = ["Adjust Debug Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Enable Verbose Mode:\tCurrently {self.constants.verbose_debug}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_verbose], + [f"Enable OpenCore DEBUG:\tCurrently {self.constants.opencore_debug}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_oc], + [f"Enable Kext DEBUG:\t\tCurrently {self.constants.kext_debug}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_kext], + ] + ( + [ + [f"Set SurPlus Settings:\tCurrently {self.constants.force_surplus}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_surplus] + ] + if (smbios_data.smbios_dictionary[self.constants.custom_model or self.constants.computer.real_model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge) + else [] + ) + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def patcher_settings_security(self): + response = None + while not (response and response == -1): + title = ["Adjust Security Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + # [ + # f"Set Apple Mobile File Integrity (AMFI):\tCurrently {self.constants.amfi_status}", + # MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_amfi, + # ], + [ + f"Set System Intrgity Protection (SIP):\tCurrently {self.constants.sip_status}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_sip, + ], + [ + f"Set Secure Boot Model (SBM):\t\tCurrently {self.constants.secure_status}", + MenuOptions(self.constants.custom_model or self.constant.computer.real_model, self.constants).change_sbm, + ], + [f"Set Vault Mode:\t\t\t\tCurrently {self.constants.vault}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_vault], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def patcher_settings_smbios(self): + response = None + while not (response and response == -1): + title = ["Adjust SMBIOS Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Set SMBIOS Spoof Level:\tCurrently {self.constants.serial_settings}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_serial], + [f"Set SMBIOS Spoof Model:\tCurrently {self.constants.override_smbios}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_smbios], + [f"Set Custom name {self.constants.custom_cpu_model_value}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).custom_cpu], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def patcher_settings_boot(self): + response = None + while not (response and response == -1): + title = ["Adjust Bootable Volume Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Set FireWire Boot:\tCurrently {self.constants.firewire_boot}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_firewire], + [f"Set NVMe Boot:\tCurrently {self.constants.nvme_boot}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_nvme], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def patcher_settings_misc(self): + response = None + while not (response and response == -1): + title = ["Adjust Miscellaneous Settings"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Set ShowPicker Mode:\tCurrently {self.constants.showpicker}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_showpicker], + [f"Set Wake on WLAN:\t\tCurrently {self.constants.enable_wake_on_wlan}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_wowl], + [f"Set Ivy iMac iGPU:\t\tCurrently {self.constants.allow_ivy_igpu}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_ivy], + [f"Set TeraScale 2 Accel:\tCurrently {self.constants.allow_ts2_accel}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).terascale_2_accel], + [ + f"Disable Thunderbolt:\tCurrently {self.constants.disable_tb}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).disable_tb, + ], + [f"Set AppleALC Usage:\t\tCurrently {self.constants.set_alc_usage}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).applealc_support], + [f"Set Windows GMUX support:\tCurrently {self.constants.dGPU_switch}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).dGPU_switch_support], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + def advanced_patcher_settings(self): + response = None + while not (response and response == -1): + title = ["Adjust Advanced Patcher Settings, for developers ONLY"] + menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + options = [ + [f"Set Metal GPU Status:\t\tCurrently {self.constants.imac_vendor}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_metal], + [f"Set DRM Preferences:\t\tCurrently {self.constants.drm_support}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).drm_setting], + [f"Set Generic Bootstrap:\t\tCurrently {self.constants.boot_efi}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).bootstrap_setting], + [ + f"Disable CPU Friend:\t\t\tCurrently {self.constants.disallow_cpufriend}", + MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).disable_cpufriend, + ], + ] + + for option in options: + menu.add_menu_option(option[0], function=option[1]) + + response = menu.start() + + big_sur = """Patches Root volume to fix misc issues such as: diff --git a/Resources/SysPatch.py b/Resources/sys_patch.py similarity index 92% rename from Resources/SysPatch.py rename to Resources/sys_patch.py index 410e2e10c..1d425a54b 100644 --- a/Resources/SysPatch.py +++ b/Resources/sys_patch.py @@ -11,8 +11,8 @@ import subprocess import zipfile from pathlib import Path -from Resources import Constants, device_probe, ModelArray, SysPatchArray, Utilities -from Data import sip_data +from Resources import Constants, device_probe, ModelArray, Utilities +from Data import sip_data, sys_patch_data class PatchSysVolume: @@ -109,7 +109,7 @@ class PatchSysVolume: input("- Press [ENTER] to exit: ") def backup_volume(self): - for location in SysPatchArray.BackupLocations: + for location in sys_patch_data.BackupLocations: Utilities.cls() print("Backing up root volume before patching (This may take some time)") print(f"- Attempting to backup {location}") @@ -155,7 +155,7 @@ class PatchSysVolume: if (Path(self.mount_location) / Path("/System/Library/Extensions-Backup.zip")).exists(): print("- Verified manual unpatching is available") - for location in SysPatchArray.BackupLocations: + for location in sys_patch_data.BackupLocations: Utilities.cls() print("Reverting root volume patches (This may take some time)") @@ -290,18 +290,18 @@ set million colour before rebooting""" Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_brightness_patch(self): - self.delete_old_binaries(SysPatchArray.DeleteBrightness) - self.add_new_binaries(SysPatchArray.AddBrightness, self.constants.legacy_brightness) + self.delete_old_binaries(sys_patch_data.DeleteBrightness) + self.add_new_binaries(sys_patch_data.AddBrightness, self.constants.legacy_brightness) self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE) Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_audio_patch(self): if self.model in ["iMac7,1", "iMac8,1"]: - self.delete_old_binaries(SysPatchArray.DeleteVolumeControl) - self.add_new_binaries(SysPatchArray.AddVolumeControl, self.constants.audio_path) + self.delete_old_binaries(sys_patch_data.DeleteVolumeControl) + self.add_new_binaries(sys_patch_data.AddVolumeControl, self.constants.audio_path) else: - self.add_new_binaries(SysPatchArray.AddVolumeControlv2, self.constants.audio_v2_path) + self.add_new_binaries(sys_patch_data.AddVolumeControlv2, self.constants.audio_v2_path) def add_wifi_patch(self): print("- Merging Wireless CoreSerices patches") @@ -314,103 +314,103 @@ set million colour before rebooting""" Utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_legacy_mux_patch(self): - self.delete_old_binaries(SysPatchArray.DeleteDemux) + self.delete_old_binaries(sys_patch_data.DeleteDemux) print("- Merging Legacy Mux Kext patches") Utilities.process_status(self.elevated(["cp", "-R", f"{self.constants.legacy_mux_path}/AppleMuxControl.kext", self.mount_extensions_mux], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def gpu_accel_legacy(self): if self.constants.detected_os == self.constants.mojave: print("- Installing General Acceleration Kext patches for Mojave") - self.add_new_binaries(SysPatchArray.AddGeneralAccelMojave, self.constants.legacy_general_path) + self.add_new_binaries(sys_patch_data.AddGeneralAccelMojave, self.constants.legacy_general_path) elif self.constants.detected_os == self.constants.catalina: print("- Installing General Acceleration Kext patches for Catalina") - self.add_new_binaries(SysPatchArray.AddGeneralAccelCatalina, self.constants.legacy_general_path) + self.add_new_binaries(sys_patch_data.AddGeneralAccelCatalina, self.constants.legacy_general_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey]: print("- Installing General Acceleration Kext patches for Big Sur/Monterey") - self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path) + self.add_new_binaries(sys_patch_data.AddGeneralAccel, self.constants.legacy_general_path) # Nvidia def gpu_accel_legacy_nvidia_master(self): if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]: print("- Installing Nvidia Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddNvidiaAccelLegacy, self.constants.legacy_nvidia_path) + self.add_new_binaries(sys_patch_data.AddNvidiaAccelLegacy, self.constants.legacy_nvidia_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey]: print("- Installing Nvidia Acceleration Kext patches for Big Sur/Monterey") - self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11) + self.delete_old_binaries(sys_patch_data.DeleteNvidiaAccel11) self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path) + self.add_new_binaries(sys_patch_data.AddNvidiaAccel11, self.constants.legacy_nvidia_path) if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0: # Beta 7+ removes NVDAStartup - self.add_new_binaries(SysPatchArray.AddNvidiaTeslaAccel12, self.constants.legacy_nvidia_kepler_path) + self.add_new_binaries(sys_patch_data.AddNvidiaTeslaAccel12, self.constants.legacy_nvidia_kepler_path) else: print("- Installing basic Nvidia Framebuffer Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddNvidiaBrightness, self.constants.legacy_nvidia_path) + self.add_new_binaries(sys_patch_data.AddNvidiaBrightness, self.constants.legacy_nvidia_path) # AMD/ATI def gpu_accel_legacy_ts1_master(self): if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]: print("- Installing TeraScale 1 Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddAMDAccelLegacy, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDAccelLegacy, self.constants.legacy_amd_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey]: print("- Installing TeraScale 1 Acceleration Kext patches for Big Sur/Monterey") - self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11) + self.delete_old_binaries(sys_patch_data.DeleteAMDAccel11) self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDAccel11, self.constants.legacy_amd_path) else: print("- Installing basic TeraScale 1 Framebuffer Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddAMDBrightness, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDBrightness, self.constants.legacy_amd_path) def gpu_accel_legacy_ts2_master(self): if self.constants.detected_os in [self.constants.mojave, self.constants.catalina] and self.constants.allow_ts2_accel is True: print("- Installing TeraScale 2 Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddAMDAccelLegacy, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDAccelLegacy, self.constants.legacy_amd_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey] and self.constants.allow_ts2_accel is True: # TODO: Enable for Monterey when acceleration patches proress print("- Installing TeraScale 2 Acceleration Kext patches for Big Sur") - self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11) - self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11TS2) + self.delete_old_binaries(sys_patch_data.DeleteAMDAccel11) + self.delete_old_binaries(sys_patch_data.DeleteAMDAccel11TS2) self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDAccel11, self.constants.legacy_amd_path) else: print("- Installing basic TeraScale 2 Framebuffer Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddAMDBrightness, self.constants.legacy_amd_path) + self.add_new_binaries(sys_patch_data.AddAMDBrightness, self.constants.legacy_amd_path) # Intel def gpu_accel_legacy_ironlake_master(self): if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]: print("- Installing Ironlake Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) + self.add_new_binaries(sys_patch_data.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey]: print("- Installing Ironlake Acceleration Kext patches for Big Sur/Monterey") - self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11) + self.delete_old_binaries(sys_patch_data.DeleteNvidiaAccel11) self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) + self.add_new_binaries(sys_patch_data.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) else: print("- Installing basic Ironlake Framebuffer Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) + self.add_new_binaries(sys_patch_data.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path) def gpu_accel_legacy_sandybridge_master(self): if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]: print("- Installing Sandy Bridge Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) + self.add_new_binaries(sys_patch_data.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey]: print("- Installing Sandy Bridge Acceleration Kext patches for Big Sur/Monterey") - self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11) + self.delete_old_binaries(sys_patch_data.DeleteNvidiaAccel11) self.gpu_accel_legacy() - self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) + self.add_new_binaries(sys_patch_data.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) else: print("- Installing basic Sandy Bridge Framebuffer Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) + self.add_new_binaries(sys_patch_data.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) def gpu_framebuffer_ivybridge_master(self): if self.constants.detected_os == self.constants.monterey: print("- Installing IvyBridge Acceleration Kext patches for Monterey") - self.add_new_binaries(SysPatchArray.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) + self.add_new_binaries(sys_patch_data.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) if self.validate is False: print("- Fixing Acceleration in CoreMedia") Utilities.process_status(subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "enable"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) @@ -420,15 +420,15 @@ set million colour before rebooting""" self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ivy}/", self.mount_private_frameworks], stdout=subprocess.PIPE) else: print("- Installing basic Ivy Bridge Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) + self.add_new_binaries(sys_patch_data.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) def gpu_framebuffer_kepler_master(self): if self.constants.detected_os == self.constants.monterey: print("- Installing Kepler Acceleration Kext patches for Monterey") - self.add_new_binaries(SysPatchArray.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) + self.add_new_binaries(sys_patch_data.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) else: print("- Installing Kepler Kext patches for generic OS") - self.add_new_binaries(SysPatchArray.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) + self.add_new_binaries(sys_patch_data.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) def gpu_accel_legacy_extended(self): print("- Merging general legacy Frameworks") @@ -532,7 +532,7 @@ set million colour before rebooting""" if self.amd_ts2 is True and self.constants.detected_os in self.constants.legacy_accel_support and self.constants.allow_ts2_accel is True: # TeraScale 2 patches must be installed after Intel HD3000 - self.add_new_binaries(SysPatchArray.AddAMDAccel11TS2, self.constants.legacy_amd_path_ts2) + self.add_new_binaries(sys_patch_data.AddAMDAccel11TS2, self.constants.legacy_amd_path_ts2) if self.added_legacy_kexts is True and self.constants.detected_os in self.constants.legacy_accel_support: self.gpu_accel_legacy_extended() From b9a5ba7897c38cbd15b643df168d744a3e0a5101 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 13:31:19 -0600 Subject: [PATCH 11/30] Rename to tmp folders Work around git not checking case --- {Data => data-tmp}/bluetooth_data.py | 0 {Data => data-tmp}/cpu_data.py | 0 {Data => data-tmp}/example_data.py | 0 {Data => data-tmp}/os_data.py | 0 {Data => data-tmp}/pci_data.py | 0 {Data => data-tmp}/sip_data.py | 0 {Data => data-tmp}/smbios_data.py | 0 {Data => data-tmp}/sys_patch_data.py | 0 {Resources => resources-tmp}/Build.py | 0 {Resources => resources-tmp}/Constants.py | 0 {Resources => resources-tmp}/ModelArray.py | 0 {Resources => resources-tmp}/Utilities.py | 0 {Resources => resources-tmp}/__init__.py | 0 {Resources => resources-tmp}/arguments.py | 0 {Resources => resources-tmp}/cli_menu.py | 0 {Resources => resources-tmp}/defaults.py | 0 {Resources => resources-tmp}/device_probe.py | 0 {Resources => resources-tmp}/generate_smbios.py | 0 {Resources => resources-tmp}/ioreg.py | 0 {Resources => resources-tmp}/mount_root.py | 0 {Resources => resources-tmp}/os_probe.py | 0 {Resources => resources-tmp}/sys_patch.py | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {Data => data-tmp}/bluetooth_data.py (100%) rename {Data => data-tmp}/cpu_data.py (100%) rename {Data => data-tmp}/example_data.py (100%) rename {Data => data-tmp}/os_data.py (100%) rename {Data => data-tmp}/pci_data.py (100%) rename {Data => data-tmp}/sip_data.py (100%) rename {Data => data-tmp}/smbios_data.py (100%) rename {Data => data-tmp}/sys_patch_data.py (100%) rename {Resources => resources-tmp}/Build.py (100%) rename {Resources => resources-tmp}/Constants.py (100%) rename {Resources => resources-tmp}/ModelArray.py (100%) rename {Resources => resources-tmp}/Utilities.py (100%) rename {Resources => resources-tmp}/__init__.py (100%) rename {Resources => resources-tmp}/arguments.py (100%) rename {Resources => resources-tmp}/cli_menu.py (100%) rename {Resources => resources-tmp}/defaults.py (100%) rename {Resources => resources-tmp}/device_probe.py (100%) rename {Resources => resources-tmp}/generate_smbios.py (100%) rename {Resources => resources-tmp}/ioreg.py (100%) rename {Resources => resources-tmp}/mount_root.py (100%) rename {Resources => resources-tmp}/os_probe.py (100%) rename {Resources => resources-tmp}/sys_patch.py (100%) diff --git a/Data/bluetooth_data.py b/data-tmp/bluetooth_data.py similarity index 100% rename from Data/bluetooth_data.py rename to data-tmp/bluetooth_data.py diff --git a/Data/cpu_data.py b/data-tmp/cpu_data.py similarity index 100% rename from Data/cpu_data.py rename to data-tmp/cpu_data.py diff --git a/Data/example_data.py b/data-tmp/example_data.py similarity index 100% rename from Data/example_data.py rename to data-tmp/example_data.py diff --git a/Data/os_data.py b/data-tmp/os_data.py similarity index 100% rename from Data/os_data.py rename to data-tmp/os_data.py diff --git a/Data/pci_data.py b/data-tmp/pci_data.py similarity index 100% rename from Data/pci_data.py rename to data-tmp/pci_data.py diff --git a/Data/sip_data.py b/data-tmp/sip_data.py similarity index 100% rename from Data/sip_data.py rename to data-tmp/sip_data.py diff --git a/Data/smbios_data.py b/data-tmp/smbios_data.py similarity index 100% rename from Data/smbios_data.py rename to data-tmp/smbios_data.py diff --git a/Data/sys_patch_data.py b/data-tmp/sys_patch_data.py similarity index 100% rename from Data/sys_patch_data.py rename to data-tmp/sys_patch_data.py diff --git a/Resources/Build.py b/resources-tmp/Build.py similarity index 100% rename from Resources/Build.py rename to resources-tmp/Build.py diff --git a/Resources/Constants.py b/resources-tmp/Constants.py similarity index 100% rename from Resources/Constants.py rename to resources-tmp/Constants.py diff --git a/Resources/ModelArray.py b/resources-tmp/ModelArray.py similarity index 100% rename from Resources/ModelArray.py rename to resources-tmp/ModelArray.py diff --git a/Resources/Utilities.py b/resources-tmp/Utilities.py similarity index 100% rename from Resources/Utilities.py rename to resources-tmp/Utilities.py diff --git a/Resources/__init__.py b/resources-tmp/__init__.py similarity index 100% rename from Resources/__init__.py rename to resources-tmp/__init__.py diff --git a/Resources/arguments.py b/resources-tmp/arguments.py similarity index 100% rename from Resources/arguments.py rename to resources-tmp/arguments.py diff --git a/Resources/cli_menu.py b/resources-tmp/cli_menu.py similarity index 100% rename from Resources/cli_menu.py rename to resources-tmp/cli_menu.py diff --git a/Resources/defaults.py b/resources-tmp/defaults.py similarity index 100% rename from Resources/defaults.py rename to resources-tmp/defaults.py diff --git a/Resources/device_probe.py b/resources-tmp/device_probe.py similarity index 100% rename from Resources/device_probe.py rename to resources-tmp/device_probe.py diff --git a/Resources/generate_smbios.py b/resources-tmp/generate_smbios.py similarity index 100% rename from Resources/generate_smbios.py rename to resources-tmp/generate_smbios.py diff --git a/Resources/ioreg.py b/resources-tmp/ioreg.py similarity index 100% rename from Resources/ioreg.py rename to resources-tmp/ioreg.py diff --git a/Resources/mount_root.py b/resources-tmp/mount_root.py similarity index 100% rename from Resources/mount_root.py rename to resources-tmp/mount_root.py diff --git a/Resources/os_probe.py b/resources-tmp/os_probe.py similarity index 100% rename from Resources/os_probe.py rename to resources-tmp/os_probe.py diff --git a/Resources/sys_patch.py b/resources-tmp/sys_patch.py similarity index 100% rename from Resources/sys_patch.py rename to resources-tmp/sys_patch.py From e33997320b8f77a4a718b909ae3e7c575e72ae33 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 13:35:01 -0600 Subject: [PATCH 12/30] Use snake nameing scheme --- OpenCore-Patcher.command | 4 ++-- OpenCore-Patcher.spec | 2 +- create-offline-build.py | 2 +- {data-tmp => data}/bluetooth_data.py | 0 {data-tmp => data}/cpu_data.py | 0 {data-tmp => data}/example_data.py | 2 +- {data-tmp => data}/os_data.py | 0 {data-tmp => data}/pci_data.py | 0 {data-tmp => data}/sip_data.py | 0 {data-tmp => data}/smbios_data.py | 4 ++-- {data-tmp => data}/sys_patch_data.py | 0 merge_gui.py | 2 +- {resources-tmp => resources}/Build.py | 4 ++-- {resources-tmp => resources}/Constants.py | 2 +- {resources-tmp => resources}/ModelArray.py | 0 {resources-tmp => resources}/Utilities.py | 4 ++-- {resources-tmp => resources}/__init__.py | 0 {resources-tmp => resources}/arguments.py | 4 ++-- {resources-tmp => resources}/cli_menu.py | 4 ++-- {resources-tmp => resources}/defaults.py | 2 +- {resources-tmp => resources}/device_probe.py | 4 ++-- {resources-tmp => resources}/generate_smbios.py | 4 ++-- {resources-tmp => resources}/ioreg.py | 0 {resources-tmp => resources}/mount_root.py | 4 ++-- {resources-tmp => resources}/os_probe.py | 0 {resources-tmp => resources}/sys_patch.py | 4 ++-- 26 files changed, 26 insertions(+), 26 deletions(-) rename {data-tmp => data}/bluetooth_data.py (100%) rename {data-tmp => data}/cpu_data.py (100%) rename {data-tmp => data}/example_data.py (99%) rename {data-tmp => data}/os_data.py (100%) rename {data-tmp => data}/pci_data.py (100%) rename {data-tmp => data}/sip_data.py (100%) rename {data-tmp => data}/smbios_data.py (99%) rename {data-tmp => data}/sys_patch_data.py (100%) rename {resources-tmp => resources}/Build.py (99%) rename {resources-tmp => resources}/Constants.py (99%) rename {resources-tmp => resources}/ModelArray.py (100%) rename {resources-tmp => resources}/Utilities.py (99%) rename {resources-tmp => resources}/__init__.py (100%) rename {resources-tmp => resources}/arguments.py (99%) rename {resources-tmp => resources}/cli_menu.py (99%) rename {resources-tmp => resources}/defaults.py (98%) rename {resources-tmp => resources}/device_probe.py (99%) rename {resources-tmp => resources}/generate_smbios.py (97%) rename {resources-tmp => resources}/ioreg.py (100%) rename {resources-tmp => resources}/mount_root.py (91%) rename {resources-tmp => resources}/os_probe.py (100%) rename {resources-tmp => resources}/sys_patch.py (99%) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 639215903..6ff2847e6 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,8 +7,8 @@ import subprocess import sys from pathlib import Path -from Resources import Build, cli_menu, Constants, ModelArray, sys_patch, Utilities, device_probe, os_probe, defaults, arguments -from Data import smbios_data, cpu_data +from resources import Build, cli_menu, Constants, ModelArray, sys_patch, Utilities, device_probe, os_probe, defaults, arguments +from data import smbios_data, cpu_data class OpenCoreLegacyPatcher: def __init__(self): diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index 4bf2756ab..48fe40bb0 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -1,7 +1,7 @@ # -*- mode: python ; coding: utf-8 -*- import sys, os sys.path.append(os.path.abspath(os.getcwd())) -from Resources import Constants +from resources import Constants block_cipher = None diff --git a/create-offline-build.py b/create-offline-build.py index b22cb8335..8da2e917b 100644 --- a/create-offline-build.py +++ b/create-offline-build.py @@ -1,5 +1,5 @@ import subprocess -from Resources import Constants +from resources import Constants patcher_support_pkg_version = Constants.Constants().patcher_support_pkg_version binary_packages = ["10.14-Mojave", "10.15-Catalina", "11-Big-Sur", "12-Monterey"] diff --git a/data-tmp/bluetooth_data.py b/data/bluetooth_data.py similarity index 100% rename from data-tmp/bluetooth_data.py rename to data/bluetooth_data.py diff --git a/data-tmp/cpu_data.py b/data/cpu_data.py similarity index 100% rename from data-tmp/cpu_data.py rename to data/cpu_data.py diff --git a/data-tmp/example_data.py b/data/example_data.py similarity index 99% rename from data-tmp/example_data.py rename to data/example_data.py index d332376ed..dbb5e576a 100644 --- a/data-tmp/example_data.py +++ b/data/example_data.py @@ -1,6 +1,6 @@ # Example Hardware probe of multiple models # To be used when running validation tests -from Resources import device_probe +from resources import device_probe class MacBook: diff --git a/data-tmp/os_data.py b/data/os_data.py similarity index 100% rename from data-tmp/os_data.py rename to data/os_data.py diff --git a/data-tmp/pci_data.py b/data/pci_data.py similarity index 100% rename from data-tmp/pci_data.py rename to data/pci_data.py diff --git a/data-tmp/sip_data.py b/data/sip_data.py similarity index 100% rename from data-tmp/sip_data.py rename to data/sip_data.py diff --git a/data-tmp/smbios_data.py b/data/smbios_data.py similarity index 99% rename from data-tmp/smbios_data.py rename to data/smbios_data.py index d0a85723c..ec1cd696e 100644 --- a/data-tmp/smbios_data.py +++ b/data/smbios_data.py @@ -1,7 +1,7 @@ # Defines Model Data -from Resources import device_probe -from Data import cpu_data, os_data, bluetooth_data +from resources import device_probe +from data import cpu_data, os_data, bluetooth_data smbios_dictionary = { "MacBook1,1": { diff --git a/data-tmp/sys_patch_data.py b/data/sys_patch_data.py similarity index 100% rename from data-tmp/sys_patch_data.py rename to data/sys_patch_data.py diff --git a/merge_gui.py b/merge_gui.py index d26acc93e..0b2f74d2e 100644 --- a/merge_gui.py +++ b/merge_gui.py @@ -2,7 +2,7 @@ # Copyright (C) 2021 Mykola Grymalyuk import plistlib from pathlib import Path -from Resources import Constants +from resources import Constants app_path = Path.cwd() / Path ("OpenCore Patcher.app/Contents/Info.plist") info = plistlib.load(Path(app_path).open("rb")) diff --git a/resources-tmp/Build.py b/resources/Build.py similarity index 99% rename from resources-tmp/Build.py rename to resources/Build.py index fa0606ee0..7f8589001 100644 --- a/resources-tmp/Build.py +++ b/resources/Build.py @@ -14,8 +14,8 @@ import ast from pathlib import Path from datetime import date -from Resources import Constants, ModelArray, Utilities, device_probe, generate_smbios -from Data import smbios_data, bluetooth_data, cpu_data, os_data +from resources import Constants, ModelArray, Utilities, device_probe, generate_smbios +from data import smbios_data, bluetooth_data, cpu_data, os_data def rmtree_handler(func, path, exc_info): diff --git a/resources-tmp/Constants.py b/resources/Constants.py similarity index 99% rename from resources-tmp/Constants.py rename to resources/Constants.py index 2be9badd6..110ee6883 100644 --- a/resources-tmp/Constants.py +++ b/resources/Constants.py @@ -7,7 +7,7 @@ from __future__ import print_function from pathlib import Path from typing import Optional -from Resources import device_probe +from resources import device_probe class Constants: diff --git a/resources-tmp/ModelArray.py b/resources/ModelArray.py similarity index 100% rename from resources-tmp/ModelArray.py rename to resources/ModelArray.py diff --git a/resources-tmp/Utilities.py b/resources/Utilities.py similarity index 99% rename from resources-tmp/Utilities.py rename to resources/Utilities.py index 2e02c23d0..6aec3590f 100644 --- a/resources-tmp/Utilities.py +++ b/resources/Utilities.py @@ -20,8 +20,8 @@ except ImportError: except ImportError: raise Exception("Missing requests library!\nPlease run the following before starting OCLP:\npip3 install requests") -from Resources import Constants, ioreg, device_probe -from Data import sip_data +from resources import Constants, ioreg, device_probe +from data import sip_data def hexswap(input_hex: str): diff --git a/resources-tmp/__init__.py b/resources/__init__.py similarity index 100% rename from resources-tmp/__init__.py rename to resources/__init__.py diff --git a/resources-tmp/arguments.py b/resources/arguments.py similarity index 99% rename from resources-tmp/arguments.py rename to resources/arguments.py index 5193cc478..29be47b4b 100644 --- a/resources-tmp/arguments.py +++ b/resources/arguments.py @@ -1,8 +1,8 @@ import argparse import sys import subprocess -from Resources import ModelArray, defaults, Build -from Data import example_data +from resources import ModelArray, defaults, Build +from data import example_data # Generic building args class arguments: diff --git a/resources-tmp/cli_menu.py b/resources/cli_menu.py similarity index 99% rename from resources-tmp/cli_menu.py rename to resources/cli_menu.py index 49b411559..4ed189820 100644 --- a/resources-tmp/cli_menu.py +++ b/resources/cli_menu.py @@ -3,8 +3,8 @@ from __future__ import print_function import subprocess -from Resources import Constants, Utilities, defaults, ModelArray, sys_patch -from Data import cpu_data, smbios_data +from resources import Constants, Utilities, defaults, ModelArray, sys_patch +from data import cpu_data, smbios_data class MenuOptions: diff --git a/resources-tmp/defaults.py b/resources/defaults.py similarity index 98% rename from resources-tmp/defaults.py rename to resources/defaults.py index 94f6d0aec..f5686303e 100644 --- a/resources-tmp/defaults.py +++ b/resources/defaults.py @@ -1,5 +1,5 @@ # Generate Default Data -from Resources import Utilities, device_probe, ModelArray +from resources import Utilities, device_probe, ModelArray class generate_defaults(): def probe(model, host_is_target, settings): diff --git a/resources-tmp/device_probe.py b/resources/device_probe.py similarity index 99% rename from resources-tmp/device_probe.py rename to resources/device_probe.py index e2f06c38d..287aaa7fa 100644 --- a/resources-tmp/device_probe.py +++ b/resources/device_probe.py @@ -10,8 +10,8 @@ import subprocess from dataclasses import dataclass, field from typing import Any, ClassVar, Optional, Type, Union -from Resources import Utilities, ioreg -from Data import pci_data +from resources import Utilities, ioreg +from data import pci_data @dataclass diff --git a/resources-tmp/generate_smbios.py b/resources/generate_smbios.py similarity index 97% rename from resources-tmp/generate_smbios.py rename to resources/generate_smbios.py index 5a8732b14..5b9b34220 100644 --- a/resources-tmp/generate_smbios.py +++ b/resources/generate_smbios.py @@ -1,5 +1,5 @@ -from Data import smbios_data, os_data -from Resources import Utilities +from data import smbios_data, os_data +from resources import Utilities def set_smbios_model_spoof(model): try: diff --git a/resources-tmp/ioreg.py b/resources/ioreg.py similarity index 100% rename from resources-tmp/ioreg.py rename to resources/ioreg.py diff --git a/resources-tmp/mount_root.py b/resources/mount_root.py similarity index 91% rename from resources-tmp/mount_root.py rename to resources/mount_root.py index bcaf282e8..b433344ef 100644 --- a/resources-tmp/mount_root.py +++ b/resources/mount_root.py @@ -1,6 +1,6 @@ # Logic for mounting root volume -from Data import os_data -from Resources import Utilities +from data import os_data +from resources import Utilities import plistlib import subprocess diff --git a/resources-tmp/os_probe.py b/resources/os_probe.py similarity index 100% rename from resources-tmp/os_probe.py rename to resources/os_probe.py diff --git a/resources-tmp/sys_patch.py b/resources/sys_patch.py similarity index 99% rename from resources-tmp/sys_patch.py rename to resources/sys_patch.py index 1d425a54b..b040048f2 100644 --- a/resources-tmp/sys_patch.py +++ b/resources/sys_patch.py @@ -11,8 +11,8 @@ import subprocess import zipfile from pathlib import Path -from Resources import Constants, device_probe, ModelArray, Utilities -from Data import sip_data, sys_patch_data +from resources import Constants, device_probe, ModelArray, Utilities +from data import sip_data, sys_patch_data class PatchSysVolume: From a70b18dd50e92afc70e173a5d008f842a0444789 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 13:54:12 -0600 Subject: [PATCH 13/30] Convert additional files to snake naming scheme --- .github/workflows/build-app-offline.yml | 2 +- .github/workflows/build-app.yml | 2 +- .github/workflows/build-gui.yml | 6 ++-- OpenCore-Patcher.command | 18 ++++------ OpenCore-Patcher.spec | 2 +- after_pyinstaller.sh | 2 +- .../ModelArray.py => data/model_array.py | 0 OC-Patcher.icns => payloads/OC-Patcher.icns | Bin .../entitlements.plist | 0 launcher.sh => payloads/launcher.sh | 0 resources/Build.py | 34 +++++++++--------- resources/Constants.py | 2 +- resources/arguments.py | 10 +++--- resources/cli_menu.py | 8 ++--- resources/defaults.py | 9 ++--- resources/sys_patch.py | 8 ++--- 16 files changed, 50 insertions(+), 53 deletions(-) rename resources/ModelArray.py => data/model_array.py (100%) rename OC-Patcher.icns => payloads/OC-Patcher.icns (100%) rename entitlements.plist => payloads/entitlements.plist (100%) rename launcher.sh => payloads/launcher.sh (100%) diff --git a/.github/workflows/build-app-offline.yml b/.github/workflows/build-app-offline.yml index f5e22b465..1d3d6ecef 100644 --- a/.github/workflows/build-app-offline.yml +++ b/.github/workflows/build-app-offline.yml @@ -15,7 +15,7 @@ jobs: - run: python3 create-offline-build.py - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; zip -r ../OpenCore-Patcher-TUI-Offline.app.zip OpenCore-Patcher.app - name: Upload App to Artifacts uses: actions/upload-artifact@v2 diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index d8d4f83e8..3a8014e6a 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app - run: ./../sign-tui.sh - name: Upload App to Artifacts diff --git a/.github/workflows/build-gui.yml b/.github/workflows/build-gui.yml index ec48c357d..815db9c7f 100644 --- a/.github/workflows/build-gui.yml +++ b/.github/workflows/build-gui.yml @@ -22,9 +22,9 @@ jobs: - name: Merge new GUI run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/ - run: python3 merge_gui.py - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"' - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' - - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"' + - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "OpenCore Patcher.app"' - run: ditto -c -k --sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip - run: ./../sign-gui.sh - name: Upload GUI to Artifacts diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 6ff2847e6..ecddb8703 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,8 +7,8 @@ import subprocess import sys from pathlib import Path -from resources import Build, cli_menu, Constants, ModelArray, sys_patch, Utilities, device_probe, os_probe, defaults, arguments -from data import smbios_data, cpu_data +from resources import Build, cli_menu, Constants, Utilities, device_probe, os_probe, defaults, arguments +from data import model_array class OpenCoreLegacyPatcher: def __init__(self): @@ -37,12 +37,6 @@ class OpenCoreLegacyPatcher: else: print("- No arguments present, loading TUI") - def build_opencore(self): - Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore() - - def install_opencore(self): - Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi() - def main_menu(self): response = None while not (response and response == -1): @@ -51,7 +45,7 @@ class OpenCoreLegacyPatcher: f"Selected Model: {self.constants.custom_model or self.computer.real_model}", ] - if (self.constants.custom_model or self.computer.real_model) not in ModelArray.SupportedSMBIOS and self.constants.allow_oc_everywhere is False: + if (self.constants.custom_model or self.computer.real_model) not in model_array.SupportedSMBIOS and self.constants.allow_oc_everywhere is False: in_between = [ "Your model is not supported by this patcher for running unsupported OSes!", "", @@ -73,11 +67,11 @@ class OpenCoreLegacyPatcher: menu = Utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) options = ( - [["Build OpenCore", self.build_opencore]] - if ((self.constants.custom_model or self.computer.real_model) in ModelArray.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True + [["Build OpenCore", Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] + if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True else [] ) + [ - ["Install OpenCore to USB/internal drive", self.install_opencore], + ["Install OpenCore to USB/internal drive", Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()], ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index 48fe40bb0..2a1f0e5ef 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -35,7 +35,7 @@ exe = EXE(pyz, console=True ) app = BUNDLE(exe, name='OpenCore-Patcher.app', - icon="OC-Patcher.icns", + icon="payloads/OC-Patcher.icns", bundle_identifier=None, info_plist={ "CFBundleShortVersionString": Constants.Constants().patcher_version, diff --git a/after_pyinstaller.sh b/after_pyinstaller.sh index 306e08f43..abeffa7ff 100755 --- a/after_pyinstaller.sh +++ b/after_pyinstaller.sh @@ -1,2 +1,2 @@ #!/bin/sh -cp launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher \ No newline at end of file +cp paylods/launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher \ No newline at end of file diff --git a/resources/ModelArray.py b/data/model_array.py similarity index 100% rename from resources/ModelArray.py rename to data/model_array.py diff --git a/OC-Patcher.icns b/payloads/OC-Patcher.icns similarity index 100% rename from OC-Patcher.icns rename to payloads/OC-Patcher.icns diff --git a/entitlements.plist b/payloads/entitlements.plist similarity index 100% rename from entitlements.plist rename to payloads/entitlements.plist diff --git a/launcher.sh b/payloads/launcher.sh similarity index 100% rename from launcher.sh rename to payloads/launcher.sh diff --git a/resources/Build.py b/resources/Build.py index 7f8589001..0a31383fc 100644 --- a/resources/Build.py +++ b/resources/Build.py @@ -14,8 +14,8 @@ import ast from pathlib import Path from datetime import date -from resources import Constants, ModelArray, Utilities, device_probe, generate_smbios -from data import smbios_data, bluetooth_data, cpu_data, os_data +from resources import Constants, Utilities, device_probe, generate_smbios +from data import smbios_data, bluetooth_data, cpu_data, os_data, model_array def rmtree_handler(func, path, exc_info): @@ -99,7 +99,7 @@ class BuildOpenCore: # Essential kexts ("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path, lambda: True), ("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path, lambda: self.constants.allow_oc_everywhere is False), - ("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in ModelArray.MacPro), + ("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in model_array.MacPro), # Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching ("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path, lambda: self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1"]), ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False), @@ -117,9 +117,9 @@ class BuildOpenCore: ("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia"), ("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvell"), # Legacy audio - ("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: (self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro) and self.constants.set_alc_usage is True), + ("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: (self.model in model_array.LegacyAudio or self.model in model_array.MacPro) and self.constants.set_alc_usage is True), # IDE patch - ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch), + ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in model_array.IDEPatch), # Misc ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value), ("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True), @@ -157,7 +157,7 @@ class BuildOpenCore: self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["MaxKernel"] = "" self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["MaxKernel"] = "" - if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in ModelArray.MacPro): + if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in model_array.MacPro): # Use Innie's same logic: # https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97 for i, controller in enumerate(self.computer.storage): @@ -327,7 +327,7 @@ class BuildOpenCore: usb_map_path.exists() and self.constants.allow_oc_everywhere is False and self.model not in ["Xserve2,1", "Dortania1,1"] - and (self.model in ModelArray.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) + and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) ): print("- Adding USB-Map.kext") Path(self.constants.map_kext_folder).mkdir() @@ -347,7 +347,7 @@ class BuildOpenCore: elif self.model == "MacBookPro10,1": self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696"} - if self.model not in ModelArray.NoAGPMSupport: + if self.model not in model_array.NoAGPMSupport: print("- Adding AppleGraphicsPowerManagement Override") agpm_map_path = Path(self.constants.plist_folder_path) / Path("AppleGraphicsPowerManagement/Info.plist") Path(self.constants.agpm_kext_folder).mkdir() @@ -355,7 +355,7 @@ class BuildOpenCore: shutil.copy(agpm_map_path, self.constants.agpm_contents_folder) self.get_kext_by_bundle_path("AGPM-Override.kext")["Enabled"] = True - if self.model in ModelArray.AGDPSupport: + if self.model in model_array.AGDPSupport: print("- Adding AppleGraphicsDevicePolicy Override") agdp_map_path = Path(self.constants.plist_folder_path) / Path("AppleGraphicsDevicePolicy/Info.plist") Path(self.constants.agdp_kext_folder).mkdir() @@ -364,7 +364,7 @@ class BuildOpenCore: self.get_kext_by_bundle_path("AGDP-Override.kext")["Enabled"] = True # AGPM Patch - if self.model in ModelArray.DualGPUPatch: + if self.model in model_array.DualGPUPatch: print("- Adding dual GPU patch") if not self.constants.custom_model and self.computer.dgpu and self.computer.dgpu.pci_path: self.gfx0_path = self.computer.dgpu.pci_path @@ -374,7 +374,7 @@ class BuildOpenCore: print("- Failed to find GFX0 Device path, falling back on known logic") self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)" - if self.model in ModelArray.IntelNvidiaDRM and self.constants.drm_support is True: + if self.model in model_array.IntelNvidiaDRM and self.constants.drm_support is True: print("- Prioritizing DRM support over Intel QuickSync") self.config["DeviceProperties"]["Add"][self.gfx0_path] = {"agdpmod": "vit9696", "shikigva": 256} self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = { @@ -518,7 +518,7 @@ class BuildOpenCore: nvidia_patch(self, self.gfx0_path) else: print("- Failed to find vendor") - elif not self.constants.custom_model and self.model in ModelArray.LegacyGPU and self.computer.dgpu: + elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu: print(f"- Detected dGPU: {Utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{Utilities.friendly_hex(self.computer.dgpu.device_id)}") if self.computer.dgpu.arch in [ device_probe.AMD.Archs.Legacy_GCN, @@ -531,7 +531,7 @@ class BuildOpenCore: elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: backlight_path_detection(self) nvidia_patch(self, self.gfx0_path) - if self.model in ModelArray.MacPro: + if self.model in model_array.MacPro: if not self.constants.custom_model: for i, device in enumerate(self.computer.gpus): print(f"- Found dGPU ({i + 1}): {Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}") @@ -627,7 +627,7 @@ class BuildOpenCore: pass # ThirdPartDrives Check - if self.model in ModelArray.SATAPatch and self.constants.allow_oc_everywhere is False: + if self.model in model_array.SATAPatch and self.constants.allow_oc_everywhere is False: print("- Adding SATA Hibernation Patch") self.config["Kernel"]["Quirks"]["ThirdPartyDrives"] = True @@ -811,7 +811,7 @@ class BuildOpenCore: if ( self.constants.allow_oc_everywhere is False and self.model not in ["Xserve2,1", "Dortania1,1"] - and (self.model in ModelArray.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) + and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"]) ): new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist") map_config = plistlib.load(Path(new_map_ls).open("rb")) @@ -851,7 +851,7 @@ class BuildOpenCore: if not entry.startswith(self.spoofed_board): amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"].pop(entry) plistlib.dump(amc_config, Path(new_amc_ls).open("wb"), sort_keys=True) - if self.model not in ModelArray.NoAGPMSupport: + if self.model not in model_array.NoAGPMSupport: new_agpm_ls = Path(self.constants.agpm_contents_folder) / Path("Info.plist") agpm_config = plistlib.load(Path(new_agpm_ls).open("rb")) agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board] = agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(self.model) @@ -868,7 +868,7 @@ class BuildOpenCore: agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(entry) plistlib.dump(agpm_config, Path(new_agpm_ls).open("wb"), sort_keys=True) - if self.model in ModelArray.AGDPSupport: + if self.model in model_array.AGDPSupport: new_agdp_ls = Path(self.constants.agdp_contents_folder) / Path("Info.plist") agdp_config = plistlib.load(Path(new_agdp_ls).open("rb")) agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"][self.spoofed_board] = agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"].pop( diff --git a/resources/Constants.py b/resources/Constants.py index 110ee6883..fc4d05461 100644 --- a/resources/Constants.py +++ b/resources/Constants.py @@ -474,7 +474,7 @@ class Constants: # Icons @property def app_icon_path(self): - return self.current_path / Path("OC-Patcher.icns") + return self.payload_path / Path("OC-Patcher.icns") @property def icon_path_external(self): diff --git a/resources/arguments.py b/resources/arguments.py index 29be47b4b..04fb67087 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -1,8 +1,8 @@ import argparse import sys import subprocess -from resources import ModelArray, defaults, Build -from data import example_data +from resources import defaults, Build +from data import example_data, model_array # Generic building args class arguments: @@ -34,6 +34,8 @@ class arguments: # sys_patch args parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) + + # validation args parser.add_argument("--validate", help="Runs Validation Tests for CI", action="store_true", required=False) self.args = parser.parse_args() @@ -53,7 +55,7 @@ class arguments: print(f"- Using custom model: {self.args.model}") settings.custom_model = self.args.model defaults.generate_defaults.probe(settings.custom_model, False, settings) - elif settings.computer.real_model not in ModelArray.SupportedSMBIOS and settings.allow_oc_everywhere is False: + elif settings.computer.real_model not in model_array.SupportedSMBIOS and settings.allow_oc_everywhere is False: print( """Your model is not supported by this patcher for running unsupported OSes!" @@ -166,7 +168,7 @@ If you plan to create the USB for another machine, please select the "Change Mod ] settings.validate = True def build_prebuilt(): - for model in ModelArray.SupportedSMBIOS: + for model in model_array.SupportedSMBIOS: print(f"Validating predefined model: {model}") settings.custom_model = model Build.BuildOpenCore(settings.custom_model, settings).build_opencore() diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 4ed189820..4c3388634 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -3,8 +3,8 @@ from __future__ import print_function import subprocess -from resources import Constants, Utilities, defaults, ModelArray, sys_patch -from data import cpu_data, smbios_data +from resources import Constants, Utilities, defaults, sys_patch +from data import cpu_data, smbios_data, model_array class MenuOptions: @@ -732,7 +732,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' """ ) self.constants.custom_model = input("Please enter the model identifier of the target machine: ").strip() - if self.constants.custom_model not in ModelArray.SupportedSMBIOS: + if self.constants.custom_model not in model_array.SupportedSMBIOS: print( f""" {self.constants.custom_model} is not a valid SMBIOS Identifier for macOS {self.constants.os_support}! @@ -740,7 +740,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' ) print_models = input(f"Print list of valid options for macOS {self.constants.os_support}? (y/n)") if print_models.lower() in {"y", "yes"}: - print("\n".join(ModelArray.SupportedSMBIOS)) + print("\n".join(model_array.SupportedSMBIOS)) input("\nPress [ENTER] to continue") else: defaults.generate_defaults.probe(self.constants.custom_model, False, self.constants) diff --git a/resources/defaults.py b/resources/defaults.py index f5686303e..d0cac51e8 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -1,5 +1,6 @@ # Generate Default Data -from resources import Utilities, device_probe, ModelArray +from resources import Utilities, device_probe +from data import model_array class generate_defaults(): def probe(model, host_is_target, settings): @@ -22,10 +23,10 @@ class generate_defaults(): ) or (isinstance(settings.computer.wifi, device_probe.Atheros) and settings.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): settings.sip_status = False settings.allow_fv_root = True # Allow FileVault on broken seal - elif model in ModelArray.LegacyGPU: + elif model in model_array.LegacyGPU: settings.disable_cs_lv = True - if model in ModelArray.LegacyGPU: + if model in model_array.LegacyGPU: if host_is_target and Utilities.check_metal_support(device_probe, settings.computer) is True: # Building on device and we have a native, supported GPU if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: @@ -41,7 +42,7 @@ class generate_defaults(): settings.secure_status = False # Root volume modified settings.amfi_status = False # Unsigned binaries settings.allow_fv_root = True # Allow FileVault on broken seal - if model in ModelArray.ModernGPU: + if model in model_array.ModernGPU: # Systems with Ivy or Kepler GPUs, Monterey requires root patching for accel settings.sip_status = False # Unsigned kexts settings.secure_status = False # Modified root volume diff --git a/resources/sys_patch.py b/resources/sys_patch.py index b040048f2..51f07c91e 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -11,8 +11,8 @@ import subprocess import zipfile from pathlib import Path -from resources import Constants, device_probe, ModelArray, Utilities -from data import sip_data, sys_patch_data +from resources import Constants, device_probe, Utilities +from data import sip_data, sys_patch_data, model_array class PatchSysVolume: @@ -689,11 +689,11 @@ set million colour before rebooting""" def detect_patch_set(self): self.detect_gpus() - if self.model in ModelArray.LegacyBrightness: + if self.model in model_array.LegacyBrightness: if self.constants.detected_os > self.constants.catalina: self.brightness_legacy = True - if self.model in ["iMac7,1", "iMac8,1"] or (self.model in ModelArray.LegacyAudio and Utilities.check_kext_loaded("AppleALC", self.constants.detected_os) is False): + if self.model in ["iMac7,1", "iMac8,1"] or (self.model in model_array.LegacyAudio and Utilities.check_kext_loaded("AppleALC", self.constants.detected_os) is False): # Special hack for systems with botched GOPs # TL;DR: No Boot Screen breaks Lilu, therefore breaking audio if self.constants.detected_os > self.constants.catalina: From a980ba95f97db8402ef64a192d7e6cdbb442f973 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 13:57:17 -0600 Subject: [PATCH 14/30] Fix typo --- after_pyinstaller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after_pyinstaller.sh b/after_pyinstaller.sh index abeffa7ff..d3fa4929e 100755 --- a/after_pyinstaller.sh +++ b/after_pyinstaller.sh @@ -1,2 +1,2 @@ #!/bin/sh -cp paylods/launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher \ No newline at end of file +cp payloads/launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher \ No newline at end of file From 2164463e3b6bec0a359f92b9911c2a3de99bac01 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:09:40 -0600 Subject: [PATCH 15/30] Tmp --- resources/{Constants.py => Constants-tmp.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename resources/{Constants.py => Constants-tmp.py} (100%) diff --git a/resources/Constants.py b/resources/Constants-tmp.py similarity index 100% rename from resources/Constants.py rename to resources/Constants-tmp.py From a2f73a7bdcc220f9d2f2036d4c22903e4a844dff Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:10:56 -0600 Subject: [PATCH 16/30] Adjust Constants to python scheme --- .flake8 | 2 +- OpenCore-Patcher.command | 4 ++-- OpenCore-Patcher.spec | 4 ++-- create-offline-build.py | 4 ++-- merge_gui.py | 4 ++-- resources/Build.py | 4 ++-- resources/Utilities.py | 10 +++++----- resources/cli_menu.py | 4 ++-- resources/{Constants-tmp.py => constants.py} | 0 resources/sys_patch.py | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) rename resources/{Constants-tmp.py => constants.py} (100%) diff --git a/.flake8 b/.flake8 index 81016e515..e9d577c62 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,4 @@ [flake8] extend-ignore = E501, E203 per-file-ignores = - Resources/Constants.py:E704 \ No newline at end of file + Resources/constants.py:E704 \ No newline at end of file diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index ecddb8703..cbf102178 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,13 +7,13 @@ import subprocess import sys from pathlib import Path -from resources import Build, cli_menu, Constants, Utilities, device_probe, os_probe, defaults, arguments +from resources import Build, cli_menu, constants, Utilities, device_probe, os_probe, defaults, arguments from data import model_array class OpenCoreLegacyPatcher: def __init__(self): print("- Loading...") - self.constants = Constants.Constants() + self.constants = constants.Constants() self.generate_base_data() if arguments.arguments().check_cli() is False: self.main_menu() diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index 2a1f0e5ef..199793d77 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -1,7 +1,7 @@ # -*- mode: python ; coding: utf-8 -*- import sys, os sys.path.append(os.path.abspath(os.getcwd())) -from resources import Constants +from resources import constants block_cipher = None @@ -38,7 +38,7 @@ app = BUNDLE(exe, icon="payloads/OC-Patcher.icns", bundle_identifier=None, info_plist={ - "CFBundleShortVersionString": Constants.Constants().patcher_version, + "CFBundleShortVersionString": constants.Constants().patcher_version, "CFBundleExecutable": "MacOS/Launcher", "NSHumanReadableCopyright": "Copyright 2020-2021 Dortania" }) \ No newline at end of file diff --git a/create-offline-build.py b/create-offline-build.py index 8da2e917b..43059621e 100644 --- a/create-offline-build.py +++ b/create-offline-build.py @@ -1,7 +1,7 @@ import subprocess -from resources import Constants +from resources import constants -patcher_support_pkg_version = Constants.Constants().patcher_support_pkg_version +patcher_support_pkg_version = constants.Constants().patcher_support_pkg_version binary_packages = ["10.14-Mojave", "10.15-Catalina", "11-Big-Sur", "12-Monterey"] for binary_package in binary_packages: diff --git a/merge_gui.py b/merge_gui.py index 0b2f74d2e..86f3605af 100644 --- a/merge_gui.py +++ b/merge_gui.py @@ -2,9 +2,9 @@ # Copyright (C) 2021 Mykola Grymalyuk import plistlib from pathlib import Path -from resources import Constants +from resources import constants app_path = Path.cwd() / Path ("OpenCore Patcher.app/Contents/Info.plist") info = plistlib.load(Path(app_path).open("rb")) -info["CFBundleShortVersionString"] = Constants.Constants().patcher_version +info["CFBundleShortVersionString"] = constants.Constants().patcher_version plistlib.dump(info, Path(app_path).open("wb"), sort_keys=True) \ No newline at end of file diff --git a/resources/Build.py b/resources/Build.py index 0a31383fc..5b73eef40 100644 --- a/resources/Build.py +++ b/resources/Build.py @@ -14,7 +14,7 @@ import ast from pathlib import Path from datetime import date -from resources import Constants, Utilities, device_probe, generate_smbios +from resources import constants, Utilities, device_probe, generate_smbios from data import smbios_data, bluetooth_data, cpu_data, os_data, model_array @@ -28,7 +28,7 @@ class BuildOpenCore: def __init__(self, model, versions): self.model = model self.config = None - self.constants: Constants.Constants = versions + self.constants: constants.Constants = versions self.computer = self.constants.computer self.gfx0_path = None diff --git a/resources/Utilities.py b/resources/Utilities.py index 6aec3590f..75cb4e935 100644 --- a/resources/Utilities.py +++ b/resources/Utilities.py @@ -20,7 +20,7 @@ except ImportError: except ImportError: raise Exception("Missing requests library!\nPlease run the following before starting OCLP:\npip3 install requests") -from resources import Constants, ioreg, device_probe +from resources import constants, ioreg from data import sip_data @@ -130,7 +130,7 @@ def amfi_status(): return True def check_kext_loaded(kext_name, os_version): - if os_version > Constants.Constants().catalina: + if os_version > constants.Constants().catalina: kext_loaded = subprocess.run(["kmutil", "showloaded", "--list-only", "--variant-suffix", "release"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: kext_loaded = subprocess.run(["kextstat", "-l"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) @@ -188,19 +188,19 @@ def patching_status(os_sip, os): gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext" gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext" - if os > Constants.Constants().catalina: + if os > constants.Constants().catalina: amfi_enabled = amfi_status() else: # Catalina and older supports individually disabling Library Validation amfi_enabled = False - if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in Constants.Constants.sbm_values: + if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in constants.Constants.sbm_values: sbm_enabled = False if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False), os_sip) is False: sip_enabled = False - if os > Constants.Constants().catalina and not check_filevault_skip(): + if os > constants.Constants().catalina and not check_filevault_skip(): # Assume non-OCLP Macs do not have our APFS seal patch fv_status: str = subprocess.run("fdesetup status".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() if "FileVault is Off" in fv_status: diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 4c3388634..dff213814 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -3,14 +3,14 @@ from __future__ import print_function import subprocess -from resources import Constants, Utilities, defaults, sys_patch +from resources import constants, Utilities, defaults, sys_patch from data import cpu_data, smbios_data, model_array class MenuOptions: def __init__(self, model, versions): self.model = model - self.constants: Constants.Constants = versions + self.constants: constants.Constants() = versions def change_verbose(self): Utilities.cls() diff --git a/resources/Constants-tmp.py b/resources/constants.py similarity index 100% rename from resources/Constants-tmp.py rename to resources/constants.py diff --git a/resources/sys_patch.py b/resources/sys_patch.py index 51f07c91e..4d433bcaf 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -11,14 +11,14 @@ import subprocess import zipfile from pathlib import Path -from resources import Constants, device_probe, Utilities +from resources import constants, device_probe, Utilities from data import sip_data, sys_patch_data, model_array class PatchSysVolume: def __init__(self, model, versions): self.model = model - self.constants: Constants.Constants = versions + self.constants: constants.Constants() = versions self.computer = self.constants.computer self.root_mount_path = None self.sip_enabled = True From 8e1923ee21791e957bb0160969430024ad208894 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:11:20 -0600 Subject: [PATCH 17/30] Tmp --- resources/{Utilities.py => utilities-tmp.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename resources/{Utilities.py => utilities-tmp.py} (100%) diff --git a/resources/Utilities.py b/resources/utilities-tmp.py similarity index 100% rename from resources/Utilities.py rename to resources/utilities-tmp.py From 8a6faa0836845acbe5c7761f71cd9769d1e5dd3b Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:12:11 -0600 Subject: [PATCH 18/30] Adjust utilities to py scheme --- OpenCore-Patcher.command | 6 +- resources/Build.py | 42 +++--- resources/cli_menu.py | 140 +++++++++---------- resources/defaults.py | 16 +-- resources/device_probe.py | 14 +- resources/generate_smbios.py | 4 +- resources/mount_root.py | 2 +- resources/sys_patch.py | 82 +++++------ resources/{utilities-tmp.py => utilities.py} | 0 9 files changed, 153 insertions(+), 153 deletions(-) rename resources/{utilities-tmp.py => utilities.py} (100%) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index cbf102178..011db0737 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,7 +7,7 @@ import subprocess import sys from pathlib import Path -from resources import Build, cli_menu, constants, Utilities, device_probe, os_probe, defaults, arguments +from resources import Build, cli_menu, constants, utilities, device_probe, os_probe, defaults, arguments from data import model_array class OpenCoreLegacyPatcher: @@ -23,7 +23,7 @@ class OpenCoreLegacyPatcher: self.constants.detected_os_minor = os_probe.detect_kernel_minor() self.constants.detected_os_build = os_probe.detect_kernel_build() self.constants.computer = device_probe.Computer.probe() - self.constants.recovery_status = Utilities.check_recovery() + self.constants.recovery_status = utilities.check_recovery() self.computer = self.constants.computer defaults.generate_defaults.probe(self.computer.real_model, True, self.constants) if arguments.arguments().check_cli() is True: @@ -64,7 +64,7 @@ class OpenCoreLegacyPatcher: else: in_between = ["This model is supported"] - menu = Utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) options = ( [["Build OpenCore", Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] diff --git a/resources/Build.py b/resources/Build.py index 5b73eef40..ea4e8664f 100644 --- a/resources/Build.py +++ b/resources/Build.py @@ -14,7 +14,7 @@ import ast from pathlib import Path from datetime import date -from resources import constants, Utilities, device_probe, generate_smbios +from resources import constants, utilities, device_probe, generate_smbios from data import smbios_data, bluetooth_data, cpu_data, os_data, model_array @@ -55,7 +55,7 @@ class BuildOpenCore: shutil.copy(self.constants.icon_path_internal, self.constants.opencore_release_folder) def build_efi(self): - Utilities.cls() + utilities.cls() if not self.constants.custom_model: print(f"Building Configuration on model: {self.model}") else: @@ -174,8 +174,8 @@ class BuildOpenCore: if not self.constants.custom_model: nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)] for i, controller in enumerate(nvme_devices): - print(f"- Found 3rd Party NVMe SSD ({i + 1}): {Utilities.friendly_hex(controller.vendor_id)}:{Utilities.friendly_hex(controller.device_id)}") - self.config["#Revision"][f"Hardware-NVMe-{i}"] = f"{Utilities.friendly_hex(controller.vendor_id)}:{Utilities.friendly_hex(controller.device_id)}" + print(f"- Found 3rd Party NVMe SSD ({i + 1}): {utilities.friendly_hex(controller.vendor_id)}:{utilities.friendly_hex(controller.device_id)}") + self.config["#Revision"][f"Hardware-NVMe-{i}"] = f"{utilities.friendly_hex(controller.vendor_id)}:{utilities.friendly_hex(controller.device_id)}" # Disable Bit 0 (L0s), enable Bit 1 (L1) nvme_aspm = (controller.aspm & (~0b11)) | 0b10 @@ -231,8 +231,8 @@ class BuildOpenCore: # TODO: -a is not supported in Lion and older, need to add proper fix if self.constants.detected_os > self.constants.lion and not self.constants.custom_model: if self.computer.wifi: - print(f"- Found Wireless Device {Utilities.friendly_hex(self.computer.wifi.vendor_id)}:{Utilities.friendly_hex(self.computer.wifi.device_id)}") - self.config["#Revision"]["Hardware-Wifi"] = f"{Utilities.friendly_hex(self.computer.wifi.vendor_id)}:{Utilities.friendly_hex(self.computer.wifi.device_id)}" + print(f"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}") + self.config["#Revision"]["Hardware-Wifi"] = f"{utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}" else: print("- Unable to run Wireless hardware detection") @@ -519,7 +519,7 @@ class BuildOpenCore: else: print("- Failed to find vendor") elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu: - print(f"- Detected dGPU: {Utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{Utilities.friendly_hex(self.computer.dgpu.device_id)}") + print(f"- Detected dGPU: {utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{utilities.friendly_hex(self.computer.dgpu.device_id)}") if self.computer.dgpu.arch in [ device_probe.AMD.Archs.Legacy_GCN, device_probe.AMD.Archs.Polaris, @@ -534,8 +534,8 @@ class BuildOpenCore: if self.model in model_array.MacPro: if not self.constants.custom_model: for i, device in enumerate(self.computer.gpus): - print(f"- Found dGPU ({i + 1}): {Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}") - self.config["#Revision"][f"Hardware-MacPro-dGPU-{i + 1}"] = f"{Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}" + print(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}") + self.config["#Revision"][f"Hardware-MacPro-dGPU-{i + 1}"] = f"{utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}" if device.pci_path and device.acpi_path: print(f"- Found dGPU ({i + 1}) at {device.pci_path}") @@ -734,7 +734,7 @@ class BuildOpenCore: # fw_feature = self.patch_firmware_feature() fw_feature = hex(fw_feature).lstrip("0x").rstrip("L").strip() print(f"- Setting Firmware Feature: {fw_feature}") - fw_feature = Utilities.string_to_hex(fw_feature) + fw_feature = utilities.string_to_hex(fw_feature) # FirmwareFeatures self.config["PlatformInfo"]["PlatformNVRAM"]["FirmwareFeatures"] = fw_feature @@ -973,11 +973,11 @@ class BuildOpenCore: input("Press [Enter] to go back.\n") def copy_efi(self): - Utilities.cls() - Utilities.header(["Installing OpenCore to Drive"]) + utilities.cls() + utilities.header(["Installing OpenCore to Drive"]) if not self.constants.opencore_release_folder.exists(): - Utilities.TUIOnlyPrint( + utilities.TUIOnlyPrint( ["Installing OpenCore to Drive"], "Press [Enter] to go back.\n", [ @@ -1013,7 +1013,7 @@ Please build OpenCore first!""" # Avoid crashing with CDs installed continue # TODO: Advanced mode - menu = Utilities.TUIMenu( + menu = utilities.TUIMenu( ["Select Disk"], "Please select the disk you would like to install OpenCore to: ", in_between=["Missing disks? Ensure they have an EFI or FAT32 partition."], @@ -1023,7 +1023,7 @@ Please build OpenCore first!""" for disk in all_disks: if not any(all_disks[disk]["partitions"][partition]["fs"] in ("msdos", "EFI") for partition in all_disks[disk]["partitions"]): continue - menu.add_menu_option(f"{disk}: {all_disks[disk]['name']} ({Utilities.human_fmt(all_disks[disk]['size'])})", key=disk[4:]) + menu.add_menu_option(f"{disk}: {all_disks[disk]['name']} ({utilities.human_fmt(all_disks[disk]['size'])})", key=disk[4:]) response = menu.start() @@ -1033,7 +1033,7 @@ Please build OpenCore first!""" disk_identifier = "disk" + response selected_disk = all_disks[disk_identifier] - menu = Utilities.TUIMenu( + menu = utilities.TUIMenu( ["Select Partition"], "Please select the partition you would like to install OpenCore to: ", return_number_instead_of_direct_call=True, @@ -1043,7 +1043,7 @@ Please build OpenCore first!""" for partition in selected_disk["partitions"]: if selected_disk["partitions"][partition]["fs"] not in ("msdos", "EFI"): continue - text = f"{partition}: {selected_disk['partitions'][partition]['name']} ({Utilities.human_fmt(selected_disk['partitions'][partition]['size'])})" + text = f"{partition}: {selected_disk['partitions'][partition]['name']} ({utilities.human_fmt(selected_disk['partitions'][partition]['size'])})" if selected_disk["partitions"][partition]["type"] == "EFI" or ( selected_disk["partitions"][partition]["type"] == "Microsoft Basic Data" and selected_disk["partitions"][partition]["size"] < 1024 * 1024 * 512 ): # 512 megabytes: @@ -1075,7 +1075,7 @@ Please build OpenCore first!""" # cancelled prompt return else: - Utilities.TUIOnlyPrint( + utilities.TUIOnlyPrint( ["Copying OpenCore"], "Press [Enter] to go back.\n", ["An error occurred!"] + result.stderr.decode().split("\n") + ["", "Please report this to the devs at GitHub."] ).start() return @@ -1090,8 +1090,8 @@ Please build OpenCore first!""" ssd_type = False mount_path = Path(partition_info["MountPoint"]) disk_type = partition_info["BusProtocol"] - Utilities.cls() - Utilities.header(["Copying OpenCore"]) + utilities.cls() + utilities.header(["Copying OpenCore"]) if mount_path.exists(): if (mount_path / Path("EFI/Microsoft")).exists(): @@ -1148,4 +1148,4 @@ Please build OpenCore first!""" print("\nPress [Enter] to continue.\n") input() else: - Utilities.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to go back.\n", ["EFI failed to mount!", "Please report this to the devs at GitHub."]).start() + utilities.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to go back.\n", ["EFI failed to mount!", "Please report this to the devs at GitHub."]).start() diff --git a/resources/cli_menu.py b/resources/cli_menu.py index dff213814..1bad0433c 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -3,7 +3,7 @@ from __future__ import print_function import subprocess -from resources import constants, Utilities, defaults, sys_patch +from resources import constants, utilities, defaults, sys_patch from data import cpu_data, smbios_data, model_array @@ -13,8 +13,8 @@ class MenuOptions: self.constants: constants.Constants() = versions def change_verbose(self): - Utilities.cls() - Utilities.header(["Set Verbose mode"]) + utilities.cls() + utilities.header(["Set Verbose mode"]) change_menu = input("Enable Verbose mode(y/n/q): ") if change_menu in {"y", "Y", "yes", "Yes"}: self.constants.verbose_debug = True @@ -26,8 +26,8 @@ class MenuOptions: self.change_verbose() def change_oc(self): - Utilities.cls() - Utilities.header(["Set OpenCore DEBUG mode"]) + utilities.cls() + utilities.header(["Set OpenCore DEBUG mode"]) change_menu = input("Enable OpenCore DEBUG mode(y/n/q): ") if change_menu in {"y", "Y", "yes", "Yes"}: self.constants.opencore_debug = True @@ -41,8 +41,8 @@ class MenuOptions: self.change_oc() def change_kext(self): - Utilities.cls() - Utilities.header(["Set Kext DEBUG mode"]) + utilities.cls() + utilities.header(["Set Kext DEBUG mode"]) change_menu = input("Enable Kext DEBUG mode(y/n/q): ") if change_menu in {"y", "Y", "yes", "Yes"}: self.constants.kext_debug = True @@ -54,8 +54,8 @@ class MenuOptions: self.change_kext() def change_metal(self): - Utilities.cls() - Utilities.header(["Assume Metal GPU Always in iMac"]) + utilities.cls() + utilities.header(["Assume Metal GPU Always in iMac"]) print( """This is for iMacs that have upgraded Metal GPUs, otherwise Patcher assumes based on stock configuration (ie. iMac10,x-12,x) @@ -87,8 +87,8 @@ option is for those patching on a different machine or OCLP cannot detect. self.change_metal() def change_serial(self): - Utilities.cls() - Utilities.header(["Set SMBIOS Spoof Level"]) + utilities.cls() + utilities.header(["Set SMBIOS Spoof Level"]) print( """This section is for setting how OpenCore generates the SMBIOS Recommended for adanced users who want control how serials are handled @@ -116,8 +116,8 @@ Note: For new users we recommend leaving as default(1. Minimal) self.change_serial() def change_showpicker(self): - Utilities.cls() - Utilities.header(["Set OpenCore Picker mode"]) + utilities.cls() + utilities.header(["Set OpenCore Picker mode"]) print( """By default, OpenCore will show its boot picker each time on boot up, however this can be disabled by default and be shown on command by repeatedly @@ -135,8 +135,8 @@ pressing the "Esc" key self.change_showpicker() def change_vault(self): - Utilities.cls() - Utilities.header(["Set OpenCore Vaulting"]) + utilities.cls() + utilities.header(["Set OpenCore Vaulting"]) print( """By default, this patcher will sign all your files and ensure none of the contents can be tampered with. However for more advanced users, you may @@ -157,8 +157,8 @@ Note: For security reasons, OpenShell will be disabled when Vault is set. self.change_vault() def change_sip(self): - Utilities.cls() - Utilities.header(["Set System Integrity protection"]) + utilities.cls() + utilities.header(["Set System Integrity protection"]) print( """SIP is used to ensure proper secuirty measures are set, however to patch the root volume this must be disabled. @@ -183,8 +183,8 @@ Q. Return to previous menu self.change_sip() def change_sbm(self): - Utilities.cls() - Utilities.header(["Set SecureBootModel"]) + utilities.cls() + utilities.header(["Set SecureBootModel"]) print( """SecureBootModel is used to ensure best firmware security, however to patch the root volume this must be disabled. @@ -209,8 +209,8 @@ Q. Return to previous menu self.change_sbm() def set_amfi(self): - Utilities.cls() - Utilities.header(["Set AMFI"]) + utilities.cls() + utilities.header(["Set AMFI"]) print( """Required for Root Patching non-Metal GPUs in macOS Big Sur. Without this, will receive kernel panic once @@ -228,8 +228,8 @@ Patcher finishes installing legacy acceleration patches. self.set_amfi() def bootstrap_setting(self): - Utilities.cls() - Utilities.header(["Set Bootstrap method"]) + utilities.cls() + utilities.header(["Set Bootstrap method"]) print( """Sets OpenCore's bootstrap method, currently the patcher supports the following options. @@ -259,8 +259,8 @@ see the EFI Boot entry in the boot picker. self.bootstrap_setting() def drm_setting(self): - Utilities.cls() - Utilities.header(["Set DRM preferences"]) + utilities.cls() + utilities.header(["Set DRM preferences"]) print( """Sets OpenCore's DRM preferences for iMac13,x and iMac14,x. In Big Sur, some DRM based content may be broken by @@ -285,8 +285,8 @@ Recommend only disabling if absolutely required. self.drm_setting() def allow_native_models(self): - Utilities.cls() - Utilities.header(["Allow OpenCore on native Models"]) + utilities.cls() + utilities.header(["Allow OpenCore on native Models"]) print( """Allows natively supported Macs to use OpenCore. Recommended for users with 3rd Party NVMe SSDs to achieve improved overall @@ -307,8 +307,8 @@ power usage. self.allow_native_models() def custom_cpu(self): - Utilities.cls() - Utilities.header(["Set custom CPU Model Name"]) + utilities.cls() + utilities.header(["Set custom CPU Model Name"]) print( """Change reported CPU Model name in About This Mac Custom names will report as follows: @@ -342,8 +342,8 @@ Q. Return to previous menu self.custom_cpu() def disable_cpufriend(self): - Utilities.cls() - Utilities.header(["Disable CPU Friend?"]) + utilities.cls() + utilities.header(["Disable CPU Friend?"]) print( """Only recommended for advanced users Disabling CPUFriend forces macOS into using a different @@ -362,8 +362,8 @@ hardware self.disable_cpufriend() def set_smbios(self): - Utilities.cls() - Utilities.header(["Set SMBIOS Spoof Model"]) + utilities.cls() + utilities.header(["Set SMBIOS Spoof Model"]) print( """Change model OpenCore spoofs Mac too @@ -396,8 +396,8 @@ Q. Return to previous menu self.set_smbios() def allow_firewire(self): - Utilities.cls() - Utilities.header(["Allow FireWire Boot Support"]) + utilities.cls() + utilities.header(["Allow FireWire Boot Support"]) print( """ In macOS Catalina and newer, Apple restricted @@ -423,8 +423,8 @@ Note: MacBook5,x-7,1 don't support FireWire boot self.allow_firewire() def allow_nvme(self): - Utilities.cls() - Utilities.header(["Allow NVMe UEFI Support"]) + utilities.cls() + utilities.header(["Allow NVMe UEFI Support"]) print( """ For machines not natively supporting NVMe, @@ -450,8 +450,8 @@ OpenCore will enable NVMe support in it's picker self.allow_nvme() def allow_wowl(self): - Utilities.cls() - Utilities.header(["Allow Wake on WLAN"]) + utilities.cls() + utilities.header(["Allow Wake on WLAN"]) print( """ Due to an unfortunate bug in macOS Big Sur+, Wake on WLAN is @@ -474,8 +474,8 @@ be prepared if enabling. self.allow_wowl() def allow_ivy(self): - Utilities.cls() - Utilities.header(["Allow Ivy iMac iGPU"]) + utilities.cls() + utilities.header(["Allow Ivy iMac iGPU"]) print( """ For iMac13,x systems with a Nvidia dGPU, the iGPU is disabled by default to @@ -502,8 +502,8 @@ Note 2: This setting only affects iMac13,x with dGPUs self.allow_ivy() def latebloom_settings(self): - Utilities.cls() - Utilities.header(["Set latebloom properties"]) + utilities.cls() + utilities.header(["Set latebloom properties"]) print( f""" Set latebloom properties, useful for debugging boot stalls on @@ -548,8 +548,8 @@ Q. Return to previous menu self.latebloom_settings() def allow_moj_cat_patch(self): - Utilities.cls() - Utilities.header(["Allow Root Patching on Mojave/Catalina"]) + utilities.cls() + utilities.header(["Allow Root Patching on Mojave/Catalina"]) print( """ This is an experimental option that allows the usage of legacy acceleration @@ -576,8 +576,8 @@ Note: for the average user, we recommend using dosdude1's legacy patcher: self.allow_moj_cat_patch() def disable_tb(self): - Utilities.cls() - Utilities.header(["Disable Thunderbolt on 2013-14 MacBook Pros"]) + utilities.cls() + utilities.header(["Disable Thunderbolt on 2013-14 MacBook Pros"]) print( """ Some 2013-14 MacBook Pro's have issues with the built-in thunderbolt, @@ -602,8 +602,8 @@ other devices that benefit from this fix. self.disable_tb() def terascale_2_accel(self): - Utilities.cls() - Utilities.header(["Set TeraScale 2 Acceleration"]) + utilities.cls() + utilities.header(["Set TeraScale 2 Acceleration"]) print( """ By default this patcher will install TeraScale 2 acceleration, however @@ -627,15 +627,15 @@ handle acceleration tasks. self.terascale_2_accel() def dump_hardware(self): - Utilities.cls() - Utilities.header(["Dumping detected hardware"]) + utilities.cls() + utilities.header(["Dumping detected hardware"]) print("") print(self.constants.computer) input("\nPress [ENTER] to exit: ") def applealc_support(self): - Utilities.cls() - Utilities.header(["Set AppleALC usage"]) + utilities.cls() + utilities.header(["Set AppleALC usage"]) print( """ By default this patcher will install audio patches in-memory via @@ -658,8 +658,8 @@ If AppleALC is detected, the Patcher will not install AppleHDA. self.applealc_support() def dGPU_switch_support(self): - Utilities.cls() - Utilities.header(["Set Windows GMUX support"]) + utilities.cls() + utilities.header(["Set Windows GMUX support"]) print( """ With OCLP, we're able to restore iGPU funbctionality on iGPU+dGPU @@ -679,8 +679,8 @@ for Windows may prefer to only work with the dGPU and eGPU active. self.dGPU_switch_support() def set_surplus(self): - Utilities.cls() - Utilities.header(["Override SurPlus MaxKernel"]) + utilities.cls() + utilities.header(["Override SurPlus MaxKernel"]) print( """ By default OCLP will only allow SurPlus to be used on kernels 21.1.0 @@ -705,7 +705,7 @@ the event there's issues. self.set_surplus() def credits(self): - Utilities.TUIOnlyPrint( + utilities.TUIOnlyPrint( ["Credits"], "Press [Enter] to go back.\n", [ @@ -722,8 +722,8 @@ the event there's issues. ).start() def change_model(self): - Utilities.cls() - Utilities.header(["Select Different Model"]) + utilities.cls() + utilities.header(["Select Different Model"]) print( """ Tip: Run the following command on the target machine to find the model identifier: @@ -746,8 +746,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' defaults.generate_defaults.probe(self.constants.custom_model, False, self.constants) def PatchVolume(self): - Utilities.cls() - Utilities.header(["Patching System Volume"]) + utilities.cls() + utilities.header(["Patching System Volume"]) no_patch = False if self.constants.detected_os == self.constants.monterey: @@ -771,7 +771,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Advanced Patcher Settings, for developers ONLY"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Set Metal GPU Status:\t\tCurrently {self.constants.imac_vendor}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_metal], [f"Set DRM Preferences:\t\tCurrently {self.constants.drm_support}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).drm_setting], @@ -792,7 +792,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Patcher Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ ["Debug Settings", self.patcher_setting_debug], ["Security Settings", self.patcher_settings_security], @@ -820,7 +820,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Debug Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Enable Verbose Mode:\tCurrently {self.constants.verbose_debug}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_verbose], [f"Enable OpenCore DEBUG:\tCurrently {self.constants.opencore_debug}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_oc], @@ -842,7 +842,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Security Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ # [ # f"Set Apple Mobile File Integrity (AMFI):\tCurrently {self.constants.amfi_status}", @@ -868,7 +868,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust SMBIOS Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Set SMBIOS Spoof Level:\tCurrently {self.constants.serial_settings}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_serial], [f"Set SMBIOS Spoof Model:\tCurrently {self.constants.override_smbios}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_smbios], @@ -884,7 +884,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Bootable Volume Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Set FireWire Boot:\tCurrently {self.constants.firewire_boot}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_firewire], [f"Set NVMe Boot:\tCurrently {self.constants.nvme_boot}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_nvme], @@ -899,7 +899,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Miscellaneous Settings"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Set ShowPicker Mode:\tCurrently {self.constants.showpicker}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_showpicker], [f"Set Wake on WLAN:\t\tCurrently {self.constants.enable_wake_on_wlan}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).allow_wowl], @@ -922,7 +922,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = None while not (response and response == -1): title = ["Adjust Advanced Patcher Settings, for developers ONLY"] - menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) + menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True) options = [ [f"Set Metal GPU Status:\t\tCurrently {self.constants.imac_vendor}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_metal], [f"Set DRM Preferences:\t\tCurrently {self.constants.drm_support}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).drm_setting], diff --git a/resources/defaults.py b/resources/defaults.py index d0cac51e8..0cc7d7f8f 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -1,5 +1,5 @@ # Generate Default Data -from resources import Utilities, device_probe +from resources import utilities, device_probe from data import model_array class generate_defaults(): @@ -11,7 +11,7 @@ class generate_defaults(): settings.amfi_status = True if host_is_target: - if Utilities.check_metal_support(device_probe, settings.computer) is False: + if utilities.check_metal_support(device_probe, settings.computer) is False: settings.disable_cs_lv = True if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: settings.sip_status = False @@ -27,7 +27,7 @@ class generate_defaults(): settings.disable_cs_lv = True if model in model_array.LegacyGPU: - if host_is_target and Utilities.check_metal_support(device_probe, settings.computer) is True: + if host_is_target and utilities.check_metal_support(device_probe, settings.computer) is True: # Building on device and we have a native, supported GPU if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: settings.sip_status = False @@ -54,22 +54,22 @@ class generate_defaults(): # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing settings.serial_settings = "Moderate" - custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) + custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) if custom_cpu_model_value is not None: # TODO: Fix to not use two separate variables settings.custom_cpu_model = 1 settings.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0] - if "-v" in (Utilities.get_nvram("boot-args") or ""): + if "-v" in (utilities.get_nvram("boot-args") or ""): settings.verbose_debug = True - if Utilities.amfi_status() is False: + if utilities.amfi_status() is False: settings.amfi_status = False - if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9"): + if utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9"): # Users disabling TS2 most likely have a faulty dGPU # users can override this in settings settings.allow_ts2_accel = False # Check if running in RecoveryOS - settings.recovery_status = Utilities.check_recovery() \ No newline at end of file + settings.recovery_status = utilities.check_recovery() \ No newline at end of file diff --git a/resources/device_probe.py b/resources/device_probe.py index 287aaa7fa..f1e4b3c30 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -10,7 +10,7 @@ import subprocess from dataclasses import dataclass, field from typing import Any, ClassVar, Optional, Type, Union -from resources import Utilities, ioreg +from resources import utilities, ioreg from data import pci_data @@ -373,7 +373,7 @@ class Computer: devices = ioreg.ioiterator_to_list( ioreg.IOServiceGetMatchingServices( ioreg.kIOMasterPortDefault, - {"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": {"class-code": binascii.a2b_hex(Utilities.hexswap(hex(WirelessCard.CLASS_CODE)[2:].zfill(8)))}}, + {"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": {"class-code": binascii.a2b_hex(utilities.hexswap(hex(WirelessCard.CLASS_CODE)[2:].zfill(8)))}}, None, )[1] ) @@ -389,7 +389,7 @@ class Computer: sata_controllers = ioreg.ioiterator_to_list( ioreg.IOServiceGetMatchingServices( ioreg.kIOMasterPortDefault, - {"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex(Utilities.hexswap(hex(SATAController.CLASS_CODE)[2:].zfill(8)))}]}, + {"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex(utilities.hexswap(hex(SATAController.CLASS_CODE)[2:].zfill(8)))}]}, None, )[1] ) @@ -431,12 +431,12 @@ class Computer: # Real model # TODO: We previously had logic for OC users using iMacPro1,1 with incorrect ExposeSensitiveData. Add logic? - self.real_model = Utilities.get_nvram("oem-product", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_model - self.real_board_id = Utilities.get_nvram("oem-board", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_board_id + self.real_model = utilities.get_nvram("oem-product", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_model + self.real_board_id = utilities.get_nvram("oem-board", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_board_id # OCLP version - self.oclp_version = Utilities.get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) - self.opencore_version = Utilities.get_nvram("opencore-version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) + self.oclp_version = utilities.get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) + self.opencore_version = utilities.get_nvram("opencore-version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) def cpu_probe(self): self.cpu = CPU( diff --git a/resources/generate_smbios.py b/resources/generate_smbios.py index 5b9b34220..89a38b41a 100644 --- a/resources/generate_smbios.py +++ b/resources/generate_smbios.py @@ -1,5 +1,5 @@ from data import smbios_data, os_data -from resources import Utilities +from resources import utilities def set_smbios_model_spoof(model): try: @@ -65,7 +65,7 @@ def update_firmware_features(firmwarefeature): def generate_fw_features(model, custom): if not custom: - firmwarefeature = Utilities.get_rom("firmware-features") + 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) diff --git a/resources/mount_root.py b/resources/mount_root.py index b433344ef..2759b03fc 100644 --- a/resources/mount_root.py +++ b/resources/mount_root.py @@ -1,6 +1,6 @@ # Logic for mounting root volume from data import os_data -from resources import Utilities +from resources import utilities import plistlib import subprocess diff --git a/resources/sys_patch.py b/resources/sys_patch.py index 4d433bcaf..ae130929c 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -11,7 +11,7 @@ import subprocess import zipfile from pathlib import Path -from resources import constants, device_probe, Utilities +from resources import constants, device_probe, utilities from data import sip_data, sys_patch_data, model_array @@ -68,7 +68,7 @@ class PatchSysVolume: return subprocess.run(["sudo"] + [args[0][0]] + args[0][1:], **kwargs) def find_mount_root_vol(self, patch): - self.root_mount_path = Utilities.get_disk_path() + self.root_mount_path = utilities.get_disk_path() if self.root_mount_path.startswith("disk"): if self.constants.detected_os == self.constants.catalina and self.validate is False: print("- Mounting Catalina Root Volume as writable") @@ -77,7 +77,7 @@ class PatchSysVolume: if Path(self.mount_extensions).exists(): print("- Root Volume is already mounted") if patch is True: - if self.constants.detected_os < self.constants.big_sur or (self.constants.detected_os == self.constants.big_sur and Utilities.check_seal() is True): + if self.constants.detected_os < self.constants.big_sur or (self.constants.detected_os == self.constants.big_sur and utilities.check_seal() is True): self.backup_volume() self.patch_root_vol() return True @@ -91,7 +91,7 @@ class PatchSysVolume: if Path(self.mount_extensions).exists(): print("- Successfully mounted the Root Volume") if patch is True: - if self.constants.detected_os < self.constants.big_sur or (self.constants.detected_os == self.constants.big_sur and Utilities.check_seal() is True): + if self.constants.detected_os < self.constants.big_sur or (self.constants.detected_os == self.constants.big_sur and utilities.check_seal() is True): self.backup_volume() self.patch_root_vol() return True @@ -110,7 +110,7 @@ class PatchSysVolume: def backup_volume(self): for location in sys_patch_data.BackupLocations: - Utilities.cls() + utilities.cls() print("Backing up root volume before patching (This may take some time)") print(f"- Attempting to backup {location}") location_zip = f"{location}-Backup.zip" @@ -125,7 +125,7 @@ class PatchSysVolume: # rm -r ./Extensions-Backup print("- Creating Backup folder") - Utilities.process_status( + utilities.process_status( self.elevated( ["cp", "-r", f"{self.mount_location}/{location}", f"{self.mount_location}/{location}-Backup"], stdout=subprocess.PIPE, @@ -133,7 +133,7 @@ class PatchSysVolume: ) ) print("- Zipping Backup folder") - Utilities.process_status( + utilities.process_status( self.elevated( ["ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", f"{self.mount_location}/{location}-Backup", f"{self.mount_location}/{location_zip}"], stdout=subprocess.PIPE, @@ -142,7 +142,7 @@ class PatchSysVolume: ) print("- Removing Backup folder") - Utilities.process_status( + utilities.process_status( self.elevated( ["rm", "-r", f"{self.mount_location}/{location}-Backup"], stdout=subprocess.PIPE, @@ -156,7 +156,7 @@ class PatchSysVolume: print("- Verified manual unpatching is available") for location in sys_patch_data.BackupLocations: - Utilities.cls() + utilities.cls() print("Reverting root volume patches (This may take some time)") print(f"- Attempting to unpatch {location}") @@ -175,21 +175,21 @@ class PatchSysVolume: print(f"- Found {location_zip}") print(f"- Unzipping {location_zip}") - Utilities.process_status(self.elevated(["unzip", location_zip_path, "-d", copy_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["unzip", location_zip_path, "-d", copy_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) if location_old_path.exists(): print(f"- Renaming {location}") - Utilities.process_status(self.elevated(["mv", location_old_path, f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["mv", location_old_path, f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Renaming {location}-Backup") - Utilities.process_status(self.elevated(["mv", f"{location_old_path}-Backup", location_old_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["mv", f"{location_old_path}-Backup", location_old_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Removing {location_old_path}-Patched") - Utilities.process_status(self.elevated(["rm", "-r", f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["rm", "-r", f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) # ditto will create a '__MACOSX' folder # print("- Removing __MACOSX folder") - # Utilities.process_status(self.elevated(["rm", "-r", f"{copy_path}/__MACOSX"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + # utilities.process_status(self.elevated(["rm", "-r", f"{copy_path}/__MACOSX"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print(f"- Failed to find {location_zip}, unable to unpatch") @@ -250,9 +250,9 @@ class PatchSysVolume: else: if self.constants.detected_os == self.constants.catalina: print("- Merging kernel cache") - Utilities.process_status(self.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging dyld cache") - Utilities.process_status(self.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"])) + utilities.process_status(self.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"])) print("- Patching complete") print("\nPlease reboot the machine for patches to take effect") if self.amd_ts2 is True and self.constants.allow_ts2_accel is True: @@ -274,7 +274,7 @@ set million colour before rebooting""" delete_path = Path(self.mount_extensions) / Path(delete_current_kext) if Path(delete_path).exists(): print(f"- Deleting {delete_current_kext}") - Utilities.process_status(self.elevated(["rm", "-R", delete_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["rm", "-R", delete_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print(f"- Couldn't find {delete_current_kext}, skipping") @@ -283,18 +283,18 @@ set million colour before rebooting""" existing_path = Path(self.mount_extensions) / Path(add_current_kext) if Path(existing_path).exists(): print(f"- Found conflicting kext, Deleting Root Volume's {add_current_kext}") - Utilities.process_status(self.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Adding {add_current_kext}") - Utilities.process_status(self.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_brightness_patch(self): self.delete_old_binaries(sys_patch_data.DeleteBrightness) self.add_new_binaries(sys_patch_data.AddBrightness, self.constants.legacy_brightness) self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE) - Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_audio_patch(self): if self.model in ["iMac7,1", "iMac8,1"]: @@ -306,17 +306,17 @@ set million colour before rebooting""" def add_wifi_patch(self): print("- Merging Wireless CoreSerices patches") self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_coreservices}/", self.mount_coreservices], stdout=subprocess.PIPE) - Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging Wireless usr/libexec patches") self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_libexec}/", self.mount_libexec], stdout=subprocess.PIPE) - Utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_legacy_mux_patch(self): self.delete_old_binaries(sys_patch_data.DeleteDemux) print("- Merging Legacy Mux Kext patches") - Utilities.process_status(self.elevated(["cp", "-R", f"{self.constants.legacy_mux_path}/AppleMuxControl.kext", self.mount_extensions_mux], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["cp", "-R", f"{self.constants.legacy_mux_path}/AppleMuxControl.kext", self.mount_extensions_mux], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def gpu_accel_legacy(self): if self.constants.detected_os == self.constants.mojave: @@ -413,7 +413,7 @@ set million colour before rebooting""" self.add_new_binaries(sys_patch_data.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) if self.validate is False: print("- Fixing Acceleration in CoreMedia") - Utilities.process_status(subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "enable"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "enable"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging Ivy Bridge Frameworks") self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print("- Merging Ivy Bridge PrivateFrameworks") @@ -441,14 +441,14 @@ set million colour before rebooting""" self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE) if self.constants.detected_os > self.constants.catalina: print("- Adding IOHID-Fixup.plist") - Utilities.process_status( + utilities.process_status( self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ) - Utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - Utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print("- Disabling Library Validation") - Utilities.process_status( + utilities.process_status( self.elevated( ["defaults", "write", "/Library/Preferences/com.apple.security.libraryvalidation.plist", "DisableLibraryValidation", "-bool", "true"], stdout=subprocess.PIPE, @@ -464,7 +464,7 @@ set million colour before rebooting""" self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ts2}/", self.mount_private_frameworks], stdout=subprocess.PIPE) if self.validate is False: print("- Fixing Acceleration in CMIO") - Utilities.process_status(subprocess.run(["defaults", "write", "com.apple.cmio", "CMIO_Unit_Input_ASC.DoNotUseOpenCL", "-bool", "true"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(subprocess.run(["defaults", "write", "com.apple.cmio", "CMIO_Unit_Input_ASC.DoNotUseOpenCL", "-bool", "true"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def patch_root_vol(self): print(f"- Running patches for {self.model}") @@ -599,13 +599,13 @@ set million colour before rebooting""" print(f"- Duplicating into Apple.zip") shutil.copy(local_zip, self.constants.payload_apple_root_path_zip) else: - Utilities.download_file(link, self.constants.payload_apple_root_path_zip) + utilities.download_file(link, self.constants.payload_apple_root_path_zip) if self.constants.payload_apple_root_path_zip.exists(): print("- Download completed") print("- Unzipping download...") try: - Utilities.process_status(subprocess.run(["unzip", self.constants.payload_apple_root_path_zip], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path)) + utilities.process_status(subprocess.run(["unzip", self.constants.payload_apple_root_path_zip], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path)) print("- Renaming folder") os.rename(self.constants.payload_path / Path(os_ver), self.constants.payload_apple_root_path) Path(self.constants.payload_apple_root_path_zip).unlink() @@ -630,7 +630,7 @@ set million colour before rebooting""" i = 0 for gpu in gpus: if gpu.class_code and gpu.class_code != 0xFFFFFFFF: - print(f"- Found GPU ({i}): {Utilities.friendly_hex(gpu.vendor_id)}:{Utilities.friendly_hex(gpu.device_id)}") + print(f"- Found GPU ({i}): {utilities.friendly_hex(gpu.vendor_id)}:{utilities.friendly_hex(gpu.device_id)}") if gpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]: if self.constants.detected_os > non_metal_os: self.nvidia_legacy = True @@ -679,7 +679,7 @@ set million colour before rebooting""" def detect_demux(self): # If GFX0 is missing, assume machine was demuxed # -wegnoegpu would also trigger this, so ensure arg is not present - if not "-wegnoegpu" in (Utilities.get_nvram("boot-args") or ""): + if not "-wegnoegpu" in (utilities.get_nvram("boot-args") or ""): igpu = self.constants.computer.igpu dgpu = self.constants.computer.dgpu if igpu and not dgpu: @@ -693,7 +693,7 @@ set million colour before rebooting""" if self.constants.detected_os > self.constants.catalina: self.brightness_legacy = True - if self.model in ["iMac7,1", "iMac8,1"] or (self.model in model_array.LegacyAudio and Utilities.check_kext_loaded("AppleALC", self.constants.detected_os) is False): + if self.model in ["iMac7,1", "iMac8,1"] or (self.model in model_array.LegacyAudio and utilities.check_kext_loaded("AppleALC", self.constants.detected_os) is False): # Special hack for systems with botched GOPs # TL;DR: No Boot Screen breaks Lilu, therefore breaking audio if self.constants.detected_os > self.constants.catalina: @@ -717,7 +717,7 @@ set million colour before rebooting""" else: self.legacy_gmux = True - Utilities.cls() + utilities.cls() print("The following patches will be applied:") if self.nvidia_legacy is True: print("- Add Legacy Nvidia Tesla Graphics Patch") @@ -766,7 +766,7 @@ set million colour before rebooting""" sip_value = ( "For Hackintoshes, please set csr-active-config to '030E0000' (0xE03)\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, self.dosdude_patched = Utilities.patching_status(sip, self.constants.detected_os) + self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled, self.dosdude_patched = utilities.patching_status(sip, self.constants.detected_os) 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") diff --git a/resources/utilities-tmp.py b/resources/utilities.py similarity index 100% rename from resources/utilities-tmp.py rename to resources/utilities.py From 991a089c45e3a78eca87943da6e6518a17b92cd4 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:14:39 -0600 Subject: [PATCH 19/30] Tmp --- .github/workflows/build-app-offline.yml | 2 +- create-offline-build.py => create_offline_build.py | 0 resources/{Build.py => Build-tmp.py} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename create-offline-build.py => create_offline_build.py (100%) rename resources/{Build.py => Build-tmp.py} (100%) diff --git a/.github/workflows/build-app-offline.yml b/.github/workflows/build-app-offline.yml index 1d3d6ecef..235d4f298 100644 --- a/.github/workflows/build-app-offline.yml +++ b/.github/workflows/build-app-offline.yml @@ -12,7 +12,7 @@ jobs: runs-on: x86_64_mojave steps: - uses: actions/checkout@v2 - - run: python3 create-offline-build.py + - run: python3 create_offline_build.py - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher.spec - run: ./after_pyinstaller.sh - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' diff --git a/create-offline-build.py b/create_offline_build.py similarity index 100% rename from create-offline-build.py rename to create_offline_build.py diff --git a/resources/Build.py b/resources/Build-tmp.py similarity index 100% rename from resources/Build.py rename to resources/Build-tmp.py From 3537725a13849e2e4a45e27b0d4623f6b3499ec5 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 14:14:55 -0600 Subject: [PATCH 20/30] Adjust build to py scheme --- OpenCore-Patcher.command | 6 +++--- resources/arguments.py | 8 ++++---- resources/{Build-tmp.py => build.py} | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename resources/{Build-tmp.py => build.py} (100%) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 011db0737..275194964 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -7,7 +7,7 @@ import subprocess import sys from pathlib import Path -from resources import Build, cli_menu, constants, utilities, device_probe, os_probe, defaults, arguments +from resources import build, cli_menu, constants, utilities, device_probe, os_probe, defaults, arguments from data import model_array class OpenCoreLegacyPatcher: @@ -67,11 +67,11 @@ class OpenCoreLegacyPatcher: menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) options = ( - [["Build OpenCore", Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] + [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True else [] ) + [ - ["Install OpenCore to USB/internal drive", Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()], + ["Install OpenCore to USB/internal drive", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()], ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], diff --git a/resources/arguments.py b/resources/arguments.py index 04fb67087..f5ebbc0c1 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -1,7 +1,7 @@ import argparse import sys import subprocess -from resources import defaults, Build +from resources import defaults, build from data import example_data, model_array # Generic building args @@ -137,7 +137,7 @@ If you plan to create the USB for another machine, please select the "Change Mod # Avoid running the root patcher if we're just building if self.args.build: - Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + build.BuildOpenCore(settings.custom_model, settings).build_opencore() elif self.args.patch_sys_vol: if self.args.moj_cat_accel: print("- Set Mojave/Catalina root patch configuration") @@ -171,7 +171,7 @@ If you plan to create the USB for another machine, please select the "Change Mod for model in model_array.SupportedSMBIOS: print(f"Validating predefined model: {model}") settings.custom_model = model - Build.BuildOpenCore(settings.custom_model, settings).build_opencore() + build.BuildOpenCore(settings.custom_model, settings).build_opencore() result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if result.returncode != 0: print("Error on build!") @@ -185,7 +185,7 @@ If you plan to create the USB for another machine, please select the "Change Mod settings.computer = model settings.custom_model = "" print(f"Validating dumped model: {settings.computer.real_model}") - Build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() + build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if result.returncode != 0: print("Error on build!") diff --git a/resources/Build-tmp.py b/resources/build.py similarity index 100% rename from resources/Build-tmp.py rename to resources/build.py From 3790555dec8f50f59ad68fb03ac704144da6c859 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 18:01:34 -0600 Subject: [PATCH 21/30] Fix init --- OpenCore-Patcher.command | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 275194964..1b45b61bd 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -67,11 +67,11 @@ class OpenCoreLegacyPatcher: menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) options = ( - [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] + [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]] if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True else [] ) + [ - ["Install OpenCore to USB/internal drive", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()], + ["Install OpenCore to USB/internal drive", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi], ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], From 8272c092ad5620b37219837afa2570d9e1a0e756 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Oct 2021 18:15:14 -0600 Subject: [PATCH 22/30] Fix init --- OpenCore-Patcher.command | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 275194964..1b45b61bd 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -67,11 +67,11 @@ class OpenCoreLegacyPatcher: menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) options = ( - [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()]] + [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]] if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True else [] ) + [ - ["Install OpenCore to USB/internal drive", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()], + ["Install OpenCore to USB/internal drive", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi], ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], From 91d20b2ad024db8433b92eb136844e1e062a868a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 10:52:11 -0600 Subject: [PATCH 23/30] Rework args check --- OpenCore-Patcher.command | 4 +- resources/arguments.py | 119 ++------------------------------------- resources/build.py | 2 +- resources/mount_root.py | 19 ------- resources/sys_patch.py | 92 ++++++++++++++---------------- resources/utilities.py | 48 +++++++++++++++- resources/validation.py | 71 +++++++++++++++++++++++ 7 files changed, 167 insertions(+), 188 deletions(-) delete mode 100644 resources/mount_root.py create mode 100644 resources/validation.py diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 1b45b61bd..d1c235d6d 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -15,7 +15,7 @@ class OpenCoreLegacyPatcher: print("- Loading...") self.constants = constants.Constants() self.generate_base_data() - if arguments.arguments().check_cli() is False: + if utilities.check_cli_args() is None: self.main_menu() def generate_base_data(self): @@ -26,7 +26,7 @@ class OpenCoreLegacyPatcher: self.constants.recovery_status = utilities.check_recovery() self.computer = self.constants.computer defaults.generate_defaults.probe(self.computer.real_model, True, self.constants) - if arguments.arguments().check_cli() is True: + if utilities.check_cli_args() is not None: print("- Detected arguments, switching to CLI mode") self.constants.gui_mode = True # Assumes no user interaction is required self.constants.current_path = Path.cwd() diff --git a/resources/arguments.py b/resources/arguments.py index f5ebbc0c1..c2627f0d1 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -1,53 +1,12 @@ -import argparse import sys import subprocess -from resources import defaults, build +from resources import defaults, build, utilities, validation from data import example_data, model_array # Generic building args class arguments: def __init__(self): - parser = argparse.ArgumentParser() - parser.add_argument("--build", help="Build OpenCore", action="store_true", required=False) - parser.add_argument("--verbose", help="Enable verbose boot", action="store_true", required=False) - parser.add_argument("--debug_oc", help="Enable OpenCore DEBUG", action="store_true", required=False) - parser.add_argument("--debug_kext", help="Enable kext DEBUG", action="store_true", required=False) - parser.add_argument("--hide_picker", help="Hide OpenCore picker", action="store_true", required=False) - parser.add_argument("--disable_sip", help="Disable SIP", action="store_true", required=False) - parser.add_argument("--disable_smb", help="Disable SecureBootModel", action="store_true", required=False) - parser.add_argument("--vault", help="Enable OpenCore Vaulting", action="store_true", required=False) - parser.add_argument("--support_all", help="Allow OpenCore on natively supported Models", action="store_true", required=False) - parser.add_argument("--firewire", help="Enable FireWire Booting", action="store_true", required=False) - parser.add_argument("--nvme", help="Enable NVMe Booting", action="store_true", required=False) - parser.add_argument("--wlan", help="Enable Wake on WLAN support", action="store_true", required=False) - # parser.add_argument("--disable_amfi", help="Disable AMFI", action="store_true", required=False) - parser.add_argument("--moderate_smbios", help="Moderate SMBIOS Patching", action="store_true", required=False) - parser.add_argument("--moj_cat_accel", help="Allow Root Patching on Mojave and Catalina", action="store_true", required=False) - parser.add_argument("--disable_tb", help="Disable Thunderbolt on 2013-2014 MacBook Pros", action="store_true", required=False) - parser.add_argument("--force_surplus", help="Force SurPlus in all newer OSes", action="store_true", required=False) - - # Building args requiring value values (ie. --model iMac12,2) - parser.add_argument("--model", action="store", help="Set custom model", required=False) - parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False) - parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) - - # sys_patch args - parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) - parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) - - # validation args - parser.add_argument("--validate", help="Runs Validation Tests for CI", action="store_true", required=False) - self.args = parser.parse_args() - - def check_cli(self): - # If no core arguments are present, assume we're running in TUI - # build, patch_sys_vol, unpatch_sys_vol, validate - if not( - self.args.build or self.args.patch_sys_vol or self.args.unpatch_sys_vol or self.args.validate - ): - return False - else: - return True + self.args = utilities.check_cli_args() def parse_arguments(self, settings): if self.args.model: @@ -70,7 +29,7 @@ If you plan to create the USB for another machine, please select the "Change Mod print(f"- Install Disk set: {self.args.disk}") settings.disk = self.args.disk if self.args.validate: - self.validate(settings) + validation.validate(settings) if self.args.verbose: print("- Set verbose configuration") settings.verbose_debug = True @@ -146,74 +105,4 @@ If you plan to create the USB for another machine, please select the "Change Mod self.patch_vol() elif self.args.unpatch_sys_vol: print("- Set System Volume unpatching") - self.unpatch_vol() - - def validate(self, settings): - # Runs through ocvalidate to check for errors - - valid_dumps = [ - example_data.MacBookPro.MacBookPro92_Stock, - # example_data.MacBookPro.MacBookPro171_Stock, - # example_data.Macmini.Macmini91_Stock, - example_data.iMac.iMac81_Stock, - example_data.iMac.iMac112_Stock, - example_data.iMac.iMac122_Upgraded, - example_data.MacPro.MacPro31_Stock, - example_data.MacPro.MacPro31_Upgrade, - example_data.MacPro.MacPro31_Modern_AMD, - example_data.MacPro.MacPro31_Modern_Kepler, - example_data.MacPro.MacPro41_Upgrade, - example_data.MacPro.MacPro41_Modern_AMD, - example_data.MacPro.MacPro41_51__Flashed_Modern_AMD, - ] - settings.validate = True - def build_prebuilt(): - for model in model_array.SupportedSMBIOS: - print(f"Validating predefined model: {model}") - settings.custom_model = model - build.BuildOpenCore(settings.custom_model, settings).build_opencore() - result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {model}") - else: - print(f"Validation succeeded for predefined model: {model}") - - def build_dumps(): - for model in valid_dumps: - settings.computer = model - settings.custom_model = "" - print(f"Validating dumped model: {settings.computer.real_model}") - build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() - result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - if result.returncode != 0: - print("Error on build!") - print(result.stdout.decode()) - raise Exception(f"Validation failed for predefined model: {settings.computer.real_model}") - else: - print(f"Validation succeeded for predefined model: {settings.computer.real_model}") - - # First run is with default settings - build_prebuilt() - build_dumps() - # Second run, flip all settings - settings.verbose_debug = True - settings.opencore_debug = True - settings.opencore_build = "DEBUG" - settings.kext_debug = True - settings.showpicker = False - settings.sip_status = False - settings.secure_status = True - settings.firewire_boot = True - settings.nvme_boot = True - settings.enable_wake_on_wlan = True - settings.disable_tb = True - settings.force_surplus = True - build_prebuilt() - build_dumps() - - - - - + self.unpatch_vol() \ No newline at end of file diff --git a/resources/build.py b/resources/build.py index ea4e8664f..6c0f8cf93 100644 --- a/resources/build.py +++ b/resources/build.py @@ -649,7 +649,7 @@ class BuildOpenCore: print("- Enabling ShowPicker") self.config["Misc"]["Boot"]["ShowPicker"] = True else: - print("- Hiding picker and enabling PollAppleHotKeys") + print("- Hiding OpenCore picker") self.config["Misc"]["Boot"]["ShowPicker"] = False if self.constants.vault is True: print("- Setting Vault configuration") diff --git a/resources/mount_root.py b/resources/mount_root.py deleted file mode 100644 index 2759b03fc..000000000 --- a/resources/mount_root.py +++ /dev/null @@ -1,19 +0,0 @@ -# Logic for mounting root volume -from data import os_data -from resources import utilities -import plistlib -import subprocess - -def mount_root_volume(os_version, root_disk): - - if os_version >= os_data.os_data.big_sur: - mount_location = "/System/Volumes/Update/mnt1/" - else: - mount_location = "/" - -def find_root_volume(): - root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) - root_mount_path = root_partition_info["DeviceIdentifier"] - root_mount_path = root_mount_path[:-2] if root_mount_path.count("s") > 1 else root_mount_path - return root_mount_path - diff --git a/resources/sys_patch.py b/resources/sys_patch.py index ae130929c..f4c002be7 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -45,9 +45,6 @@ class PatchSysVolume: self.validate = False self.supports_metal = False - # if (Path.home() / "Desktop/OCLP-Test/").exists: - # self.mount_location = Path.home() / "Desktop/OCLP-Test" - # self.validate = True if self.constants.detected_os > self.constants.catalina: # Big Sur and newer use APFS snapshots self.mount_location = "/System/Volumes/Update/mnt1" @@ -61,18 +58,12 @@ class PatchSysVolume: self.mount_libexec = f"{self.mount_location}/usr/libexec" self.mount_extensions_mux = f"{self.mount_location}/System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/" - def elevated(self, *args, **kwargs) -> subprocess.CompletedProcess: - if os.getuid() == 0 or self.constants.gui_mode is True: - return subprocess.run(*args, **kwargs) - else: - return subprocess.run(["sudo"] + [args[0][0]] + args[0][1:], **kwargs) - def find_mount_root_vol(self, patch): self.root_mount_path = utilities.get_disk_path() if self.root_mount_path.startswith("disk"): if self.constants.detected_os == self.constants.catalina and self.validate is False: print("- Mounting Catalina Root Volume as writable") - self.elevated(["mount", "-uw", f"{self.mount_location}/"], stdout=subprocess.PIPE).stdout.decode().strip().encode() + utilities.elevated(["mount", "-uw", f"{self.mount_location}/"], stdout=subprocess.PIPE).stdout.decode().strip().encode() print(f"- Found Root Volume at: {self.root_mount_path}") if Path(self.mount_extensions).exists(): print("- Root Volume is already mounted") @@ -87,7 +78,7 @@ class PatchSysVolume: else: if self.constants.detected_os > self.constants.catalina: print("- Mounting APFS Snapshot as writable") - self.elevated(["mount", "-o", "nobrowse", "-t", "apfs", f"/dev/{self.root_mount_path}", self.mount_location], stdout=subprocess.PIPE).stdout.decode().strip().encode() + utilities.elevated(["mount", "-o", "nobrowse", "-t", "apfs", f"/dev/{self.root_mount_path}", self.mount_location], stdout=subprocess.PIPE).stdout.decode().strip().encode() if Path(self.mount_extensions).exists(): print("- Successfully mounted the Root Volume") if patch is True: @@ -175,21 +166,21 @@ class PatchSysVolume: print(f"- Found {location_zip}") print(f"- Unzipping {location_zip}") - utilities.process_status(self.elevated(["unzip", location_zip_path, "-d", copy_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["unzip", location_zip_path, "-d", copy_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) if location_old_path.exists(): print(f"- Renaming {location}") - utilities.process_status(self.elevated(["mv", location_old_path, f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["mv", location_old_path, f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Renaming {location}-Backup") - utilities.process_status(self.elevated(["mv", f"{location_old_path}-Backup", location_old_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["mv", f"{location_old_path}-Backup", location_old_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Removing {location_old_path}-Patched") - utilities.process_status(self.elevated(["rm", "-r", f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["rm", "-r", f"{location_old_path}-Patched"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) # ditto will create a '__MACOSX' folder # print("- Removing __MACOSX folder") - # utilities.process_status(self.elevated(["rm", "-r", f"{copy_path}/__MACOSX"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + # utilities.process_status(utilities.elevated(["rm", "-r", f"{copy_path}/__MACOSX"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print(f"- Failed to find {location_zip}, unable to unpatch") @@ -201,7 +192,7 @@ class PatchSysVolume: def unpatch_root_vol(self): if self.constants.detected_os > self.constants.catalina: print("- Reverting to last signed APFS snapshot") - result = self.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + result = utilities.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if result.returncode != 0: print("- Unable to revert root volume patches") print("Reason for unpatch Failure:") @@ -219,9 +210,9 @@ class PatchSysVolume: input("Press [ENTER] to continue with cache rebuild: ") print("- Rebuilding Kernel Cache (This may take some time)") if self.constants.detected_os > self.constants.catalina: - result = self.elevated(["kmutil", "install", "--volume-root", self.mount_location, "--update-all"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + result = utilities.elevated(["kmutil", "install", "--volume-root", self.mount_location, "--update-all"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: - result = self.elevated(["kextcache", "-i", f"{self.mount_location}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + result = utilities.elevated(["kextcache", "-i", f"{self.mount_location}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # kextcache always returns 0, even if it fails # Check the output for 'KernelCache ID' to see if the cache was successfully rebuilt @@ -245,14 +236,14 @@ class PatchSysVolume: input("Press [ENTER] to continue with kernel and dyld cache merging") if self.constants.detected_os > self.constants.catalina: print("- Creating new APFS snapshot") - self.elevated(["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE).stdout.decode().strip().encode() + utilities.elevated(["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE).stdout.decode().strip().encode() self.unmount_drive() else: if self.constants.detected_os == self.constants.catalina: print("- Merging kernel cache") - utilities.process_status(self.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging dyld cache") - utilities.process_status(self.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"])) + utilities.process_status(utilities.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"])) print("- Patching complete") print("\nPlease reboot the machine for patches to take effect") if self.amd_ts2 is True and self.constants.allow_ts2_accel is True: @@ -267,14 +258,14 @@ set million colour before rebooting""" def unmount_drive(self): print("- Unmounting Root Volume (Don't worry if this fails)") - self.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode() - + utilities.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode() + def delete_old_binaries(self, vendor_patch): for delete_current_kext in vendor_patch: delete_path = Path(self.mount_extensions) / Path(delete_current_kext) if Path(delete_path).exists(): print(f"- Deleting {delete_current_kext}") - utilities.process_status(self.elevated(["rm", "-R", delete_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["rm", "-R", delete_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print(f"- Couldn't find {delete_current_kext}, skipping") @@ -283,18 +274,19 @@ set million colour before rebooting""" existing_path = Path(self.mount_extensions) / Path(add_current_kext) if Path(existing_path).exists(): print(f"- Found conflicting kext, Deleting Root Volume's {add_current_kext}") - utilities.process_status(self.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print(f"- Adding {add_current_kext}") - utilities.process_status(self.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + def add_brightness_patch(self): self.delete_old_binaries(sys_patch_data.DeleteBrightness) self.add_new_binaries(sys_patch_data.AddBrightness, self.constants.legacy_brightness) - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE) - utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE) + utilities.process_status(utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_audio_patch(self): if self.model in ["iMac7,1", "iMac8,1"]: @@ -305,18 +297,18 @@ set million colour before rebooting""" def add_wifi_patch(self): print("- Merging Wireless CoreSerices patches") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_coreservices}/", self.mount_coreservices], stdout=subprocess.PIPE) - utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_coreservices}/", self.mount_coreservices], stdout=subprocess.PIPE) + utilities.process_status(utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_coreservices}/WiFiAgent.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging Wireless usr/libexec patches") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_libexec}/", self.mount_libexec], stdout=subprocess.PIPE) - utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_libexec}/", self.mount_libexec], stdout=subprocess.PIPE) + utilities.process_status(utilities.elevated(["chmod", "755", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chown", "root:wheel", f"{self.mount_libexec}/airportd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def add_legacy_mux_patch(self): self.delete_old_binaries(sys_patch_data.DeleteDemux) print("- Merging Legacy Mux Kext patches") - utilities.process_status(self.elevated(["cp", "-R", f"{self.constants.legacy_mux_path}/AppleMuxControl.kext", self.mount_extensions_mux], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["cp", "-R", f"{self.constants.legacy_mux_path}/AppleMuxControl.kext", self.mount_extensions_mux], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) def gpu_accel_legacy(self): if self.constants.detected_os == self.constants.mojave: @@ -415,9 +407,9 @@ set million colour before rebooting""" print("- Fixing Acceleration in CoreMedia") utilities.process_status(subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "enable"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) print("- Merging Ivy Bridge Frameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print("- Merging Ivy Bridge PrivateFrameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ivy}/", self.mount_private_frameworks], stdout=subprocess.PIPE) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ivy}/", self.mount_private_frameworks], stdout=subprocess.PIPE) else: print("- Installing basic Ivy Bridge Kext patches for generic OS") self.add_new_binaries(sys_patch_data.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path) @@ -432,24 +424,24 @@ set million colour before rebooting""" def gpu_accel_legacy_extended(self): print("- Merging general legacy Frameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if self.constants.detected_os > self.constants.big_sur: print("- Merging Monterey WebKit patch") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print("- Merging general legacy PrivateFrameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE) if self.constants.detected_os > self.constants.catalina: print("- Adding IOHID-Fixup.plist") utilities.process_status( - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ) - utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) - utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + utilities.process_status(utilities.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) else: print("- Disabling Library Validation") utilities.process_status( - self.elevated( + utilities.elevated( ["defaults", "write", "/Library/Preferences/com.apple.security.libraryvalidation.plist", "DisableLibraryValidation", "-bool", "true"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -458,10 +450,10 @@ set million colour before rebooting""" def gpu_accel_legacy_extended_ts2(self): print("- Merging TeraScale 2 legacy Frameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ts2}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ts2}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) print("- Merging TeraScale 2 PrivateFrameworks") - self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ts2}/", self.mount_private_frameworks], stdout=subprocess.PIPE) + utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ts2}/", self.mount_private_frameworks], stdout=subprocess.PIPE) if self.validate is False: print("- Fixing Acceleration in CMIO") utilities.process_status(subprocess.run(["defaults", "write", "com.apple.cmio", "CMIO_Unit_Input_ASC.DoNotUseOpenCL", "-bool", "true"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) diff --git a/resources/utilities.py b/resources/utilities.py index 75cb4e935..15cef94a3 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -7,9 +7,9 @@ import os import plistlib import subprocess from pathlib import Path -import re import os import binascii +import argparse try: import requests @@ -298,9 +298,55 @@ def download_file(link, location): chunk = file.read(1024 * 1024 * 16) return checksum +def elevated(*args, **kwargs) -> subprocess.CompletedProcess: + # When runnign through our GUI, we run as root, however we do not get uid 0 + # Best to assume CLI is running as root + if os.getuid() == 0 or check_cli_args() is not None: + return subprocess.run(*args, **kwargs) + else: + return subprocess.run(["sudo"] + [args[0][0]] + args[0][1:], **kwargs) +def check_cli_args(): + parser = argparse.ArgumentParser() + parser.add_argument("--build", help="Build OpenCore", action="store_true", required=False) + parser.add_argument("--verbose", help="Enable verbose boot", action="store_true", required=False) + parser.add_argument("--debug_oc", help="Enable OpenCore DEBUG", action="store_true", required=False) + parser.add_argument("--debug_kext", help="Enable kext DEBUG", action="store_true", required=False) + parser.add_argument("--hide_picker", help="Hide OpenCore picker", action="store_true", required=False) + parser.add_argument("--disable_sip", help="Disable SIP", action="store_true", required=False) + parser.add_argument("--disable_smb", help="Disable SecureBootModel", action="store_true", required=False) + parser.add_argument("--vault", help="Enable OpenCore Vaulting", action="store_true", required=False) + parser.add_argument("--support_all", help="Allow OpenCore on natively supported Models", action="store_true", required=False) + parser.add_argument("--firewire", help="Enable FireWire Booting", action="store_true", required=False) + parser.add_argument("--nvme", help="Enable NVMe Booting", action="store_true", required=False) + parser.add_argument("--wlan", help="Enable Wake on WLAN support", action="store_true", required=False) + # parser.add_argument("--disable_amfi", help="Disable AMFI", action="store_true", required=False) + parser.add_argument("--moderate_smbios", help="Moderate SMBIOS Patching", action="store_true", required=False) + parser.add_argument("--moj_cat_accel", help="Allow Root Patching on Mojave and Catalina", action="store_true", required=False) + parser.add_argument("--disable_tb", help="Disable Thunderbolt on 2013-2014 MacBook Pros", action="store_true", required=False) + parser.add_argument("--force_surplus", help="Force SurPlus in all newer OSes", action="store_true", required=False) + # Building args requiring value values (ie. --model iMac12,2) + parser.add_argument("--model", action="store", help="Set custom model", required=False) + parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False) + parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False) + # sys_patch args + parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False) + parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False) + + # validation args + parser.add_argument("--validate", help="Runs Validation Tests for CI", action="store_true", required=False) + args = parser.parse_args() + if not( + args.build or + args.patch_sys_vol or + args.unpatch_sys_vol or + args.validate + ): + return None + else: + return args # def menu(title, prompt, menu_options, add_quit=True, auto_number=False, in_between=[], top_level=False): # return_option = ["Q", "Quit", None] if top_level else ["B", "Back", None] diff --git a/resources/validation.py b/resources/validation.py new file mode 100644 index 000000000..92181041c --- /dev/null +++ b/resources/validation.py @@ -0,0 +1,71 @@ + +import subprocess +from resources import build +from data import example_data, model_array + + +def validate(settings): + # Runs through ocvalidate to check for errors + + valid_dumps = [ + example_data.MacBookPro.MacBookPro92_Stock, + # example_data.MacBookPro.MacBookPro171_Stock, + # example_data.Macmini.Macmini91_Stock, + example_data.iMac.iMac81_Stock, + example_data.iMac.iMac112_Stock, + example_data.iMac.iMac122_Upgraded, + example_data.MacPro.MacPro31_Stock, + example_data.MacPro.MacPro31_Upgrade, + example_data.MacPro.MacPro31_Modern_AMD, + example_data.MacPro.MacPro31_Modern_Kepler, + example_data.MacPro.MacPro41_Upgrade, + example_data.MacPro.MacPro41_Modern_AMD, + example_data.MacPro.MacPro41_51__Flashed_Modern_AMD, + ] + + settings.validate = True + def build_prebuilt(): + for model in model_array.SupportedSMBIOS: + print(f"Validating predefined model: {model}") + settings.custom_model = model + build.BuildOpenCore(settings.custom_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {model}") + else: + print(f"Validation succeeded for predefined model: {model}") + + def build_dumps(): + for model in valid_dumps: + settings.computer = model + settings.custom_model = "" + print(f"Validating dumped model: {settings.computer.real_model}") + build.BuildOpenCore(settings.computer.real_model, settings).build_opencore() + result = subprocess.run([settings.ocvalidate_path, f"{settings.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if result.returncode != 0: + print("Error on build!") + print(result.stdout.decode()) + raise Exception(f"Validation failed for predefined model: {settings.computer.real_model}") + else: + print(f"Validation succeeded for predefined model: {settings.computer.real_model}") + + # First run is with default settings + build_prebuilt() + build_dumps() + # Second run, flip all settings + settings.verbose_debug = True + settings.opencore_debug = True + settings.opencore_build = "DEBUG" + settings.kext_debug = True + settings.showpicker = False + settings.sip_status = False + settings.secure_status = True + settings.firewire_boot = True + settings.nvme_boot = True + settings.enable_wake_on_wlan = True + settings.disable_tb = True + settings.force_surplus = True + build_prebuilt() + build_dumps() \ No newline at end of file From 5ca30e8ffea24bf77fa659f5d0d19c3a768d5e8f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 11:13:24 -0600 Subject: [PATCH 24/30] Fix spec --- OpenCore-Patcher.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenCore-Patcher.spec b/OpenCore-Patcher.spec index 199793d77..49695bf1c 100644 --- a/OpenCore-Patcher.spec +++ b/OpenCore-Patcher.spec @@ -6,7 +6,7 @@ block_cipher = None a = Analysis(['OpenCore-Patcher.command'], - pathex=['Resources', 'Data'], + pathex=['resources', 'data'], binaries=[], datas=[('payloads', 'payloads')], hiddenimports=[], From f524c4441baa9a765adfb22802d0896d7cbca960 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 11:18:01 -0600 Subject: [PATCH 25/30] Update pci comment --- data/pci_data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/pci_data.py b/data/pci_data.py index 1c55f0b1b..8e6ef8be1 100644 --- a/data/pci_data.py +++ b/data/pci_data.py @@ -849,10 +849,10 @@ class intel_ids: class broadcom_ids: AppleBCMWLANBusInterfacePCIe = [ - 0x43DC, - 0x4464, - 0x4488, - 0x4425, + 0x43DC, # BCM4355 + 0x4464, # BCM4364 + 0x4488, # BCM4377b + 0x4425, # Unknown ] AirPortBrcmNIC = [ From 4f9abbaa49bb191b4b5a1058403f2ff68b4df181 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 11:21:59 -0600 Subject: [PATCH 26/30] Fix root patching from CLI --- resources/arguments.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/arguments.py b/resources/arguments.py index c2627f0d1..becb08fe7 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -1,7 +1,6 @@ import sys -import subprocess -from resources import defaults, build, utilities, validation -from data import example_data, model_array +from resources import defaults, build, utilities, validation, sys_patch +from data import model_array # Generic building args class arguments: @@ -102,7 +101,7 @@ If you plan to create the USB for another machine, please select the "Change Mod print("- Set Mojave/Catalina root patch configuration") settings.moj_cat_accel = True print("- Set System Volume patching") - self.patch_vol() + sys_patch.PatchSysVolume(settings.custom_model or settings.computer.real_model, settings).start_patch() elif self.args.unpatch_sys_vol: print("- Set System Volume unpatching") - self.unpatch_vol() \ No newline at end of file + sys_patch.PatchSysVolume(settings.custom_model or settings.computer.real_model, settings).start_unpatch() \ No newline at end of file From fdfbbf6ae1dd7bdd1ad6a3c945dd71d85e03d0db Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 11:52:42 -0600 Subject: [PATCH 27/30] Fix clear screen usage in GUI --- resources/utilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/utilities.py b/resources/utilities.py index 15cef94a3..11237e120 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -228,9 +228,9 @@ def cls(): return if not check_recovery(): os.system("cls" if os.name == "nt" else "clear") - else: + elif check_cli_args() is not None: print("\u001Bc") - + # Our GUI does not support clear screen def get_nvram(variable: str, uuid: str = None, *, decode: bool = False): # TODO: Properly fix for El Capitan, which does not print the XML representation even though we say to From 9184302c187693e33140ae5cf426092edfd566a4 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 12:11:54 -0600 Subject: [PATCH 28/30] Fix logic --- resources/utilities.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/utilities.py b/resources/utilities.py index 11237e120..721820144 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -226,11 +226,12 @@ def cls(): global clear if not clear: return - if not check_recovery(): - os.system("cls" if os.name == "nt" else "clear") - elif check_cli_args() is not None: - print("\u001Bc") - # Our GUI does not support clear screen + if check_cli_args() is not None: + # Our GUI does not support clear screen + if not check_recovery(): + os.system("cls" if os.name == "nt" else "clear") + else: + print("\u001Bc") def get_nvram(variable: str, uuid: str = None, *, decode: bool = False): # TODO: Properly fix for El Capitan, which does not print the XML representation even though we say to From e210c0cbe6f1f23968009ef49e6a2b5f7fe0f833 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 12:21:32 -0600 Subject: [PATCH 29/30] I need sleep --- resources/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/utilities.py b/resources/utilities.py index 721820144..00b5d5c21 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -226,7 +226,7 @@ def cls(): global clear if not clear: return - if check_cli_args() is not None: + if check_cli_args() is None: # Our GUI does not support clear screen if not check_recovery(): os.system("cls" if os.name == "nt" else "clear") From e8d2b4f63e5784e568253707addbd578914e24ae Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Oct 2021 12:47:27 -0600 Subject: [PATCH 30/30] Fix on-model building with CLI --- resources/arguments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/arguments.py b/resources/arguments.py index becb08fe7..4f3121a15 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -95,7 +95,7 @@ If you plan to create the USB for another machine, please select the "Change Mod # Avoid running the root patcher if we're just building if self.args.build: - build.BuildOpenCore(settings.custom_model, settings).build_opencore() + build.BuildOpenCore(settings.custom_model or settings.computer.real_model, settings).build_opencore() elif self.args.patch_sys_vol: if self.args.moj_cat_accel: print("- Set Mojave/Catalina root patch configuration")