Add User prompt for mismatched config

This commit is contained in:
Mykola Grymalyuk
2022-05-10 18:17:23 -06:00
parent c23546378f
commit 60fab3986e
6 changed files with 46 additions and 17 deletions
+1
View File
@@ -104,6 +104,7 @@ class BuildOpenCore:
self.config["#Revision"]["OpenCore-Version"] = f"{self.constants.opencore_version} - {self.constants.opencore_build} - {self.constants.opencore_commit}"
self.config["#Revision"]["Original-Model"] = self.model
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Version"] = f"{self.constants.patcher_version}"
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Model"] = self.model
for name, version, path, check in [
# Essential kexts
+2
View File
@@ -457,6 +457,7 @@ class Computer:
real_board_id: Optional[str] = None
reported_model: Optional[str] = None
reported_board_id: Optional[str] = None
build_model: Optional[str] = None
gpus: list[GPU] = field(default_factory=list)
igpu: Optional[GPU] = None # Shortcut for IGPU
dgpu: Optional[GPU] = None # Shortcut for GFX0
@@ -683,6 +684,7 @@ class Computer:
# Real model
self.real_model = utilities.get_nvram("oem-product", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_model
self.real_board_id = utilities.get_nvram("oem-board", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) or self.reported_board_id
self.build_model = utilities.get_nvram("OCLP-Model", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
# OCLP version
self.oclp_version = utilities.get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
+3 -1
View File
@@ -207,7 +207,7 @@ Please build OpenCore first!"""
choice = input("\nWould you like to still install OpenCore to this drive?(y/n): ")
if not choice in ["y", "Y", "Yes", "yes"]:
subprocess.run(["diskutil", "umount", mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode()
return
return False
if (mount_path / Path("EFI/OC")).exists():
print("- Removing preexisting EFI/OC folder")
shutil.rmtree(mount_path / Path("EFI/OC"), onerror=rmtree_handler)
@@ -255,6 +255,8 @@ Please build OpenCore first!"""
tui_helpers.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to go back.\n", ["EFI failed to mount!"]).start()
else:
print("EFI failed to mount!")
return False
return True
def rmtree_handler(func, path, exc_info):
if exc_info[0] == FileNotFoundError: