Add better kmutil crash handling

This commit is contained in:
Mykola Grymalyuk
2021-04-21 14:42:54 -06:00
parent 87359ee642
commit 2e62f1f65c
2 changed files with 22 additions and 7 deletions
+2 -1
View File
@@ -6,8 +6,9 @@
- Fix iMac11,1 boot issues after PRAM reset - Fix iMac11,1 boot issues after PRAM reset
- Fix DRM support on Nvidia-only configurations - Fix DRM support on Nvidia-only configurations
- Support optional setting between DRM and QuickSync support on iMacs13,x and iMac14,x - Support optional setting between DRM and QuickSync support on iMacs13,x and iMac14,x
- Add public beta support for Legacy GPU Acceleration - Add public beta support for Legacy GPU Acceleration (v0.0.3)
- Note ATI/AMD TeraScale 2 unsupported (HD 5/6000) - Note ATI/AMD TeraScale 2 unsupported (HD 5/6000)
- Add better kmutil crash handling
## 0.1.0 ## 0.1.0
- Fix crash on iMacs with Metal GPUs - Fix crash on iMacs with Metal GPUs
+20 -6
View File
@@ -262,11 +262,22 @@ class PatchSysVolume:
if self.constants.gui_mode is False: if self.constants.gui_mode is False:
input("Press [ENTER] to continue with cache rebuild") input("Press [ENTER] to continue with cache rebuild")
print("- Rebuilding Kernel Cache (This may take some time)") print("- Rebuilding Kernel Cache (This may take some time)")
subprocess.run(f"sudo kmutil install --volume-root {self.mount_location} --update-all".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode() result = subprocess.run(f"sudo kmutil install --volume-root {self.mount_location} --update-all".split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if self.constants.gui_mode is False:
input("Press [ENTER] to continue with snapshotting") if result.returncode != 0:
print("- Creating new APFS snapshot") self.sucess_status = False
subprocess.run(f"sudo bless --folder {self.mount_location}/System/Library/CoreServices --bootefi --create-snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode() print("- Unable to build new kernel cache")
print("\nPlease report this to Github")
print("Reason for Patch Failure:")
print(result)
print("")
else:
self.sucess_status = True
print("- Sucessfully built new kernel cache")
if self.constants.gui_mode is False:
input("Press [ENTER] to continue with snapshotting")
print("- Creating new APFS snapshot")
subprocess.run(f"sudo bless --folder {self.mount_location}/System/Library/CoreServices --bootefi --create-snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
def unmount_drive(self): def unmount_drive(self):
print("- Unmounting Root Volume (Don't worry if this fails)") print("- Unmounting Root Volume (Don't worry if this fails)")
@@ -358,7 +369,10 @@ class PatchSysVolume:
self.find_mount_root_vol(True) self.find_mount_root_vol(True)
self.unmount_drive() self.unmount_drive()
print("- Patching complete") print("- Patching complete")
print("\nPlease reboot the machine for patches to take effect") if self.sucess_status is True:
print("\nPlease reboot the machine for patches to take effect")
else:
print("\nPlease reboot the machine to avoid pottential issues rerunning the patcher")
if self.sip_patch_status is True: if self.sip_patch_status is True:
print("SIP set incorrectly, cannot patch on this machine!") print("SIP set incorrectly, cannot patch on this machine!")
print("Please disable SIP and SecureBootModel in Patcher Settings") print("Please disable SIP and SecureBootModel in Patcher Settings")