Skip to content

Commit da98859

Browse files
committed
fix 2
1 parent 5486ab2 commit da98859

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

oclp_r/sys_patch/mount/mount.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,12 @@ def _mount_root_volume(self) -> str:
6767
if self.xnu_major >= os_data.os_data.big_sur.value:
6868
if Path("/System/Volumes/Update/mnt1/System/Library/CoreServices/SystemVersion.plist").exists():
6969
return "/System/Volumes/Update/mnt1"
70-
try:
71-
result_unmount = subprocess_wrapper.run_as_root(["/usr/sbin/diskutil", "unmount", f"/dev/{self.root_volume_identifier}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
72-
if result_unmount.returncode != 0:
73-
logging.error("Failed to unmount root volume")
74-
subprocess_wrapper.log(result_unmount)
75-
return None
76-
except subprocess.CalledProcessError:
77-
logging.error("Disk has already been unmounted.")
70+
71+
result_unmount = subprocess_wrapper.run_as_root(["/usr/sbin/diskutil", "unmount", f"/dev/{self.root_volume_identifier}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
72+
if result_unmount.returncode != 0:
73+
logging.info("Maybe disk has already been unmounted.")
7874
subprocess_wrapper.log(result_unmount)
75+
7976
result = subprocess_wrapper.run_as_root(["/sbin/mount", "-o", "nobrowse", "-t", "apfs", f"/dev/{self.root_volume_identifier}", "/System/Volumes/Update/mnt1"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
8077
if result.returncode != 0:
8178
logging.error("Failed to mount root volume")

0 commit comments

Comments
 (0)