sys_patch.py: Move kdk check higher

This commit is contained in:
Mykola Grymalyuk
2022-10-04 20:08:47 -06:00
parent bf317e7bea
commit f2bedca734

View File

@@ -123,6 +123,8 @@ class PatchSysVolume:
raise Exception(f"Unable to download KDK: {error_msg}")
sys_patch_helpers.sys_patch_helpers(self.constants).install_kdk()
kdk_path = sys_patch_helpers.sys_patch_helpers(self.constants).determine_kdk_present(match_closest=True, override_build=downloaded_kdk)
oclp_plist = Path("/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist")
if (Path(self.mount_location) / Path("System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern")).exists() and oclp_plist.exists():
# KDK was already merged, check if the KDK used is the same as the one we're using
@@ -136,7 +138,6 @@ class PatchSysVolume:
except:
pass
kdk_path = sys_patch_helpers.sys_patch_helpers(self.constants).determine_kdk_present(match_closest=True, override_build=downloaded_kdk)
if kdk_path is None:
print(f"- Unable to find Kernel Debug Kit: {downloaded_kdk}")
raise Exception("Unable to find Kernel Debug Kit")