From 8849896ba39b72e4099a7d20aea3ad97fb5f9e33 Mon Sep 17 00:00:00 2001 From: neon ball <35791009+ParaDoX1994@users.noreply.github.com> Date: Fri, 29 Jul 2022 18:00:01 +0300 Subject: [PATCH 1/6] Remove TUI mention due to deprecation of TUI --- docs/ACCEL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/ACCEL.md b/docs/ACCEL.md index 730f852c3..935b0eb9a 100644 --- a/docs/ACCEL.md +++ b/docs/ACCEL.md @@ -163,8 +163,7 @@ However if your machine does not have the dGPU disabled via NVRAM, you'll experi 2. When command line prompt appears, enter the dGPU disabler argument (at the bottom) 3. Reboot and patched macOS should work normally 4. If you still want to use the dGPU, run OpenCore Legacy Patcher and enable TS2 Acceleration from settings. Then root patch your Mac again - * TUI: `Patcher Settings -> Misc Settings -> TeraScale 2 Accel` - * GUI: `Patcher Settings -> Developer Settings -> Set TeraScale 2 Accel` + `Patcher Settings -> Developer Settings -> Set TeraScale 2 Accel` 5. Either Reset NVRAM or set `gpu-power-prefs` to zeros to re-enable the dGPU ```sh @@ -184,4 +183,4 @@ A somewhat strange issue on Intel HD3000-based Macs, on 3rd party displays somet | Default Color Profile | Display/Display P3 Profile | | :--- | :--- | -| ![](../images/HD3000-Default-Colors.png) | ![](../images/HD3000-Display-Colors.png) | \ No newline at end of file +| ![](../images/HD3000-Default-Colors.png) | ![](../images/HD3000-Display-Colors.png) | From 4bb2b8bc04f1b3b0ecfc7f87df6780b195bb269b Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 9 Aug 2022 09:31:13 -0600 Subject: [PATCH 2/6] gui_main.py: avoid reboot prompt on off-model building --- gui/gui_main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/gui_main.py b/gui/gui_main.py index 305cad4a9..346540ef0 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -881,7 +881,11 @@ class wx_python_gui: self.frame_modal.SetSize(-1, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 20) if result is True: - self.reboot_system(message="OpenCore has finished installing to disk.\n\nYou will need to reboot and hold the Option key and select OpenCore/Boot EFI's option.\n\nWould you like to reboot?") + if not self.constants.custom_model: + self.reboot_system(message="OpenCore has finished installing to disk.\n\nYou will need to reboot and hold the Option key and select OpenCore/Boot EFI's option.\n\nWould you like to reboot?") + else: + popup_message = wx.MessageDialog(self.frame,f"OpenCore has finished installing to disk.\n\nYou can eject the drive, insert it into the {self.constants.custom_model}, reboot, hold the Option key and select OpenCore/Boot EFI's option.", "Success", wx.OK) + popup_message.ShowModal() def root_patch_menu(self, event=None): # Define Menu From 0286b8d64ac374b43d9abcd39296ee270c2306a2 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 9 Aug 2022 09:49:12 -0600 Subject: [PATCH 3/6] build.py: rework MCE Disabler logic --- CHANGELOG.md | 2 ++ resources/build.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb8ec9eb4..03118e38a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # OpenCore Legacy Patcher changelog ## 0.4.11 +- Enable AppleMCEReporterDisabler whenever spoofing affected SMBIOS + - ie. iMacPro1,1, MacPro6,1 and MacPro7,1 ## 0.4.10 - Resolve Nvidia Kepler support in macOS 12.5 Beta 3 and newer diff --git a/resources/build.py b/resources/build.py index bc441be43..facf18913 100644 --- a/resources/build.py +++ b/resources/build.py @@ -112,7 +112,6 @@ class BuildOpenCore: ("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in model_array.MacPro), ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False and self.constants.serial_settings != "None"), # CPU patches - ("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: (self.model.startswith("MacPro") or self.model.startswith("Xserve")) and self.constants.serial_settings != "None"), ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value), ( "telemetrap.kext", @@ -166,6 +165,16 @@ class BuildOpenCore: # Required for Lilu in 11.0+ self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True + if self.constants.serial_settings != "None": + # AppleMCEReporter is very picky about which models attach to the kext + # Commonly it will kernel panic on multi-socket systems, however even on single-socket systems it may cause instability + # To avoid any issues, we'll disable it if the spoof is set to an affected SMBIOS + affected_smbios = ["MacPro6,1", "MacPro7,1", "iMacPro1,1"] + if self.model not in affected_smbios: + # If MacPro6,1 host spoofs, we can safely enable it + if self.constants.override_smbios in affected_smbios or generate_smbios.set_smbios_model_spoof(self.model) in affected_smbios: + self.enable_kext("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path) + if self.constants.fu_status is True: # Enable FeatureUnlock.kext self.enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path) From 08525de48987bafdd552c52e369986edf799e124 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Wed, 17 Aug 2022 17:59:33 -0600 Subject: [PATCH 4/6] os_probe.py: Remove new line output --- resources/os_probe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/os_probe.py b/resources/os_probe.py index f779274be..545bdd05b 100644 --- a/resources/os_probe.py +++ b/resources/os_probe.py @@ -19,4 +19,4 @@ def detect_kernel_minor(): def detect_kernel_build(): # Return OS build # Example Output: 21A5522h (string) - return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() + return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().split("\n")[0] From 0cb2ad1b20ea3b97ef0e19516ac0de63dd0df464 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 18 Aug 2022 17:21:07 -0600 Subject: [PATCH 5/6] Installer: Check space before starting --- CHANGELOG.md | 1 + gui/gui_main.py | 8 ++++++++ resources/installer.py | 7 +++++++ resources/utilities.py | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03118e38a..b07b3284f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.4.11 - Enable AppleMCEReporterDisabler whenever spoofing affected SMBIOS - ie. iMacPro1,1, MacPro6,1 and MacPro7,1 +- Verify host's disk space before downloading macOS Installers ## 0.4.10 - Resolve Nvidia Kepler support in macOS 12.5 Beta 3 and newer diff --git a/gui/gui_main.py b/gui/gui_main.py index 346540ef0..bd2495f6d 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -1511,6 +1511,14 @@ class wx_python_gui: except ValueError: pass + # Ensure we have space to both download and extract the installer + host_space = utilities.get_free_space() + needed_space = app_dict['Size'] * 2 + if host_space < needed_space: + dlg = wx.MessageDialog(self.frame_modal, f"You do not have enough free space to download and extract this installer. Please free up some space and try again\n\n{utilities.human_fmt(host_space)} available vs {utilities.human_fmt(needed_space)} required", "Insufficient Space", wx.OK | wx.ICON_WARNING) + dlg.ShowModal() + return + self.frame.DestroyChildren() installer_name = f"macOS {app_dict['Version']} ({app_dict['Build']})" diff --git a/resources/installer.py b/resources/installer.py index 07bc1e773..4ce7bf097 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -372,6 +372,13 @@ def generate_installer_creation_script(tmp_location, installer_path, disk): if utilities.check_filesystem_type() != "apfs": # HFS+ disks do not support CoW args[1] = "-R" + # Ensure we have enough space for the duplication + space_available = utilities.get_free_space() + space_needed = Path(ia_tmp).stat().st_size + if space_available < space_needed: + print("Not enough free space to create installer.sh") + print(f"{utilities.human_fmt(space_available)} available, {utilities.human_fmt(space_needed)} required") + return False subprocess.run(args) # Adjust installer_path to point to the copied installer diff --git a/resources/utilities.py b/resources/utilities.py index 8e5f5d89a..11eeef612 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -13,6 +13,7 @@ from ctypes import CDLL, c_uint, byref import time import atexit import requests +import shutil from resources import constants, ioreg from data import sip_data, os_data @@ -549,6 +550,11 @@ def find_disk_off_uuid(uuid): pass return None +def get_free_space(disk=None): + if disk is None: + disk = "/" + total, used, free = shutil.disk_usage("/") + return free def grab_mount_point_from_disk(disk): data = plistlib.loads(subprocess.run(f"diskutil info -plist {disk}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) From 2c35b62b53ebb6332fe4f685c362bda400131192 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 18 Aug 2022 21:55:15 -0600 Subject: [PATCH 6/6] installer.py: Remove duplicate builds --- CHANGELOG.md | 2 ++ resources/installer.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b07b3284f..128c13681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Enable AppleMCEReporterDisabler whenever spoofing affected SMBIOS - ie. iMacPro1,1, MacPro6,1 and MacPro7,1 - Verify host's disk space before downloading macOS Installers +- Remove duplicate OS builds in macOS downloader + - Avoids Apple's odd bug of publishing 2 different 12.5.1 products ## 0.4.10 - Resolve Nvidia Kepler support in macOS 12.5 Beta 3 and newer diff --git a/resources/installer.py b/resources/installer.py index 4ce7bf097..efce2797f 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -187,6 +187,7 @@ def only_list_newest_installers(available_apps): for version in supported_versions: remote_version_minor = 0 remote_version_security = 0 + os_builds = [] # First determine the largest version for ia in available_apps: @@ -221,13 +222,25 @@ def only_list_newest_installers(available_apps): remote_version.pop(0) if int(remote_version[0]) < remote_version_minor: available_apps.pop(ia) - elif int(remote_version[0]) == remote_version_minor: + continue + if int(remote_version[0]) == remote_version_minor: if len(remote_version) > 1: if int(remote_version[1]) < remote_version_security: available_apps.pop(ia) + continue else: if remote_version_security > 0: available_apps.pop(ia) + continue + + # Remove duplicate builds + # ex. macOS 12.5.1 has 2 builds in the Software Update Catalog + # ref: https://twitter.com/classicii_mrmac/status/1560357471654379522 + if available_apps[ia]["Build"] in os_builds: + available_apps.pop(ia) + continue + + os_builds.append(available_apps[ia]["Build"]) return available_apps