Files
OpenCore-Legacy-Patcher/Resources/mount_root.py
Mykola Grymalyuk a5f489d48b Depreciate dedicated OCLP-CLI binary
OpenCore-Patcher now supports both CLI and TUI mode
2021-10-03 10:44:13 -06:00

20 lines
682 B
Python

# Logic for mounting root volume
from Data import os_data
from Resources import Utilities
import plistlib
import subprocess
def mount_root_volume(os_version, root_disk):
if os_version >= os_data.os_data.big_sur:
mount_location = "/System/Volumes/Update/mnt1/"
else:
mount_location = "/"
def find_root_volume():
root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
root_mount_path = root_partition_info["DeviceIdentifier"]
root_mount_path = root_mount_path[:-2] if root_mount_path.count("s") > 1 else root_mount_path
return root_mount_path