From 06e0e9a2c04fd5ef3066646388f40d4f7ec31a83 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 9 Oct 2021 11:19:39 -0600 Subject: [PATCH] Fix formatting --- OpenCore-Patcher.command | 5 +- data/bluetooth_data.py | 19 +- data/cpu_data.py | 18 +- data/model_array.py | 2 +- data/os_data.py | 3 +- data/pci_data.py | 6 +- data/sip_data.py | 2 +- data/smbios_data.py | 496 ++++++++++++++++++++++------------- data/sys_patch_data.py | 2 +- resources/arguments.py | 10 +- resources/build.py | 30 ++- resources/cli_menu.py | 32 +-- resources/constants.py | 45 +--- resources/defaults.py | 6 +- resources/device_probe.py | 2 +- resources/generate_smbios.py | 29 +- resources/ioreg.py | 12 +- resources/os_probe.py | 5 +- resources/sys_patch.py | 41 +-- resources/utilities.py | 18 +- resources/validation.py | 10 +- 21 files changed, 469 insertions(+), 324 deletions(-) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index d1c235d6d..a5f5ff7b2 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -10,6 +10,7 @@ from pathlib import Path 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...") @@ -17,7 +18,7 @@ class OpenCoreLegacyPatcher: self.generate_base_data() if utilities.check_cli_args() is None: self.main_menu() - + def generate_base_data(self): self.constants.detected_os = os_probe.detect_kernel_major() self.constants.detected_os_minor = os_probe.detect_kernel_minor() @@ -28,7 +29,7 @@ class OpenCoreLegacyPatcher: defaults.generate_defaults.probe(self.computer.real_model, True, self.constants) 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.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") diff --git a/data/bluetooth_data.py b/data/bluetooth_data.py index c2dad8031..5d4faa989 100644 --- a/data/bluetooth_data.py +++ b/data/bluetooth_data.py @@ -1,14 +1,15 @@ import enum + class bluetooth_data(enum.IntEnum): # 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 # T2 - PCIe = 20 # Apple Silicon \ No newline at end of file + 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 # T2 + PCIe = 20 # Apple Silicon diff --git a/data/cpu_data.py b/data/cpu_data.py index 0e1e77e2c..641980694 100644 --- a/data/cpu_data.py +++ b/data/cpu_data.py @@ -1,22 +1,22 @@ import enum + class cpu_data(enum.IntEnum): pentium_4 = 0 yonah = 1 conroe = 2 penryn = 3 - nehalem = 4 # (Westmere included) + nehalem = 4 # (Westmere included) sandy_bridge = 5 # 2000 ivy_bridge = 6 # 3000 - haswell = 7 # 4000 - broadwell = 8 # 5000 - skylake = 9 # 6000 + haswell = 7 # 4000 + broadwell = 8 # 5000 + skylake = 9 # 6000 kaby_lake = 10 # 7000 coffee_lake = 11 # 8000 - comet_lake = 12 # 9000 + 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 + apple_dtk = 112 # A12 + apple_m1 = 114 # A14 + apple_m2 = 115 # A15 diff --git a/data/model_array.py b/data/model_array.py index f668a7ce3..5bf704a02 100644 --- a/data/model_array.py +++ b/data/model_array.py @@ -392,4 +392,4 @@ Missing_USB_Map = [ "MacPro4,1", "Xserve2,1", "Xserve3,1", -] \ No newline at end of file +] diff --git a/data/os_data.py b/data/os_data.py index dd206fa48..05ebcc80c 100644 --- a/data/os_data.py +++ b/data/os_data.py @@ -1,5 +1,6 @@ import enum + class os_data(enum.IntEnum): # OS Versions, Based off Major Kernel Version tiger = 8 @@ -16,4 +17,4 @@ class os_data(enum.IntEnum): catalina = 19 big_sur = 20 monterey = 21 - max_os = 99 \ No newline at end of file + max_os = 99 diff --git a/data/pci_data.py b/data/pci_data.py index 9bf0df392..62a2504dd 100644 --- a/data/pci_data.py +++ b/data/pci_data.py @@ -699,8 +699,8 @@ class amd_ids: 0x6898, # HD 5870 0x6899, # HD 5850 0x68B8, # HD 5770 - 0x68B0, # Unknown - 0x68B1, # Unknown + 0x68B0, # Unknown + 0x68B1, # Unknown 0x68A0, # HD 5870 (mobile) 0x68A1, # HD 5850 (mobile) 0x6840, # HD 7500M/7600M @@ -714,7 +714,7 @@ class amd_ids: 0x6759, # HD 6570/7570/8550 0x6740, # HD 6730M/6770M/7690M XT 0x6741, # HD 6630M/6650M/6750M/7670M/7690M - 0x6745, # Unknown + 0x6745, # Unknown ] diff --git a/data/sip_data.py b/data/sip_data.py index bf8345995..7e174c849 100644 --- a/data/sip_data.py +++ b/data/sip_data.py @@ -32,4 +32,4 @@ class system_integrity_protection: "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 index 38dd337ea..60be589c0 100644 --- a/data/smbios_data.py +++ b/data/smbios_data.py @@ -1,4 +1,17 @@ # Defines Model Data +# Terms: +# AAPL: AppleInternal Model (ie. not released to public) +# Board ID: The board ID is a unique identifier for the motherboard. +# Firmware Features: Hex bitmask denoting supported abilities of firmware. (ie. APFS, Large BaseSystem, etc.) +# Secure Boot Model: T2/Apple Silicon Model Identifier +# CPU Generation: Stock CPU supported by the board (generally lowest generation) +# Wireless Model: Driver used for wireless networking +# Bluetooth Model: Chipset model +# Screen Size: Size of the screen in inches (generally lowest size if multiple in same model) +# UGA Graphics: If model needs UGA to GOP conversion +# Ethernet Chipset: Vendor of the ethernet chipset (if multiple unique chipset within Vendor, chipset name is used) +# nForce Chipset: If model uses nForce chipset +# Switchable GPUs: If model uses a GMUX from resources import device_probe from data import cpu_data, os_data, bluetooth_data @@ -16,7 +29,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBook2,1": { "Board ID": "Mac-F4208CA9", "FirmwareFeatures": None, @@ -29,7 +41,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBook3,1": { "Board ID": "Mac-F22788C8", "FirmwareFeatures": "0xC0001407", @@ -42,7 +53,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBook4,1": { "Board ID": "Mac-F22788A9", "FirmwareFeatures": "0xC0001403", @@ -55,8 +65,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - - "MacBook5,1": { "Board ID": "Mac-F42D89C8", "FirmwareFeatures": "0xC0001403", @@ -69,8 +77,18 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - + "MacBook5,1_v2": { + "Board ID": "Mac-F42D89A9", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Screen Size": 13, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, "MacBook5,2": { "Board ID": "Mac-F22788AA", "FirmwareFeatures": "0xC0001403", @@ -83,8 +101,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBook6,1": { "Board ID": "Mac-F22C8AC8", "FirmwareFeatures": "0xFC0FE13F", @@ -97,8 +113,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBook7,1": { "Board ID": "Mac-F22C89C8", "FirmwareFeatures": "0xFC0FE13F", @@ -111,8 +125,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBook8,1": { "Board ID": "Mac-BE0E8AC46FE800CC", "FirmwareFeatures": "0xFC0FE13F", @@ -124,7 +136,17 @@ smbios_dictionary = { "Screen Size": 12, "Ethernet Chipset": None, }, - + "MacBook8,1_v2": { + "Board ID": "Mac-F305150B0C7DEEEF", + "FirmwareFeatures": "0xFC0FE13F", + "SecureBootModel": None, + "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, + "Screen Size": 12, + "Ethernet Chipset": None, + }, "MacBook9,1": { "Board ID": "Mac-9AE82516C7C6B903", "FirmwareFeatures": "0xFC0FE13F", @@ -136,7 +158,6 @@ smbios_dictionary = { "Screen Size": 12, "Ethernet Chipset": None, }, - "MacBook10,1": { "Board ID": "Mac-EE2EBD4B90B839A8", "FirmwareFeatures": "0xFC0FE13F", @@ -147,9 +168,7 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703_UART, "Screen Size": 12, "Ethernet Chipset": None, - }, - "MacBookAir1,1": { "Board ID": "Mac-F42C8CC8", "FirmwareFeatures": "0xC0001403", @@ -161,7 +180,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookAir2,1": { "Board ID": "Mac-F42D88C8", "FirmwareFeatures": "0xC0001403", @@ -174,8 +192,6 @@ smbios_dictionary = { "nForce Chipset": True, "Ethernet Chipset": None, }, - - "MacBookAir3,1": { "Board ID": "Mac-942452F5819B1C1B", "FirmwareFeatures": "0xD00DE137", @@ -188,8 +204,6 @@ smbios_dictionary = { "nForce Chipset": True, "Ethernet Chipset": None, }, - - "MacBookAir3,2": { "Board ID": "Mac-942C5DF58193131B", "FirmwareFeatures": "0xD00DE137", @@ -202,8 +216,6 @@ smbios_dictionary = { "nForce Chipset": True, "Ethernet Chipset": None, }, - - "MacBookAir4,1": { "Board ID": "Mac-C08A6BB70A942AC2", "FirmwareFeatures": "0xD00DE137", @@ -213,10 +225,8 @@ 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 + "Ethernet Chipset": "Broadcom", # Set for Apple Thunderbolt Adapter }, - - "MacBookAir4,2": { "Board ID": "Mac-742912EFDBEE19B3", "FirmwareFeatures": "0xD00DE137", @@ -226,10 +236,8 @@ 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 + "Ethernet Chipset": "Broadcom", # Set for Apple Thunderbolt Adapter }, - - "MacBookAir5,1": { "Board ID": "Mac-66F35F19FE2A0D05", "FirmwareFeatures": "0xE00DE137", @@ -241,8 +249,6 @@ smbios_dictionary = { "Screen Size": 11, "Ethernet Chipset": None, }, - - "MacBookAir5,2": { "Board ID": "Mac-2E6FAB96566FE58C", "FirmwareFeatures": "0xE00DE137", @@ -254,8 +260,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - - "MacBookAir6,1": { "Board ID": "Mac-35C1E88140C3E6CF", "FirmwareFeatures": "0xE00FE137", @@ -267,8 +271,6 @@ smbios_dictionary = { "Screen Size": 11, "Ethernet Chipset": None, }, - - "MacBookAir6,2": { "Board ID": "Mac-7DF21CB3ED6977E5", "FirmwareFeatures": "0xE00FE137", @@ -280,7 +282,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookAir7,1": { "Board ID": "Mac-9F18E312C5C2BF0B", "FirmwareFeatures": "0xFF0FF576", @@ -292,7 +293,6 @@ smbios_dictionary = { "Screen Size": 11, "Ethernet Chipset": None, }, - "MacBookAir7,2": { "Board ID": "Mac-937CB26E2E02BB01", "FirmwareFeatures": "0xFF0FF576", @@ -304,7 +304,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookAir8,1": { "Board ID": "Mac-827FAC58A8FDFA22", "FirmwareFeatures": "0xFD8FF42E", @@ -316,7 +315,30 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - + "MacBookAir8,1_v2": { + "Board ID": "Mac-112818653D3AABFC", + "FirmwareFeatures": "0xFD8FF42E", + "SecureBootModel": "j140k", # TODO: Verify + "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, + "Screen Size": 13, + "Ethernet Chipset": None, + }, + "AAPL_MacBookAir8,1": { + # AppleInternal MacBookAir8,1 + # True Model unknown + "Board ID": "Mac-827FAC58A8FDFA22", + "FirmwareFeatures": "0xFD8FF42E", + "SecureBootModel": "x589amlu", + "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, + "Screen Size": 13, + "Ethernet Chipset": None, + }, "MacBookAir8,2": { "Board ID": "Mac-226CB3C6A851A671", "FirmwareFeatures": "0xFD8FF42E", @@ -328,7 +350,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookAir9,1": { "Board ID": "Mac-0CFF9C7C2B63DF8D", "FirmwareFeatures": "0xFFAFF06E", @@ -340,7 +361,19 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - + "AAPL_MacBookAir9,1": { + # AppleInternal MacBookAir9,1 + # True Model unknown + "Board ID": "Mac-0CFF9C7C2B63DF8D", + "FirmwareFeatures": "0xFFAFF06E", + "SecureBootModel": "x589icly", + "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, + "Screen Size": 13, + "Ethernet Chipset": None, + }, "MacBookAir10,1": { "Board ID": None, "FirmwareFeatures": None, @@ -351,7 +384,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": None, }, - "MacBookPro1,1": { "Board ID": "Mac-F425BEC8", "FirmwareFeatures": "", @@ -364,7 +396,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBookPro1,2": { "Board ID": "Mac-F42DBEC8", "FirmwareFeatures": None, @@ -377,7 +408,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBookPro2,1": { "Board ID": "Mac-F42189C8", "FirmwareFeatures": None, @@ -390,7 +420,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBookPro2,2": { "Board ID": "Mac-F42187C8", "FirmwareFeatures": None, @@ -403,7 +432,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "MacBookPro3,1": { "Board ID": "Mac-F4238BC8", "FirmwareFeatures": "0xC0001407", @@ -416,7 +444,18 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - + "MacBookPro3,1_v2": { + "Board ID": "Mac-F42388C8", + "FirmwareFeatures": "0xC0001407", + "SecureBootModel": None, + "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, + "Screen Size": 15, # Shipped with 17 as well + "UGA Graphics": True, + "Ethernet Chipset": "Marvell", + }, "MacBookPro4,1": { "Board ID": "Mac-F42C89C8", "FirmwareFeatures": "0xC0001403", @@ -430,8 +469,19 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - - + "MacBookPro4,1_v2": { + "Board ID": "Mac-F42C86C8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Screen Size": 15, # Shipped with 17 as well + "Switchable GPUs": True, + "UGA Graphics": True, + "Ethernet Chipset": "Marvell", + }, "MacBookPro5,1": { "Board ID": "Mac-F42D86C8", "FirmwareFeatures": "0xC0001403", @@ -445,8 +495,19 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - + "MacBookPro5,1_v2": { + "Board ID": "Mac-F42D86A9", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Screen Size": 15, + "Switchable GPUs": True, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, "MacBookPro5,2": { "Board ID": "Mac-F2268EC8", "FirmwareFeatures": "0xC0001403", @@ -460,8 +521,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBookPro5,3": { "Board ID": "Mac-F22587C8", "FirmwareFeatures": "0xC0001403", @@ -475,8 +534,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBookPro5,4": { "Board ID": "Mac-F22587A1", "FirmwareFeatures": "0xC0001403", @@ -490,8 +547,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBookPro5,5": { "Board ID": "Mac-F2268AC8", "FirmwareFeatures": "0xC0001403", @@ -504,8 +559,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "MacBookPro6,1": { "Board ID": "Mac-F22589C8", "FirmwareFeatures": "0xC00DE137", @@ -518,8 +571,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro6,2": { "Board ID": "Mac-F22586C8", "FirmwareFeatures": "0xC00DE137", @@ -532,8 +583,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro7,1": { "Board ID": "Mac-F222BEC8", "FirmwareFeatures": "0xC00DE137", @@ -546,8 +595,6 @@ smbios_dictionary = { "Ethernet Chipset": "Broadcom", "nForce Chipset": True, }, - - "MacBookPro8,1": { "Board ID": "Mac-94245B3640C91C81", "FirmwareFeatures": "0xC00DE137", @@ -559,8 +606,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro8,2": { "Board ID": "Mac-94245A3940C91C80", "FirmwareFeatures": "0xC00DE137", @@ -573,8 +618,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro8,3": { "Board ID": "Mac-942459F5819B171B", "FirmwareFeatures": "0xC00DE137", @@ -587,8 +630,20 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": "Broadcom", }, - - + "AAPL_MacBookPro8,3": { + # AppleInternal MacBookPro8,3 + # True Model unknown + "Board ID": "Mac-94245AF5819B141B", + "FirmwareFeatures": "0xC00DE137", + "SecureBootModel": None, + "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, + "Screen Size": 17, + "Switchable GPUs": True, + "Ethernet Chipset": "Broadcom", + }, "MacBookPro9,1": { "Board ID": "Mac-4B7AC7E43945597E", "FirmwareFeatures": "0xC00DE137", @@ -601,8 +656,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro9,2": { "Board ID": "Mac-6F01561E16C75D06", "FirmwareFeatures": "0xC10DF577", @@ -614,8 +667,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": "Broadcom", }, - - "MacBookPro10,1": { "Board ID": "Mac-C3EC7CD22292981F", "FirmwareFeatures": "0xE00DE137", @@ -628,8 +679,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - - "MacBookPro10,2": { "Board ID": "Mac-AFD8A9D944EA4843", "FirmwareFeatures": "0xE00DE137", @@ -641,8 +690,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - - "MacBookPro11,1": { "Board ID": "Mac-189A3D4F975D5FFC", "FirmwareFeatures": "0xEB0FF577", @@ -654,8 +701,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - - "MacBookPro11,2": { "Board ID": "Mac-3CBD00234E554E41", "FirmwareFeatures": "0xEB0FF577", @@ -667,8 +712,6 @@ smbios_dictionary = { "Screen Size": 15, "Ethernet Chipset": None, }, - - "MacBookPro11,3": { "Board ID": "Mac-2BD1B31983FE1663", "FirmwareFeatures": "0xEB0FF577", @@ -681,7 +724,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro11,4": { "Board ID": "Mac-06F11FD93F0323C5", "FirmwareFeatures": "0xEB0FF577", @@ -693,7 +735,6 @@ smbios_dictionary = { "Screen Size": 15, "Ethernet Chipset": None, }, - "MacBookPro11,5": { "Board ID": "Mac-06F11F11946D27C5", "FirmwareFeatures": "0xEB0FF577", @@ -706,7 +747,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro12,1": { "Board ID": "Mac-E43C1C25D4880AD6", "FirmwareFeatures": "0xFD0FF576", @@ -718,7 +758,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro13,1": { "Board ID": "Mac-473D31EABEB93F9B", "FirmwareFeatures": "0xFC0FE137", @@ -730,7 +769,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro13,2": { "Board ID": "Mac-66E35819EE2D0D05", "FirmwareFeatures": "0xFC0FE137", @@ -742,7 +780,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro13,3": { "Board ID": "Mac-A5C67F76ED83108C", "FirmwareFeatures": "0xFC0FE137", @@ -755,7 +792,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro14,1": { "Board ID": "Mac-B4831CEBD52A0C4C", "FirmwareFeatures": "0xFF0FF57E", @@ -767,7 +803,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro14,2": { "Board ID": "Mac-CAD6701F7CEA0921", "FirmwareFeatures": "0xFF0FF57E", @@ -779,7 +814,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro14,3": { "Board ID": "Mac-551B86E5744E2388", "FirmwareFeatures": "0xFF0FF57E", @@ -792,7 +826,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro15,1": { "Board ID": "Mac-937A206F2EE63C01", "FirmwareFeatures": "0xFD8FF426", @@ -805,7 +838,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro15,2": { "Board ID": "Mac-827FB448E656EC26", "FirmwareFeatures": "0xFD8FF426", @@ -817,7 +849,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro15,3": { "Board ID": "Mac-1E7E29AD0135F9BC", "FirmwareFeatures": "0xFD8FF426", @@ -830,7 +861,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro15,4": { "Board ID": "Mac-53FDB3D8DB8CA971", "FirmwareFeatures": "0xFD8FF426", @@ -842,7 +872,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro16,1": { "Board ID": "Mac-E1008331FDC96864", "FirmwareFeatures": "0xFDAFF066", @@ -855,7 +884,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro16,2": { "Board ID": "Mac-5F9802EFE386AA28", "FirmwareFeatures": "0xFFAFF06E", @@ -867,7 +895,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro16,3": { "Board ID": "Mac-E7203C0F68AA0004", "FirmwareFeatures": "0xFDAFF066", @@ -879,7 +906,6 @@ smbios_dictionary = { "Screen Size": 13, "Ethernet Chipset": None, }, - "MacBookPro16,4": { "Board ID": "Mac-A61BADE1FDAD7B05", "FirmwareFeatures": "0xFDAFF066", @@ -892,7 +918,6 @@ smbios_dictionary = { "Switchable GPUs": True, "Ethernet Chipset": None, }, - "MacBookPro17,1": { "Board ID": None, "FirmwareFeatures": None, @@ -903,7 +928,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": None, }, - "Macmini1,1": { "Board ID": "Mac-F4208EC8", "FirmwareFeatures": None, @@ -914,7 +938,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Ethernet Chipset": "Marvell", }, - "Macmini2,1": { "Board ID": "Mac-F4208EAA", "FirmwareFeatures": None, @@ -925,7 +948,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2045, "Ethernet Chipset": "Marvell", }, - "Macmini3,1": { "Board ID": "Mac-F22C86C8", "FirmwareFeatures": "0xC0001403", @@ -937,8 +959,6 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - "Macmini4,1": { "Board ID": "Mac-F2208EC8", "FirmwareFeatures": "0xC00C9423", @@ -949,8 +969,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Ethernet Chipset": "Broadcom", }, - - "Macmini5,1": { "Board ID": "Mac-8ED6AF5B48C039E1", "FirmwareFeatures": "0xD00DE137", @@ -961,8 +979,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Ethernet Chipset": "Broadcom", }, - - "Macmini5,2": { "Board ID": "Mac-4BC72D62AD45599E", "FirmwareFeatures": "0xD00DE137", @@ -973,8 +989,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Ethernet Chipset": "Broadcom", }, - - "Macmini5,3": { "Board ID": "Mac-7BA5B2794B2CDB12", "FirmwareFeatures": "0xD00DE137", @@ -985,8 +999,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2070, "Ethernet Chipset": "Broadcom", }, - - "Macmini6,1": { "Board ID": "Mac-031AEE4D24BFF0B1", "FirmwareFeatures": "0xE00DE137", @@ -997,8 +1009,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Ethernet Chipset": "Broadcom", }, - - "Macmini6,2": { "Board ID": "Mac-F65AE981FFA204ED", "FirmwareFeatures": "0xE00DE137", @@ -1009,7 +1019,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Ethernet Chipset": "Broadcom", }, - "Macmini7,1": { "Board ID": "Mac-35C5E08120C7EEAF", "FirmwareFeatures": "0xE00DE137", @@ -1020,7 +1029,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - "Macmini8,1": { "Board ID": "Mac-7BA5B2DFE22DDD8C", "FirmwareFeatures": "0xFD8FF466", @@ -1031,7 +1039,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "Macmini9,1": { "Board ID": None, "FirmwareFeatures": None, @@ -1042,7 +1049,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": "Broadcom", }, - "iMac4,1": { "Board ID": "Mac-F42786C8", "FirmwareFeatures": None, @@ -1054,7 +1060,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "iMac4,2": { "Board ID": "Mac-F4218EC8", "FirmwareFeatures": None, @@ -1066,7 +1071,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "iMac5,1": { "Board ID": "Mac-F4228EC8", "FirmwareFeatures": None, @@ -1078,7 +1082,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "iMac5,2": { "Board ID": "Mac-F4218EC8", "FirmwareFeatures": None, @@ -1090,7 +1093,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "iMac6,1": { "Board ID": "Mac-F4218FC8", "FirmwareFeatures": None, @@ -1102,7 +1104,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - "iMac7,1": { "Board ID": "Mac-F42386C8", "FirmwareFeatures": "0xC0001407", @@ -1114,8 +1115,17 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - - + "iMac7,1_v2": { + "Board ID": "Mac-F4238CC8", + "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, + "Ethernet Chipset": "Marvell", + }, "iMac8,1": { "Board ID": "Mac-F227BEC8", "FirmwareFeatures": "0xC0001403", @@ -1127,8 +1137,17 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Marvell", }, - - + "iMac8,1_v2": { + "Board ID": "Mac-F226BEC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "UGA Graphics": True, + "Ethernet Chipset": "Marvell", + }, "iMac9,1": { "Board ID": "Mac-F2218FA9", "FirmwareFeatures": "0xC0001403", @@ -1140,8 +1159,39 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - + "iMac9,1_v2": { + "Board ID": "Mac-F2218EA9", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, + "iMac9,1_v3": { + "Board ID": "Mac-F2218EC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, + "iMac9,1_v4": { + "Board ID": "Mac-F2218FC8", + "FirmwareFeatures": "0xC0001403", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, "iMac10,1": { "Board ID": "Mac-F221DCC8", # "Board ID": "Mac-F2268CC8", @@ -1154,8 +1204,28 @@ smbios_dictionary = { "Ethernet Chipset": "Nvidia", "nForce Chipset": True, }, - - + "iMac10,1_v2": { + "Board ID": "Mac-F2268CC8", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, + "iMac10,1_v3": { + "Board ID": "Mac-F2268DC8", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Nvidia", + "nForce Chipset": True, + }, "iMac11,1": { "Board ID": "Mac-F2268DAE", "FirmwareFeatures": "0xE00DE137", @@ -1166,8 +1236,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Broadcom", }, - - "iMac11,2": { "Board ID": "Mac-F2238AC8", "FirmwareFeatures": "0xC00C9423", @@ -1178,8 +1246,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Broadcom", }, - - "iMac11,3": { "Board ID": "Mac-F2238BAE", "FirmwareFeatures": "0xE00DE137", @@ -1190,8 +1256,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Broadcom", }, - - "iMac12,1": { "Board ID": "Mac-942B5BF58194151B", "FirmwareFeatures": "0xE00DE137", @@ -1202,8 +1266,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Broadcom", }, - - "iMac12,2": { "Board ID": "Mac-942B59F58194171B", "FirmwareFeatures": "0xE00DE137", @@ -1214,8 +1276,18 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Broadcom", }, - - + "AAPL_iMac12,2": { + # AppleInternal iMac12,2 + # True Model unknown + "Board ID": "Mac-942B5B3A40C91381", + "FirmwareFeatures": "0xE00DE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Broadcom", + }, "iMac13,1": { "Board ID": "Mac-00BE6ED71E35EB86", "FirmwareFeatures": "0xE00DE137", @@ -1226,8 +1298,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Ethernet Chipset": "Broadcom", }, - - "iMac13,2": { "Board ID": "Mac-FC02E91DDD3FA6A4", "FirmwareFeatures": "0xE00DE137", @@ -1238,8 +1308,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Ethernet Chipset": "Broadcom", }, - - "iMac13,3": { "Board ID": "Mac-7DF2A3B5E5D671ED", "FirmwareFeatures": "0xE00DE137", @@ -1250,8 +1318,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v1, "Ethernet Chipset": "Broadcom", }, - - "iMac14,1": { "Board ID": "Mac-031B6874CF7F642A", "FirmwareFeatures": "0xFB0FF577", @@ -1262,8 +1328,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - - "iMac14,2": { "Board ID": "Mac-27ADBB7B4CEE8E61", "FirmwareFeatures": "0xE00FE137", @@ -1274,8 +1338,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - - "iMac14,3": { "Board ID": "Mac-77EB7D7DAF985301", "FirmwareFeatures": "0xE00FE137", @@ -1286,8 +1348,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - - "iMac14,4": { "Board ID": "Mac-81E3E92DD6088272", "FirmwareFeatures": "0xF00FE137", @@ -1298,8 +1358,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - - "iMac15,1": { "Board ID": "Mac-42FD25EABCABB274", "FirmwareFeatures": "0xF80FE137", @@ -1310,7 +1368,16 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - + "iMac15,1_v2": { + "Board ID": "Mac-FA842E06C61E91C5", + "FirmwareFeatures": "0xF80FE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Broadcom", + }, "iMac16,1": { "Board ID": "Mac-A369DDC4E67F1C45", "FirmwareFeatures": "0xFC0FE137", @@ -1321,7 +1388,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - "iMac16,2": { "Board ID": "Mac-FFE5EF870D7BA81A", "FirmwareFeatures": "0xFC0FE137", @@ -1332,7 +1398,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - "iMac17,1": { "Board ID": "Mac-DB15BD556843C820", # "Board ID": "Mac-65CE76090165799A", @@ -1345,7 +1410,27 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - + "iMac17,1_v2": { + "Board ID": "Mac-65CE76090165799A", + # "Board ID": "Mac-B809C3757DA9BB8D", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Broadcom", + }, + "iMac17,1_v3": { + "Board ID": "Mac-B809C3757DA9BB8D", + "FirmwareFeatures": "0xFC0FE137", + "SecureBootModel": None, + "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, + "Ethernet Chipset": "Broadcom", + }, "iMac18,1": { "Board ID": "Mac-4B682C642B45593E", "FirmwareFeatures": "0xFD0FF576", @@ -1356,7 +1441,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", }, - "iMac18,2": { "Board ID": "Mac-77F17D7DA9285301", "FirmwareFeatures": "0xFD0FF576", @@ -1367,7 +1451,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", }, - "iMac18,3": { "Board ID": "Mac-BE088AF8C5EB4FA2", "FirmwareFeatures": "0xFD0FF576", @@ -1378,7 +1461,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20703, "Ethernet Chipset": "Broadcom", }, - "iMac19,1": { "Board ID": "Mac-AA95B1DDAB278B95", "FirmwareFeatures": "0xFD8FF576", @@ -1389,7 +1471,17 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - + "AAPL_iMac19,1": { + # AppleInternal iMac19,1 unit + "Board ID": "Mac-CF21D135A7D34AA6", + "FirmwareFeatures": "0xFD8FF576", + "SecureBootModel": None, + "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", + }, "iMac19,2": { "Board ID": "Mac-63001698E7A34814", "FirmwareFeatures": "0xFD8FF576", @@ -1400,7 +1492,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "iMac20,1": { "Board ID": "Mac-CFF7D910A743CAAF", "FirmwareFeatures": "0xFD8FF576", @@ -1411,7 +1502,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "iMac20,2": { "Board ID": "Mac-AF89B6D9451A490B", "FirmwareFeatures": "0xFD8FF576", @@ -1422,7 +1512,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "iMac21,1": { "Board ID": None, "FirmwareFeatures": None, @@ -1433,7 +1522,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": "Broadcom", }, - "iMac21,2": { "Board ID": None, "FirmwareFeatures": None, @@ -1444,8 +1532,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": "Broadcom", }, - - "iMacPro1,1": { "Board ID": "Mac-7BA5B2D9E42DDD94", "FirmwareFeatures": "0xFD8FF53E", @@ -1456,7 +1542,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "MacPro1,1": { "Board ID": "Mac-F4208DC8", "FirmwareFeatures": "0x80000015", @@ -1468,7 +1553,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Intel 80003ES2LAN", }, - "MacPro2,1": { "Board ID": "Mac-F4208DA9", "FirmwareFeatures": "0xC0000015", @@ -1480,7 +1564,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Intel 80003ES2LAN", }, - "MacPro3,1": { "Board ID": "Mac-F42C88C8", "FirmwareFeatures": "0xC0001403", @@ -1492,8 +1575,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Intel 80003ES2LAN", }, - - "MacPro4,1": { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE001F537", @@ -1504,8 +1585,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Intel 82574L", }, - - "MacPro5,1": { "Board ID": "Mac-F221BEC8", "FirmwareFeatures": "0xE80FE137", @@ -1516,7 +1595,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Ethernet Chipset": "Intel 82574L", }, - "MacPro6,1": { "Board ID": "Mac-F60DEB81FF30ACF6", "FirmwareFeatures": "0xE90FF576", @@ -1527,7 +1605,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, "Ethernet Chipset": "Broadcom", }, - "MacPro7,1": { "Board ID": "Mac-27AD2F918AE68F61", "FirmwareFeatures": "0xFDAFF066", @@ -1538,7 +1615,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.UART, "Ethernet Chipset": "Broadcom", }, - "Xserve1,1": { "Board ID": "Mac-F4208AC8", "FirmwareFeatures": None, @@ -1550,7 +1626,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Intel 80003ES2LAN", }, - "Xserve2,1": { "Board ID": "Mac-F42289C8", "FirmwareFeatures": "0xC0001403", @@ -1562,7 +1637,6 @@ smbios_dictionary = { "UGA Graphics": True, "Ethernet Chipset": "Intel 80003ES2LAN", }, - "Xserve3,1": { "Board ID": "Mac-F223BEC8", "FirmwareFeatures": "0xE001F537", @@ -1573,7 +1647,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, "Ethernet Chipset": "Intel 82574L", }, - "ADP3,2": { "Board ID": None, "FirmwareFeatures": None, @@ -1584,7 +1657,6 @@ smbios_dictionary = { "Bluetooth Model": bluetooth_data.bluetooth_data.PCIe, "Ethernet Chipset": "Broadcom", }, - "AAPLJ53,1": { # AppleInternal MacBookPro11,4 "Board ID": "Mac-C08A65A66A9A3BA2", @@ -1595,5 +1667,53 @@ smbios_dictionary = { "Wireless Model": device_probe.Broadcom.Chipsets.AirportBrcmNIC, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM20702_v2, }, - -} \ No newline at end of file + "Intel Virtual Machine": { + "Board ID": "VMM-x86_64", + "FirmwareFeatures": None, + "SecureBootModel": "x86legacy", + "CPU Generation": cpu_data.cpu_data.penryn.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, + "VirtualMac1,1": { + # Apple Silicon Virtual Machine + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "vma1macos", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, + "VirtualMac2,1": { + # Apple Silicon Virtual Machine + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "vma2macos", + "CPU Generation": cpu_data.cpu_data.apple_m1.value, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, + "iBridge2,11": { + # Unknown ID, Intel based, present in Monterey + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j230", + "CPU Generation": None, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, + "iBridge2,13": { + # Unknown ID, Intel based, present in Monterey + "Board ID": None, + "FirmwareFeatures": None, + "SecureBootModel": "j214", + "CPU Generation": None, + "Max OS Supported": os_data.os_data.max_os, + "Wireless Model": None, + "Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable, + }, +} diff --git a/data/sys_patch_data.py b/data/sys_patch_data.py index eb5f29de6..eb234852a 100644 --- a/data/sys_patch_data.py +++ b/data/sys_patch_data.py @@ -169,7 +169,7 @@ AddIntelGen2AccelStock = [ AddIntelGen2AccelPatched = [ "AppleIntelSNBGraphicsFB.kext", -], +] AddIntelGen3Accel = [ "AppleIntelFramebufferCapri.kext", diff --git a/resources/arguments.py b/resources/arguments.py index 4f3121a15..8e2623b91 100644 --- a/resources/arguments.py +++ b/resources/arguments.py @@ -6,7 +6,7 @@ from data import model_array class arguments: def __init__(self): self.args = utilities.check_cli_args() - + def parse_arguments(self, settings): if self.args.model: if self.args.model: @@ -33,7 +33,7 @@ If you plan to create the USB for another machine, please select the "Change Mod print("- Set verbose configuration") settings.verbose_debug = True else: - settings.verbose_debug = False # Override Defaults detected + settings.verbose_debug = False # Override Defaults detected if self.args.debug_oc: print("- Set OpenCore DEBUG configuration") settings.opencore_debug = True @@ -48,12 +48,12 @@ If you plan to create the USB for another machine, please select the "Change Mod print("- Set Disable SIP configuration") settings.sip_status = False else: - settings.sip_status = True # Override Defaults detected + 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 + settings.secure_status = True # Override Defaults detected if self.args.vault: print("- Set Vault configuration") settings.vault = True @@ -104,4 +104,4 @@ If you plan to create the USB for another machine, please select the "Change Mod 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") - sys_patch.PatchSysVolume(settings.custom_model or settings.computer.real_model, settings).start_unpatch() \ No newline at end of file + sys_patch.PatchSysVolume(settings.custom_model or settings.computer.real_model, settings).start_unpatch() diff --git a/resources/build.py b/resources/build.py index 2e0858dd6..69d293e76 100644 --- a/resources/build.py +++ b/resources/build.py @@ -106,7 +106,12 @@ class BuildOpenCore: # 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.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), + ( + "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, @@ -117,11 +122,21 @@ 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 model_array.LegacyAudio or self.model in model_array.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 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), + ( + "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"]), ]: @@ -136,7 +151,7 @@ class BuildOpenCore: # 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 @@ -415,7 +430,6 @@ class BuildOpenCore: # Used to enable Audio support for non-standard dGPUs self.enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) - def check_firewire(model): # MacBooks never supported FireWire # Pre-Thunderbolt MacBook Airs as well @@ -745,12 +759,12 @@ class BuildOpenCore: self.config["PlatformInfo"]["PlatformNVRAM"]["FirmwareFeaturesMask"] = fw_feature self.config["PlatformInfo"]["SMBIOS"]["FirmwareFeatures"] = fw_feature self.config["PlatformInfo"]["SMBIOS"]["FirmwareFeaturesMask"] = fw_feature - + # Board ID self.config["PlatformInfo"]["DataHub"]["BoardProduct"] = self.spoofed_board self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board - + # Model (ensures tables are not mismatched, even if we're not spoofing) self.config["PlatformInfo"]["DataHub"]["SystemProductName"] = self.model self.config["PlatformInfo"]["SMBIOS"]["SystemProductName"] = self.model @@ -866,7 +880,7 @@ class BuildOpenCore: for gpu in ["Vendor10deDevice0a34", "Vendor10deDevice0a29"]: agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board][gpu]["BoostPState"] = [2, 2, 2, 2] agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board][gpu]["BoostTime"] = [2, 2, 2, 2] - + for entry in list(agpm_config["IOKitPersonalities"]["AGPM"]["Machines"]): if not entry.startswith(self.spoofed_board): agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(entry) diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 3b6105a06..a61d1c6ea 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -632,7 +632,7 @@ handle acceleration tasks. print("") print(self.constants.computer) input("\nPress [ENTER] to exit: ") - + def applealc_support(self): utilities.cls() utilities.header(["Set AppleALC usage"]) @@ -656,7 +656,7 @@ If AppleALC is detected, the Patcher will not install AppleHDA. print("Returning to previous menu") else: self.applealc_support() - + def dGPU_switch_support(self): utilities.cls() utilities.header(["Set Windows GMUX support"]) @@ -677,7 +677,7 @@ for Windows may prefer to only work with the dGPU and eGPU active. print("Returning to previous menu") else: self.dGPU_switch_support() - + def set_surplus(self): utilities.cls() utilities.header(["Override SurPlus MaxKernel"]) @@ -703,7 +703,7 @@ the event there's issues. print("Returning to previous menu") else: self.set_surplus() - + def credits(self): utilities.TUIOnlyPrint( ["Credits"], @@ -749,7 +749,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' 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"]) @@ -771,7 +771,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' sys_patch.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): @@ -791,7 +791,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' menu.add_menu_option(option[0], function=option[1]) response = menu.start() - def patcher_settings(self): response = None @@ -831,9 +830,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [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] - ] + [[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 [] ) @@ -909,13 +906,19 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [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"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], + [ + 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: @@ -943,9 +946,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' response = menu.start() - - - big_sur = """Patches Root volume to fix misc issues such as: - Non-Metal Graphics Acceleration @@ -1012,4 +1012,4 @@ 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 32abb26fe..cb8426803 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -13,7 +13,7 @@ from resources import device_probe class Constants: def __init__(self): # Patcher Versioning - self.patcher_version = "0.3.0" # OpenCore-Legacy-Patcher + self.patcher_version = "0.3.0" # OpenCore-Legacy-Patcher self.patcher_support_pkg_version = "0.1.6" # PatcherSupportPkg self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/" self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/" @@ -165,33 +165,6 @@ class Constants: self.big_sur = 20 self.monterey = 21 - # Vendor IDs - self.pci_nvidia = "10DE" - self.pci_amd_ati = "1002" - self.pci_intel = "8086" - self.pci_broadcom = "14E4" - self.pci_atheros = "168C" - self.pci_apple = "106B" - self.pci_aquantia = "1D6A" - self.pci_marvell = "11AB" - self.pci_syskonnect = "1148" - - # Class Codes - ## https://pci-ids.ucw.cz/read/PD - self.classcode_sata = "01060100" - self.classcode_nvme = "02080100" - self.classcode_nvme_generic = "02800100" - self.classcode_wifi = "00800200" - self.classcode_gpu = "00000300" - self.classcode_gpu_variant = "00800300" - self.classcode_xhci = "30030C00" - self.classcode_ethernet = "00000200" - - # Nvidia GPU Architecture - self.arch_tesla = "NV50" - self.arch_fermi = "GF100" - self.arch_kepler = "GK100" - self.legacy_accel_support = [ self.mojave, self.catalina, @@ -256,7 +229,7 @@ class Constants: @property def restrictevents_path(self): return self.payload_kexts_path / Path(f"Acidanthera/RestrictEvents-v{self.restrictevents_version}.zip") - + @property def efi_disabler_path(self): return self.payload_kexts_path / Path(f"Acidanthera/EFICheckDisabler-v{self.restrictevents_version}.zip") @@ -569,7 +542,7 @@ class Constants: @property def payload_apple_private_frameworks_path_brightness(self): return self.payload_apple_private_frameworks_path / Path("Brightness-Control") - + @property def payload_apple_private_frameworks_path_legacy_drm(self): return self.payload_apple_private_frameworks_path / Path("Legacy-GVA") @@ -626,7 +599,7 @@ class Constants: @property def legacy_brightness(self): return self.payload_apple_kexts_path / Path("Brightness-Control") - + @property def legacy_mux_path(self): return self.payload_apple_kexts_path / Path("Legacy-Mux") @@ -674,8 +647,8 @@ class Constants: "Mac-942459F5819B171B", # MacBookPro8,3 "Mac-C08A6BB70A942AC2", # MacBookAir4,1 "Mac-742912EFDBEE19B3", # MacBookAir4,2 - "Mac-8ED6AF5B48C039E1", # Macmini5,1 - "Mac-7BA5B2794B2CDB12", # Macmini5,3 - "Mac-942B5BF58194151B", # iMac12,1 - "Mac-942B59F58194171B", # iMac12,2 - ] \ No newline at end of file + "Mac-8ED6AF5B48C039E1", # Macmini5,1 + "Mac-7BA5B2794B2CDB12", # Macmini5,3 + "Mac-942B5BF58194151B", # iMac12,1 + "Mac-942B59F58194171B", # iMac12,2 + ] diff --git a/resources/defaults.py b/resources/defaults.py index 33b0c3249..ac15328f3 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -2,7 +2,8 @@ from resources import utilities, device_probe from data import model_array -class generate_defaults(): + +class generate_defaults: def probe(model, host_is_target, settings): # Generate Default Data # Takes in Settings data set, and returns updated Settings @@ -48,7 +49,6 @@ class generate_defaults(): 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 @@ -72,4 +72,4 @@ class generate_defaults(): 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() diff --git a/resources/device_probe.py b/resources/device_probe.py index f1e4b3c30..a360392d0 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -26,7 +26,7 @@ class PCIDevice: vendor_id: int # The vendor ID of this PCI device device_id: int # The device ID of this PCI device - class_code: int # The class code of this PCI device + class_code: int # The class code of this PCI device - https://pci-ids.ucw.cz/read/PD # ioregistryentry: Optional[ioreg.IORegistryEntry] = None name: Optional[str] = None # Name of IORegistryEntry diff --git a/resources/generate_smbios.py b/resources/generate_smbios.py index 1b1caf44d..1dd01437b 100644 --- a/resources/generate_smbios.py +++ b/resources/generate_smbios.py @@ -1,6 +1,7 @@ from data import smbios_data, os_data from resources import utilities + def set_smbios_model_spoof(model): try: smbios_data.smbios_dictionary[model]["Screen Size"] @@ -53,6 +54,7 @@ def set_smbios_model_spoof(model): # Unknown Model raise Exception(f"Unknown SMBIOS for spoofing: {model}") + def update_firmware_features(firmwarefeature): # Adjust FirmwareFeature to support everything macOS requires # APFS Bit (19/20): 10.13+ (OSInstall) @@ -62,7 +64,8 @@ def update_firmware_features(firmwarefeature): 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") @@ -72,4 +75,26 @@ def generate_fw_features(model, custom): else: firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16) firmwarefeature = update_firmware_features(firmwarefeature) - return firmwarefeature \ No newline at end of file + return firmwarefeature + + +def find_model_off_board(board): + # Find model based off Board ID provided + # Return none if unknown + + # Strip extra data from Target Types (ap, uppercase) + if not (board.startswith("Mac-") or board.startswith("VMM-")): + if board.lower().endswith("ap"): + board = board[:-2] + board = board.lower() + + for key in smbios_data.smbios_dictionary: + if board in [smbios_data.smbios_dictionary[key]["Board ID"], smbios_data.smbios_dictionary[key]["SecureBootModel"]]: + if key.endswith("_v2") or key.endswith("_v3") or key.endswith("_v4"): + # smbios_data has duplicate SMBIOS to handle multiple board IDs + key = key[:-3] + if key == "MacPro4,1": + # 4,1 and 5,1 have the same board ID, best to return the newer ID + key = "MacPro5,1" + return key + return None diff --git a/resources/ioreg.py b/resources/ioreg.py index e26b22a1c..732035c54 100644 --- a/resources/ioreg.py +++ b/resources/ioreg.py @@ -7,13 +7,13 @@ from typing import NewType, Union import subprocess try: - import objc + import objc except ImportError: - subprocess.run(["pip3", "install", "pyobjc"], stdout=subprocess.PIPE) - try: - import objc - except ImportError: - raise Exception("Missing PyObjc library!\nPlease run the following before starting OCLP:\npip3 install pyobjc") + subprocess.run(["pip3", "install", "pyobjc"], stdout=subprocess.PIPE) + try: + import objc + except ImportError: + raise Exception("Missing PyObjc library!\nPlease run the following before starting OCLP:\npip3 install pyobjc") from CoreFoundation import CFRelease, kCFAllocatorDefault # type: ignore # pylint: disable=no-name-in-module from Foundation import NSBundle # type: ignore # pylint: disable=no-name-in-module diff --git a/resources/os_probe.py b/resources/os_probe.py index 38596d5f8..f779274be 100644 --- a/resources/os_probe.py +++ b/resources/os_probe.py @@ -3,17 +3,20 @@ 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 + return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() diff --git a/resources/sys_patch.py b/resources/sys_patch.py index 2a6a36172..e3ef97771 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -237,7 +237,9 @@ 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") - bless = utilities.elevated(["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + bless = utilities.elevated( + ["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) if bless.returncode != 0: print("- Unable to create new snapshot") print("Reason for snapshot failure:") @@ -268,7 +270,7 @@ set million colour before rebooting""" def unmount_drive(self): print("- Unmounting Root Volume (Don't worry if this fails)") 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) @@ -289,7 +291,6 @@ set million colour before rebooting""" 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) @@ -313,11 +314,13 @@ set million colour before rebooting""" 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(utilities.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: @@ -411,7 +414,7 @@ set million colour before rebooting""" print("- Installing basic Sandy Bridge Framebuffer Kext patches for generic OS") self.add_new_binaries(sys_patch_data.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path) self.gpu_accel_legacy_sandybridge_board_id() - + def gpu_accel_legacy_sandybridge_board_id(self): if self.constants.computer.reported_board_id in self.constants.sandy_board_id_stock: print("- Using stock AppleIntelSNBGraphicsFB") @@ -423,13 +426,17 @@ set million colour before rebooting""" utilities.elevated(["rm", "-r", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Add kext print("- Adding AppleIntelSNBGraphicsFB.kext") - utilities.elevated(["cp", "-r", f"{self.constants.legacy_intel_gen2_path}/AppleIntelSNBGraphicsFB-Clean.kext", f"{self.mount_extensions}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated( + ["cp", "-r", f"{self.constants.legacy_intel_gen2_path}/AppleIntelSNBGraphicsFB-Clean.kext", f"{self.mount_extensions}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) # Rename kext - utilities.elevated(["mv", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB-Clean.kext", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + utilities.elevated( + ["mv", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB-Clean.kext", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) # Fix permissions utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - + else: # Adjust board ID for spoofs print("- Using Board ID patched AppleIntelSNBGraphicsFB") @@ -441,7 +448,7 @@ set million colour before rebooting""" # Fix permissions utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/AppleIntelSNBGraphicsFB.kext"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - + def gpu_framebuffer_ivybridge_master(self): if self.constants.detected_os == self.constants.monterey: print("- Installing IvyBridge Acceleration Kext patches for Monterey") @@ -464,7 +471,7 @@ set million colour before rebooting""" else: print("- Installing Kepler Kext patches for generic OS") self.add_new_binaries(sys_patch_data.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) - + def gpu_accel_legacy_gva(self): print("- Merging AppleGVA Hardware Accel patches for non-Metal") utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_legacy_drm}/", self.mount_private_frameworks], stdout=subprocess.PIPE) @@ -590,7 +597,7 @@ set million colour before rebooting""" if self.legacy_wifi is True: print("- Installing legacy Wireless support") self.add_wifi_patch() - + if self.legacy_gmux is True: print("- Installing Legacy Mux Brightness support") self.add_legacy_mux_patch() @@ -714,7 +721,7 @@ set million colour before rebooting""" self.amd_ts2 = False self.iron_gpu = False self.sandy_gpu = False - + def detect_demux(self): # If GFX0 is missing, assume machine was demuxed # -wegnoegpu would also trigger this, so ensure arg is not present @@ -724,7 +731,6 @@ set million colour before rebooting""" if igpu and not dgpu: return True return False - def detect_patch_set(self): self.detect_gpus() @@ -744,7 +750,7 @@ set million colour before rebooting""" ) or (isinstance(self.constants.computer.wifi, device_probe.Atheros) and self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): if self.constants.detected_os > self.constants.big_sur: self.legacy_wifi = True - + if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]: # Sierra uses a legacy GMUX control method needed for dGPU switching on MacBookPro5,x # Same method is also used for demuxed machines @@ -827,10 +833,7 @@ set million colour before rebooting""" print("\nCannot patch! Please disable AMFI.") print("For Hackintoshes, please add amfi_get_out_of_my_way=1 to boot-args") - if self.check_board_id is True and ( - self.computer.reported_board_id not in self.constants.sandy_board_id and - self.computer.reported_board_id not in self.constants.sandy_board_id_stock - ): + if self.check_board_id is True and (self.computer.reported_board_id not in self.constants.sandy_board_id and self.computer.reported_board_id not in self.constants.sandy_board_id_stock): print("\nCannot patch! Board ID not supported by AppleIntelSNBGraphicsFB") print(f"Detected Board ID: {self.computer.reported_board_id}") print("Please ensure your Board ID is listed below:") diff --git a/resources/utilities.py b/resources/utilities.py index 00b5d5c21..2f8e8d7d9 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -129,6 +129,7 @@ def amfi_status(): else: return True + def check_kext_loaded(kext_name, os_version): if os_version > constants.Constants().catalina: kext_loaded = subprocess.run(["kmutil", "showloaded", "--list-only", "--variant-suffix", "release"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) @@ -139,6 +140,7 @@ def check_kext_loaded(kext_name, os_version): else: return False + def check_oclp_boot(): if get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True): return True @@ -194,7 +196,10 @@ def patching_status(os_sip, os): # 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) + and 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: @@ -233,6 +238,7 @@ def cls(): 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 @@ -299,6 +305,7 @@ 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 @@ -307,6 +314,7 @@ def elevated(*args, **kwargs) -> subprocess.CompletedProcess: 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) @@ -339,16 +347,12 @@ def check_cli_args(): # 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 - ): + 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] # if add_quit: menu_options.append(return_option) diff --git a/resources/validation.py b/resources/validation.py index 92181041c..4f91d4145 100644 --- a/resources/validation.py +++ b/resources/validation.py @@ -1,4 +1,3 @@ - import subprocess from resources import build from data import example_data, model_array @@ -22,8 +21,9 @@ def validate(settings): 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}") @@ -36,7 +36,7 @@ def validate(settings): 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 @@ -50,7 +50,7 @@ def validate(settings): 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() @@ -68,4 +68,4 @@ def validate(settings): settings.disable_tb = True settings.force_surplus = True build_prebuilt() - build_dumps() \ No newline at end of file + build_dumps()