Fix DeviceProperty and Root Volume detection

This commit is contained in:
Mykola Grymalyuk
2021-06-04 15:21:59 -06:00
parent e0eda1fa0c
commit 3956908482
4 changed files with 23 additions and 5 deletions
+4 -3
View File
@@ -160,12 +160,10 @@ class PatchSysVolume:
print("- Creating mnt1 folder")
Path(self.constants.payload_mnt1_path).mkdir()
else:
root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /System/Volumes/Update/mnt1".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
self.root_mount_path = root_partition_info["DeviceIdentifier"]
if self.root_mount_path.startswith("disk"):
if self.constants.recovery_status is False:
self.root_mount_path = self.root_mount_path[:-2] if self.root_mount_path.count("s") > 1 else self.root_mount_path
print(f"- Found Root Volume at: {self.root_mount_path}")
if Path(self.mount_extensions).exists():
print("- Root Volume is already mounted")
@@ -196,8 +194,11 @@ class PatchSysVolume:
return True
else:
print("- Failed to mount the Root Volume")
print("- Recommend rebooting the machine and trying to patch again")
input("- Press [ENTER] to exit")
else:
print("- Could not find root volume")
input("- Press [ENTER] to exit")
def delete_old_binaries(self, vendor_patch):
for delete_current_kext in vendor_patch: