From 079a1ac2ff151ef6ed722cd079445bee01f7a778 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:27:15 -0600 Subject: [PATCH] Add custom EFI Boot icons per drive type --- Resources/build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Resources/build.py b/Resources/build.py index dbbcdda6a..aa3162d61 100644 --- a/Resources/build.py +++ b/Resources/build.py @@ -551,6 +551,7 @@ Please build OpenCore first!""" # TODO: Remount if readonly partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {disk_identifier}s{response}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) mount_path = Path(partition_info["MountPoint"]) + disk_type = partition_info["BusProtocol"] utilities.cls() utilities.header(["Copying OpenCore"]) @@ -564,8 +565,12 @@ Please build OpenCore first!""" print("- Coping OpenCore onto EFI partition") shutil.copytree(self.constants.opencore_release_folder / Path("EFI/OC"), mount_path / Path("EFI/OC")) shutil.copytree(self.constants.opencore_release_folder / Path("System"), mount_path / Path("System")) - # TODO: Add drive detection for custom icons (ie. USB, etc) - shutil.copy(self.constants.icon_path_internal, mount_path) + if disk_type == "USB": + print("- Adding External USB Drive icon") + shutil.copy(self.constants.icon_path_external, mount_path) + else: + print("- Adding Internal Drive icon") + shutil.copy(self.constants.icon_path_internal, mount_path) print("- OpenCore transfer complete") print("\nPress [Enter] to continue.\n") input()