From aa5e39f48aa2beb7106ce203f30cf2a4db572ca0 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 6 Feb 2022 12:19:00 -0700 Subject: [PATCH] install.py: Add Safe Mode note --- resources/install.py | 5 +++++ resources/utilities.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/resources/install.py b/resources/install.py index 6d147f15e..1d07a81db 100644 --- a/resources/install.py +++ b/resources/install.py @@ -175,6 +175,11 @@ Please build OpenCore first!""" else: print("An error occurred!") 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 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"] diff --git a/resources/utilities.py b/resources/utilities.py index 8f393b4fd..6455bb69f 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -406,6 +406,11 @@ def monitor_disk_output(disk): output = output[-2] 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: # When runnign through our GUI, we run as root, however we do not get uid 0 # Best to assume CLI is running as root