mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
Implement SkyLightShims List.txt generation
This commit is contained in:
@@ -20,3 +20,4 @@ __pycache__/
|
|||||||
/docs/yarn.lock
|
/docs/yarn.lock
|
||||||
/docs/yarn-error.log
|
/docs/yarn-error.log
|
||||||
/docs/node_modules/
|
/docs/node_modules/
|
||||||
|
/payloads/List.txt
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
- OpenCore 0.7.5 - release
|
- OpenCore 0.7.5 - release
|
||||||
- BrcmPatchRAM 2.6.1 - release
|
- BrcmPatchRAM 2.6.1 - release
|
||||||
- WhateverGreen 1.5.5 - release
|
- WhateverGreen 1.5.5 - release
|
||||||
- PatcherSupportPkg 0.2.7 - release
|
- PatcherSupportPkg 0.2.8 - release
|
||||||
- FeatureUnlock 1.0.5 - rolling (9cf1e81)
|
- FeatureUnlock 1.0.5 - rolling (9cf1e81)
|
||||||
- Fix AirPlay to Mac on macOS 12.1
|
- Fix AirPlay to Mac on macOS 12.1
|
||||||
- Add macOS InstallAssistant downloader to TUI
|
- Add macOS InstallAssistant downloader to TUI
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Data for SkyLightShim Plugin systems
|
||||||
|
class shim_list:
|
||||||
|
shim_pathing = {
|
||||||
|
"CoreWLAN.dylib": "/Systen/Library/CoreServices/WiFiAgent.app/Contents/MacOS/WiFiAgent",
|
||||||
|
"BacklightFixup.dylib": "/System/Library/CoreServices/loginwindow.app/Contents/Mac0S/loginwindow",
|
||||||
|
}
|
||||||
|
|
||||||
|
shim_legacy_accel = [
|
||||||
|
"CoreWLAN.dylib",
|
||||||
|
]
|
||||||
|
|
||||||
|
shim_legacy_accel_keyboard = [
|
||||||
|
"BacklightFixup.dylib",
|
||||||
|
]
|
||||||
@@ -15,7 +15,7 @@ class Constants:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Patcher Versioning
|
# Patcher Versioning
|
||||||
self.patcher_version = "0.3.2" # OpenCore-Legacy-Patcher
|
self.patcher_version = "0.3.2" # OpenCore-Legacy-Patcher
|
||||||
self.patcher_support_pkg_version = "0.2.7" # PatcherSupportPkg
|
self.patcher_support_pkg_version = "0.2.8" # PatcherSupportPkg
|
||||||
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
|
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
|
||||||
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
|
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
|
||||||
|
|
||||||
@@ -219,6 +219,10 @@ class Constants:
|
|||||||
def diags_launcher_path(self):
|
def diags_launcher_path(self):
|
||||||
return self.payload_path / Path("Drivers/diags.efi")
|
return self.payload_path / Path("Drivers/diags.efi")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def list_txt_path(self):
|
||||||
|
return self.payload_path / Path("List.txt")
|
||||||
|
|
||||||
# Kexts
|
# Kexts
|
||||||
@property
|
@property
|
||||||
def payload_kexts_path(self):
|
def payload_kexts_path(self):
|
||||||
@@ -651,8 +655,8 @@ class Constants:
|
|||||||
return self.payload_apple_etc_path / Path("Legacy-Wifi")
|
return self.payload_apple_etc_path / Path("Legacy-Wifi")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def legacy_keyboard_backlight_lauchd(self):
|
def legacy_keyboard_backlight_etc(self):
|
||||||
return self.payload_apple_lauchd_path / Path("Keyboard-Backlight")
|
return self.payload_apple_etc_path / Path("Keyboard-Backlight")
|
||||||
|
|
||||||
sbm_values = [
|
sbm_values = [
|
||||||
"j137ap", # iMacPro1,1
|
"j137ap", # iMacPro1,1
|
||||||
|
|||||||
+51
-9
@@ -13,7 +13,7 @@ from pathlib import Path
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from resources import constants, device_probe, utilities, generate_smbios
|
from resources import constants, device_probe, utilities, generate_smbios
|
||||||
from data import sip_data, sys_patch_data, model_array, os_data, smbios_data, cpu_data
|
from data import sip_data, sys_patch_data, model_array, os_data, smbios_data, cpu_data, dylib_data
|
||||||
|
|
||||||
|
|
||||||
class PatchSysVolume:
|
class PatchSysVolume:
|
||||||
@@ -215,8 +215,26 @@ class PatchSysVolume:
|
|||||||
self.manual_root_patch_revert()
|
self.manual_root_patch_revert()
|
||||||
|
|
||||||
def rebuild_snapshot(self):
|
def rebuild_snapshot(self):
|
||||||
# if self.constants.gui_mode is False:
|
# Grab List.txt if appropriate
|
||||||
# input("Press [ENTER] to continue with cache rebuild: ")
|
dylib_list = self.build_skylight_plugin_list()
|
||||||
|
if dylib_list is not None:
|
||||||
|
print("- Updating SkyLightPlugins List.txt")
|
||||||
|
if (Path(self.mount_private_etc) / Path("SkyLightPlugins/List.txt")).exists():
|
||||||
|
print("- Removing existing List.txt")
|
||||||
|
utilities.process_status(
|
||||||
|
utilities.elevated(
|
||||||
|
["rm", "-f", f"{self.mount_private_etc}/SkyLightPlugins/List.txt"],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
utilities.process_status(
|
||||||
|
utilities.elevated(
|
||||||
|
["cp", dylib_list, f"{self.mount_private_etc}/SkyLightPlugins/"],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
)
|
||||||
|
)
|
||||||
print("- Rebuilding Kernel Cache (This may take some time)")
|
print("- Rebuilding Kernel Cache (This may take some time)")
|
||||||
if self.constants.detected_os > os_data.os_data.catalina:
|
if self.constants.detected_os > os_data.os_data.catalina:
|
||||||
result = utilities.elevated(["kmutil", "install", "--volume-root", self.mount_location, "--update-all"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
result = utilities.elevated(["kmutil", "install", "--volume-root", self.mount_location, "--update-all"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
@@ -299,6 +317,34 @@ set million colour before rebooting"""
|
|||||||
utilities.process_status(utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
utilities.process_status(utilities.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
utilities.process_status(utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
utilities.process_status(utilities.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
|
||||||
|
def build_skylight_plugin_list(self):
|
||||||
|
# ASentientBot's Skylight system support injecting additional dylibs into macOS
|
||||||
|
# To do so, it parses the List.txt file in '/private/etc/SkyLightPlugins/'
|
||||||
|
# The format of this file is:
|
||||||
|
# <plugin path> : <plugin name>
|
||||||
|
# Parse all dylibs in /private/etc/SkyLightPlugins/, generate an appropriate List.txt
|
||||||
|
|
||||||
|
skylight_plugins = []
|
||||||
|
if self.constants.list_txt_path.exists():
|
||||||
|
self.constants.list_txt_path.unlink()
|
||||||
|
|
||||||
|
if (Path(self.mount_private_etc) / Path("SkyLightPlugins")).exists():
|
||||||
|
for file in (Path(self.mount_private_etc) / Path("SkyLightPlugins")).glob("*.dylib"):
|
||||||
|
skylight_plugins.append(file.name)
|
||||||
|
if len(skylight_plugins) > 0:
|
||||||
|
with open(self.constants.list_txt_path, "w") as f:
|
||||||
|
for plugin in skylight_plugins:
|
||||||
|
try:
|
||||||
|
path = dylib_data.shim_list.shim_pathing[plugin]
|
||||||
|
print(f"- Adding {plugin} to list.txt")
|
||||||
|
f.write(f"{path} : {plugin}\n")
|
||||||
|
except KeyError:
|
||||||
|
print(f"- Skipping {plugin}, unknown pathing")
|
||||||
|
continue
|
||||||
|
return self.constants.list_txt_path
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def add_brightness_patch(self):
|
def add_brightness_patch(self):
|
||||||
self.delete_old_binaries(sys_patch_data.DeleteBrightness)
|
self.delete_old_binaries(sys_patch_data.DeleteBrightness)
|
||||||
self.add_new_binaries(sys_patch_data.AddBrightness, self.constants.legacy_brightness)
|
self.add_new_binaries(sys_patch_data.AddBrightness, self.constants.legacy_brightness)
|
||||||
@@ -337,12 +383,8 @@ set million colour before rebooting"""
|
|||||||
)
|
)
|
||||||
|
|
||||||
def add_legacy_keyboard_backlight_patch(self):
|
def add_legacy_keyboard_backlight_patch(self):
|
||||||
print("- Adding Backlight-Fixup.plist")
|
print("- Merging Backlight private/etc")
|
||||||
utilities.process_status(
|
utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_keyboard_backlight_etc}/", self.mount_private_etc], stdout=subprocess.PIPE)
|
||||||
utilities.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_keyboard_backlight_lauchd}/", self.mount_lauchd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
|
||||||
)
|
|
||||||
utilities.process_status(utilities.elevated(["chmod", "755", f"{self.mount_lauchd}/Backlight-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
utilities.process_status(utilities.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/Backlight-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
|
|
||||||
def gpu_accel_legacy(self):
|
def gpu_accel_legacy(self):
|
||||||
if self.constants.detected_os == os_data.os_data.mojave:
|
if self.constants.detected_os == os_data.os_data.mojave:
|
||||||
|
|||||||
Reference in New Issue
Block a user