From 8e0f2c44b41271b22634a59ec26e0d496fe575c2 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Wed, 11 Jun 2025 13:21:46 +0700 Subject: [PATCH] Enhance macOS beta version support --- Scripts/compatibility_checker.py | 6 +++--- Scripts/config_prodigy.py | 10 +++++++++- Scripts/datasets/kext_data.py | 2 +- Scripts/kext_maestro.py | 18 ++++++++++++------ 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Scripts/compatibility_checker.py b/Scripts/compatibility_checker.py index 41f85e8..4b16d61 100644 --- a/Scripts/compatibility_checker.py +++ b/Scripts/compatibility_checker.py @@ -83,7 +83,7 @@ class CompatibilityChecker: max_version = os_data.get_latest_darwin_version() min_version = os_data.get_lowest_darwin_version() - ocl_patched_max_version = max_version + ocl_patched_max_version = os_data.get_latest_darwin_version(include_beta=False) ocl_patched_min_version = "20.0.0" if "Intel" in gpu_manufacturer: @@ -152,7 +152,7 @@ class CompatibilityChecker: gpu_props["Compatibility"] = (None, None) else: gpu_props["Compatibility"] = (max_version, min_version) - if max_version != ocl_patched_max_version: + if self.utils.parse_darwin_version(max_version) < self.utils.parse_darwin_version(ocl_patched_max_version): gpu_props["OCLP Compatibility"] = (ocl_patched_max_version, ocl_patched_min_version if self.utils.parse_darwin_version(ocl_patched_min_version) > self.utils.parse_darwin_version("{}.{}.{}".format(int(max_version[:2]) + 1, 0, 0)) else "{}.{}.{}".format(int(max_version[:2]) + 1, 0, 0)) print("{}- {}: {}".format(" "*3, gpu_name, self.show_macos_compatibility(gpu_props.get("Compatibility")))) @@ -235,7 +235,7 @@ class CompatibilityChecker: max_version = os_data.get_latest_darwin_version() min_version = os_data.get_lowest_darwin_version() - ocl_patched_max_version = max_version + ocl_patched_max_version = os_data.get_latest_darwin_version(include_beta=False) ocl_patched_min_version = "20.0.0" if device_id in pci_data.BroadcomWiFiIDs: diff --git a/Scripts/config_prodigy.py b/Scripts/config_prodigy.py index 39682f4..d1c3534 100644 --- a/Scripts/config_prodigy.py +++ b/Scripts/config_prodigy.py @@ -2,6 +2,7 @@ from Scripts.datasets import chipset_data from Scripts.datasets import cpu_data from Scripts.datasets import mac_model_data from Scripts.datasets import kext_data +from Scripts.datasets import os_data from Scripts.datasets import pci_data from Scripts.datasets import codec_layouts from Scripts import gathering_files @@ -443,7 +444,7 @@ class ConfigProdigy: return None - def load_kernel_patch(self, motherboard_chipset, cpu_manufacturer, cpu_codename, cpu_cores, gpu_manufacturer, networks, kexts): + def load_kernel_patch(self, motherboard_chipset, cpu_manufacturer, cpu_codename, cpu_cores, gpu_manufacturer, networks, macos_version, kexts): kernel_patch = [] if "AMD" in cpu_manufacturer: @@ -475,6 +476,8 @@ class ConfigProdigy: "Skip": 0 }) + latest_darwin_version = (os_data.get_latest_darwin_version(), os_data.get_latest_darwin_version(include_beta=False)) + for patch in kernel_patch: if "AppleEthernetAquantiaAqtion" in patch["Identifier"]: patch["Enabled"] = patch["Base"] != "" @@ -492,6 +495,10 @@ class ConfigProdigy: patch["Enabled"] = False elif "shaneee" in patch["Comment"].lower(): patch["Enabled"] = True + + if "Beta" in os_data.get_macos_name_by_darwin(macos_version): + if patch["MaxKernel"] in latest_darwin_version: + patch["MaxKernel"] = latest_darwin_version[0] return kernel_patch @@ -639,6 +646,7 @@ class ConfigProdigy: hardware_report.get("CPU").get("Core Count"), list(hardware_report.get("GPU").items())[0][-1].get("Manufacturer"), hardware_report.get("Network", {}), + macos_version, kexts ) config["Kernel"]["Quirks"]["AppleCpuPmCfgLock"] = hardware_report.get("CPU").get("Codename") in cpu_data.IntelCPUGenerations[62:] diff --git a/Scripts/datasets/kext_data.py b/Scripts/datasets/kext_data.py index 423eba6..8d35cf2 100644 --- a/Scripts/datasets/kext_data.py +++ b/Scripts/datasets/kext_data.py @@ -8,7 +8,7 @@ class KextInfo: self.category = category self.required = required self.min_darwin_version = min_darwin_version or os_data.get_lowest_darwin_version() - self.max_darwin_version = max_darwin_version or os_data.get_latest_darwin_version(include_beta=False) + self.max_darwin_version = max_darwin_version or os_data.get_latest_darwin_version(include_beta=False) if "Lilu" in requires_kexts else os_data.get_latest_darwin_version() self.requires_kexts = requires_kexts self.conflict_group_id = conflict_group_id self.github_repo = github_repo diff --git a/Scripts/kext_maestro.py b/Scripts/kext_maestro.py index 2191f18..3011b76 100644 --- a/Scripts/kext_maestro.py +++ b/Scripts/kext_maestro.py @@ -232,13 +232,19 @@ class KextMaestro: recommended_option = 2 if self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("23.0.0") else 1 recommended_name = "itlwm" if recommended_option == 2 else "AirportItlwm" - kext_option = self.utils.request_input("Select kext for your Intel WiFi device (default: {}): ".format(recommended_name)).strip() or str(recommended_option) - - if kext_option.isdigit() and 0 < int(kext_option) < 3: - selected_option = int(kext_option) - else: - print("\033[91mInvalid selection, using recommended option: {}\033[0m".format(recommended_option)) + if "Beta" in os_data.get_macos_name_by_darwin(macos_version): + print("\033[91mImportant:\033[0m For macOS Beta versions, only itlwm kext is supported") + print("") + self.utils.request_input("Press Enter to continue...") selected_option = recommended_option + else: + kext_option = self.utils.request_input("Select kext for your Intel WiFi device (default: {}): ".format(recommended_name)).strip() or str(recommended_option) + + if kext_option.isdigit() and 0 < int(kext_option) < 3: + selected_option = int(kext_option) + else: + print("\033[91mInvalid selection, using recommended option: {}\033[0m".format(recommended_option)) + selected_option = recommended_option if selected_option == 2: selected_kexts.append("itlwm")