mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 03:20:16 +10:00
install.py: Add Safe Mode note
This commit is contained in:
@@ -175,6 +175,11 @@ Please build OpenCore first!"""
|
|||||||
else:
|
else:
|
||||||
print("An error occurred!")
|
print("An error occurred!")
|
||||||
print(result.stderr.decode())
|
print(result.stderr.decode())
|
||||||
|
|
||||||
|
# Check if we're in Safe Mode, and if so, tell user FAT32 is unsupported
|
||||||
|
if utilities.check_boot_mode() == "safe_boot":
|
||||||
|
print("\nSafe Mode detected. FAT32 is unsupported by macOS in this mode.")
|
||||||
|
print("Please disable Safe Mode and try again.")
|
||||||
return
|
return
|
||||||
partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {full_disk_identifier}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {full_disk_identifier}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||||
parent_disk = partition_info["ParentWholeDisk"]
|
parent_disk = partition_info["ParentWholeDisk"]
|
||||||
|
|||||||
@@ -406,6 +406,11 @@ def monitor_disk_output(disk):
|
|||||||
output = output[-2]
|
output = output[-2]
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
def check_boot_mode():
|
||||||
|
# Check whether we're in Safe Mode or not
|
||||||
|
sys_plist = plistlib.loads(subprocess.run(["system_profiler", "SPSoftwareDataType"], stdout=subprocess.PIPE).stdout)
|
||||||
|
return sys_plist[0]["_items"][0]["boot_mode"]
|
||||||
|
|
||||||
def elevated(*args, **kwargs) -> subprocess.CompletedProcess:
|
def elevated(*args, **kwargs) -> subprocess.CompletedProcess:
|
||||||
# When runnign through our GUI, we run as root, however we do not get uid 0
|
# When runnign through our GUI, we run as root, however we do not get uid 0
|
||||||
# Best to assume CLI is running as root
|
# Best to assume CLI is running as root
|
||||||
|
|||||||
Reference in New Issue
Block a user