mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-18 21:30:00 +10:00
sys_patch_dict.py: Add display names
This commit is contained in:
@@ -227,7 +227,7 @@ class PatchSysVolume:
|
||||
if "Processes" in required_patches[patch]:
|
||||
for process in required_patches[patch]["Processes"]:
|
||||
# Some processes need sudo, however we cannot directly call sudo in some scenarios
|
||||
# Instead, call elevated funtion and strip sudo from argument
|
||||
# Instead, call elevated funtion is string's boolean is True
|
||||
process_array = process.split(" ")
|
||||
if required_patches[patch]["Processes"][process] is True:
|
||||
utilities.process_status(utilities.elevated(process_array, stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||
|
||||
@@ -225,29 +225,23 @@ class detect_root_patch:
|
||||
utilities.cls()
|
||||
print("- The following patches will be applied:")
|
||||
if hardware_details["Graphics: Intel Ironlake"] is True:
|
||||
print(" - Graphics: Intel Ironlake")
|
||||
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
|
||||
required_patches.update({"Intel Ironlake": all_hardware_patchset["Graphics"]["Intel Ironlake"]})
|
||||
if hardware_details["Graphics: Intel Sandy Bridge"] is True:
|
||||
print(" - Graphics: Intel Sandy Bridge")
|
||||
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
|
||||
required_patches.update({"Legacy GVA": all_hardware_patchset["Graphics"]["Legacy GVA"]})
|
||||
required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]})
|
||||
if hardware_details["Graphics: Intel Ivy Bridge"] is True:
|
||||
print(" - Graphics: Intel Ivy Bridge")
|
||||
required_patches.update({"Metal Common": all_hardware_patchset["Graphics"]["Metal Common"]})
|
||||
required_patches.update({"Intel Ivy Bridge": all_hardware_patchset["Graphics"]["Intel Ivy Bridge"]})
|
||||
if hardware_details["Graphics: Nvidia Tesla"] is True:
|
||||
print(" - Graphics: Nvidia Tesla")
|
||||
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
|
||||
required_patches.update({"Nvidia Tesla": all_hardware_patchset["Graphics"]["Nvidia Tesla"]})
|
||||
required_patches.update({"Nvidia Web Drivers": all_hardware_patchset["Graphics"]["Nvidia Web Drivers"]})
|
||||
if hardware_details["Graphics: Nvidia Kepler"] is True:
|
||||
print(" - Graphics: Nvidia Kepler")
|
||||
required_patches.update({"Metal Common": all_hardware_patchset["Graphics"]["Metal Common"]})
|
||||
required_patches.update({"Nvidia Kepler": all_hardware_patchset["Graphics"]["Nvidia Kepler"]})
|
||||
if hardware_details["Graphics: AMD TeraScale 1"] is True:
|
||||
print(" - Graphics: AMD TeraScale 1")
|
||||
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
|
||||
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
|
||||
required_patches.update({"AMD TeraScale 1": all_hardware_patchset["Graphics"]["AMD TeraScale 1"]})
|
||||
@@ -259,42 +253,31 @@ class detect_root_patch:
|
||||
if self.constants.allow_ts2_accel is False or self.constants.detected_os not in self.constants.legacy_accel_support:
|
||||
# TeraScale 2 MacBooks with faulty GPUs are highly prone to crashing with AMDRadeonX3000 attached
|
||||
# Additionally, AMDRadeonX3000 requires IOAccelerator downgrade which is not installed without 'Non-Metal IOAccelerator Common'
|
||||
print(" - Graphics: AMD TeraScale 2 (framebuffer)")
|
||||
del(required_patches["AMD TeraScale 2"]["Install"]["/System/Library/Extensions"]["AMDRadeonX3000.kext"])
|
||||
else:
|
||||
print(" - Graphics: AMD TeraScale 2")
|
||||
if hardware_details["Brightness: Legacy Backlight Control"] is True:
|
||||
print(" - Brightness: Legacy Brightness")
|
||||
required_patches.update({"Legacy Brightness": all_hardware_patchset["Brightness"]["Legacy Brightness"]})
|
||||
if hardware_details["Audio: Legacy Realtek"] is True:
|
||||
if self.model in ["iMac7,1", "iMac8,1"]:
|
||||
print(" - Audio: Legacy Realtek Audio")
|
||||
required_patches.update({"Legacy Realtek": all_hardware_patchset["Audio"]["Legacy Realtek"]})
|
||||
else:
|
||||
print(" - Audio: Legacy non-GOP Audio")
|
||||
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
|
||||
if hardware_details["Networking: Legacy Wireless"] is True:
|
||||
print(" - Networking: Legacy WiFi")
|
||||
required_patches.update({"Legacy WiFi": all_hardware_patchset["Networking"]["Legacy WiFi"]})
|
||||
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
|
||||
print(" - Miscellaneous: Legacy GMUX")
|
||||
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
|
||||
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"]:
|
||||
print(" - Miscellaneous: Legacy Keyboard Backlight")
|
||||
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
|
||||
|
||||
if required_patches:
|
||||
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
|
||||
for patch_name in list(required_patches):
|
||||
if (
|
||||
required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Major"] > self.constants.detected_os or
|
||||
required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Major"] < self.constants.detected_os
|
||||
):
|
||||
del(required_patches[patch_name])
|
||||
elif (
|
||||
required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Minor"] > self.constants.detected_os_minor or
|
||||
required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Minor"] < self.constants.detected_os_minor
|
||||
):
|
||||
patch_os_min_float = float(f'{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Minor"]}')
|
||||
patch_os_max_float = float(f'{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Minor"]}')
|
||||
if (host_os_float < patch_os_min_float or host_os_float > patch_os_max_float):
|
||||
del(required_patches[patch_name])
|
||||
else:
|
||||
if required_patches[patch_name]["Display Name"]:
|
||||
print(f" - {required_patches[patch_name]['Display Name']}")
|
||||
else:
|
||||
print(" - No patch sets found for booted model")
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ class grab_patcher_support_pkg:
|
||||
def download_files(self):
|
||||
link = self.generate_pkg_link()
|
||||
if Path(self.constants.payload_local_binaries_root_path).exists():
|
||||
print("- Removing old Apple Binaries folder")
|
||||
print("- Removing old Root Patcher Payload folder")
|
||||
# Delete folder
|
||||
shutil.rmtree(self.constants.payload_local_binaries_root_path)
|
||||
|
||||
download_result = None
|
||||
local_zip = Path(self.constants.payload_path) / f"Universal-Binaries.zip"
|
||||
if Path(local_zip).exists():
|
||||
print(f"- Found local {local_zip} zip, skipping download")
|
||||
print(f"- Found local Universal-Binaries.zip, skipping download")
|
||||
download_result = True
|
||||
else:
|
||||
print(f"- No local version found, downloading...")
|
||||
|
||||
Reference in New Issue
Block a user