From 87469b71d0ee44fb7186bad1bf66618bea0b425f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 6 Sep 2024 09:25:51 -0600 Subject: [PATCH] validation.py: Add exemptions for PatchType checks --- opencore_legacy_patcher/support/validation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opencore_legacy_patcher/support/validation.py b/opencore_legacy_patcher/support/validation.py index e9550dd24..7557e52b1 100644 --- a/opencore_legacy_patcher/support/validation.py +++ b/opencore_legacy_patcher/support/validation.py @@ -124,6 +124,9 @@ class PatcherValidation: minor_kernel (int): Minor kernel version """ + patch_type_merge_exempt = ["MechanismPlugins"] + patch_type_overwrite_exempt = [] + patchset = HardwarePatchsetDetection(self.constants, xnu_major=major_kernel, xnu_minor=minor_kernel, validation=True).patches for patch_core in patchset: @@ -144,10 +147,10 @@ class PatcherValidation: # Technically there is nothing wrong with using a .framework with OVERWRITE, but it's a good indicator of a mistake if install_type in [PatchType.OVERWRITE_SYSTEM_VOLUME, PatchType.OVERWRITE_DATA_VOLUME]: - if install_file.endswith(".framework"): + if install_file.endswith(".framework") and install_file not in patch_type_overwrite_exempt: raise Exception(f"{install_file} used with {install_type}, are you certain this is correct?") elif install_type in [PatchType.MERGE_SYSTEM_VOLUME, PatchType.MERGE_DATA_VOLUME]: - if not install_file.endswith(".framework"): + if not install_file.endswith(".framework") and install_file not in patch_type_merge_exempt: raise Exception(f"{install_file} used with {install_type}, are you certain this is correct?") source_file = str(self.constants.payload_local_binaries_root_path) + "/" + patchset[patch_core][install_type][install_directory][install_file] + install_directory + "/" + install_file