mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
sys_patch_helpers.py: Unmount KDK drive on error
This commit is contained in:
@@ -45,8 +45,6 @@
|
||||
- Kernelspace: [RSRHelper.kext](https://github.com/khronokernel/RSRHelper) (cbe1be9)
|
||||
- Add APFS Trim Configuration
|
||||
- Settings -> Misc Settings -> APFS Trim
|
||||
- Work-around KDKs failing to install due to Read-only error
|
||||
- `[errno 30] read-only file system: KernelDebugPkg.kit`
|
||||
- Increment Binaries:
|
||||
- OpenCorePkg 0.8.8 - release
|
||||
- PatcherSupportPkg 0.8.2 - release
|
||||
|
||||
@@ -90,9 +90,13 @@ class sys_patch_helpers:
|
||||
if kdk_dst_path.exists():
|
||||
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||
utilities.process_status(subprocess.run(["cp", f"{mount_point}/KernelDebugKit.pkg", self.constants.payload_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||
utilities.process_status(utilities.elevated(["installer", "-pkg", kdk_dst_path, "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||
result = utilities.elevated(["installer", "-pkg", kdk_dst_path, "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if result.returncode != 0:
|
||||
print(f"- Failed to install KDK: {result.stdout}")
|
||||
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
raise Exception("Failed to install KDK")
|
||||
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||
subprocess.run(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Do not really care if this fails
|
||||
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
print("- Successfully installed KDK")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user