From 82b4d20b174cc60f63f5fadae5bca0b44547e12e Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 8 May 2022 21:14:41 -0600 Subject: [PATCH] sys_patch_dict.py: Adjust Display Name variable --- data/sys_patch_dict.py | 10 +++++----- resources/device_probe.py | 18 ------------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/data/sys_patch_dict.py b/data/sys_patch_dict.py index 12d79a0ec..4b97ad3a3 100644 --- a/data/sys_patch_dict.py +++ b/data/sys_patch_dict.py @@ -22,7 +22,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): sys_patch_dict = { "Graphics": { "Non-Metal Common": { - "Display Name": None, + "Display Name": "", "OS Support": { "Minimum OS Support": { "OS Major": non_metal_os_support[0], @@ -86,7 +86,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): "Non-Metal IOAccelerator Common": { # TeraScale 2 and Nvidia Web Drivers broke in Mojave due to mismatched structs in # the IOAccelerator stack - "Display Name": None, + "Display Name": "", "OS Support": { "Minimum OS Support": { "OS Major": non_metal_os_support[0], @@ -118,7 +118,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): }, "Metal Common": { - "Display Name": None, + "Display Name": "", "OS Support": { "Minimum OS Support": { "OS Major": os_data.os_data.monterey, @@ -142,7 +142,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): }, "Legacy GVA": { - "Display Name": None, + "Display Name": "", "OS Support": { "Minimum OS Support": { "OS Major": non_metal_os_support[0], @@ -248,7 +248,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support): }, }, "AMD TeraScale Common": { - "Display Name": None, + "Display Name": "", "OS Support": { "Minimum OS Support": { "OS Major": os_data.os_data.mojave, diff --git a/resources/device_probe.py b/resources/device_probe.py index 56e92a62d..a3caa6635 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -29,17 +29,11 @@ class PCIDevice: device_id: int # The device ID 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 model: Optional[str] = None # model property acpi_path: Optional[str] = None pci_path: Optional[str] = None - # def __getstate__(self): - # state = self.__dict__.copy() - # state.pop("ioregistryentry") - # return state - @classmethod def from_ioregistry(cls, entry: ioreg.io_registry_entry_t, anti_spoof=False): properties: dict = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperties(entry, None, ioreg.kCFAllocatorDefault, ioreg.kNilOptions)[1]) # type: ignore @@ -59,13 +53,6 @@ class PCIDevice: device.populate_pci_path(entry) return device - # @staticmethod - # def vendor_detect_old(device): - # for i in [NVIDIA, AMD]: - # if i.detect(device): - # return i - # return None - def vendor_detect(self, *, inherits: ClassVar[Any] = None, classes: list = None): for i in classes or itertools.chain.from_iterable([subclass.__subclasses__() for subclass in PCIDevice.__subclasses__()]): if issubclass(i, inherits or object) and i.detect(self): @@ -543,7 +530,6 @@ class Computer: ioreg.IOObjectRelease(device) def wifi_probe(self): - # result = subprocess.run("ioreg -r -c IOPCIDevice -a -d2".split(), stdout=subprocess.PIPE).stdout.strip() devices = ioreg.ioiterator_to_list( ioreg.IOServiceGetMatchingServices( ioreg.kIOMasterPortDefault, @@ -629,9 +615,6 @@ class Computer: None, )[1] ) - # for device in ethernet_controllers: - # self.ethernet.append(EthernetController.from_ioregistry(device)) - # ioreg.IOObjectRelease(device) for device in ethernet_controllers: vendor: Type[EthernetController] = PCIDevice.from_ioregistry(device).vendor_detect(inherits=EthernetController) # type: ignore @@ -698,7 +681,6 @@ class Computer: ioreg.IOObjectRelease(entry) # 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