Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d68a7bc

Browse files
committed
add unmount
1 parent 724a78e commit d68a7bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

oclp_r/sys_patch/mount/mount.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ 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+
result_unmount = subprocess_wrapper.run_as_root(["/usr/sbin/diskutil", "unmount", f"/dev/{self.root_volume_identifier}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
71+
if result_unmount.returncode != 0:
72+
logging.error("Failed to unmount root volume")
73+
subprocess_wrapper.log(result_unmount)
74+
return None
7075
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)
7176
if result.returncode != 0:
7277
logging.error("Failed to mount root volume")

0 commit comments

Comments
 (0)