From 6ae572f74fcbb206e400b199c32872304c3f1009 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Thu, 15 Apr 2021 20:46:46 -0600 Subject: [PATCH] Misc cleanup --- Resources/Build.py | 15 ++++++--------- Resources/Constants.py | 4 ++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index 062760e83..ab861f60e 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -116,9 +116,6 @@ class BuildOpenCore: ("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro71), # IDE patch ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch), - # Hibernation Tests - #("CpuTscSync.kext", self.constants.cputscsync, self.constants.cputscsync_path, lambda: True), - #("HibernationFixup.kext", self.constants.hibernationfixup, self.constants.hibernationfixup_path, lambda: True), ]: self.enable_kext(name, version, path, check) @@ -207,7 +204,7 @@ class BuildOpenCore: self.get_kext_by_bundle_path("IO80211HighSierra.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True # CPUFriend - pp_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Plists/PlatformPlugin/{self.model}/Info.plist") + pp_map_path = Path(self.constants.platform_plugin_plist_path) / Path(f"{self.model}/Info.plist") if self.model not in ModelArray.NoAPFSsupport: Path(self.constants.pp_kext_folder).mkdir() Path(self.constants.pp_contents_folder).mkdir() @@ -226,7 +223,7 @@ class BuildOpenCore: shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path) # USB Map - usb_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Plists/AppleUSBMaps/Info.plist") + usb_map_path = Path(self.constants.plist_folder_path) / Path("AppleUSBMaps/Info.plist") if usb_map_path.exists(): print(f"- Adding USB-Map.kext") Path(self.constants.map_kext_folder).mkdir() @@ -234,9 +231,9 @@ class BuildOpenCore: shutil.copy(usb_map_path, self.constants.map_contents_folder) self.get_kext_by_bundle_path("USB-Map.kext")["Enabled"] = True - agdp_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Plists/AppleGraphicsDevicePolicy/Info.plist") - agpm_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Plists/AppleGraphicsPowerManagement/Info.plist") - amc_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Plists/AppleMuxControl/Info.plist") + agdp_map_path = Path(self.constants.plist_folder_path) / Path("AppleGraphicsDevicePolicy/Info.plist") + agpm_map_path = Path(self.constants.plist_folder_path) / Path("AppleGraphicsPowerManagement/Info.plist") + amc_map_path = Path(self.constants.plist_folder_path) / Path("AppleMuxControl/Info.plist") if self.model == "MacBookPro9,1": print(f"- Adding Display Map Overrides") @@ -676,7 +673,7 @@ Please build OpenCore first!""" # cancelled prompt return else: - utilities.TUIOnlyPrint( + Utilities.TUIOnlyPrint( ["Copying OpenCore"], "Press [Enter] to go back.\n", ["An error occurred!"] + result.stderr.decode().split("\n") + ["", "Please report this to the devs at GitHub."] ).start() return diff --git a/Resources/Constants.py b/Resources/Constants.py index 5afeb7166..2b1898d5b 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -157,6 +157,10 @@ class Constants: def cputscsync_path(self): return self.payload_kexts_path / Path(f"Acidanthera/CpuTscSync-v{self.cputscsync}.zip") @property def hibernationfixup_path(self): return self.payload_kexts_path / Path(f"Acidanthera/HibernationFixup-v{self.hibernationfixup}.zip") + @property + def plist_folder_path(self): return self.payload_kexts_path / Path(f"Plists") + @property + def platform_plugin_plist_path(self): return self.plist_folder_path / Path(f"PlatformPlugin") # Build Location @property