From 1f000d893f06fd6369768b294e07ca1d1e29d44a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 6 Sep 2024 15:02:35 -0600 Subject: [PATCH] =?UTF-8?q?detect.py:=20Avoid=20adding=20patches=20when=20?= =?UTF-8?q?hardware=E2=80=99s=20been=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opencore_legacy_patcher/sys_patch/patchsets/detect.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/opencore_legacy_patcher/sys_patch/patchsets/detect.py b/opencore_legacy_patcher/sys_patch/patchsets/detect.py index 32a950b46..23f361dbf 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/detect.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/detect.py @@ -459,7 +459,7 @@ class HardwarePatchsetDetection: if self._validation is False: present_hardware = self._strip_incompatible_hardware(present_hardware) - # Second pass to gather all properties + # Second pass to determine requirements for item in present_hardware: item: BaseHardware device_properties[item.name()] = True @@ -478,8 +478,6 @@ class HardwarePatchsetDetection: if item.required_amfi_level() > highest_amfi_level: highest_amfi_level = item.required_amfi_level() - patches.update(item.patches()) - if self._validation is False: if requires_metallib_support_pkg is True: missing_metallib_support_pkg = not self._is_cached_metallib_support_pkg_present() @@ -515,6 +513,13 @@ class HardwarePatchsetDetection: if requirements[HardwarePatchsetValidation.MISSING_NETWORK_CONNECTION] is True: requirements, device_properties = self._handle_missing_network_connection(requirements, device_properties) + # Third pass to sync stripped hardware (ie. '_handle_missing_network_connection()') + for item in present_hardware: + item: BaseHardware + if item.name() not in device_properties: + continue + patches.update(item.patches()) + _cant_patch = not self._can_patch(requirements) requirements[HardwarePatchsetValidation.PATCHING_NOT_POSSIBLE] = _cant_patch