sys_patch.py: Add backend for MetallibSupportPkg

This commit is contained in:
Mykola Grymalyuk
2024-08-28 15:21:35 -06:00
parent a6503bcd97
commit bd51332a17
7 changed files with 448 additions and 19 deletions

View File

@@ -2,11 +2,16 @@
sys_patch_dict.py: Dictionary defining patch sets used during Root Volume patching (sys_patch.py)
"""
import enum
import packaging.version
from . import os_data
class DynamicPatchset(enum.Enum):
MetallibSupportPkg = "MetallibSupportPkg"
class SystemPatchDictionary():
"""
Library for generating patch sets for sys_patch.py and supporting modules
@@ -70,8 +75,8 @@ class SystemPatchDictionary():
self.patchset_dict: dict = {}
self.marketing_version: str = marketing_version
self.affected_by_cve_2024_23227: bool = self.__is_affect_by_cve_2024_23227()
self.metallib_directory: str = self.__resolve_metallibsupportpkg()
self.affected_by_cve_2024_23227: bool = self.__is_affect_by_cve_2024_23227()
self.metallib_directory: DynamicPatchset = DynamicPatchset.MetallibSupportPkg
# XNU Kernel versions
self.macOS_12_0_B7: float = 21.1
@@ -149,13 +154,6 @@ class SystemPatchDictionary():
return False
def __resolve_metallibsupportpkg(self) -> str:
"""
Temporarily hard coded
"""
return "/Library/Application Support/Dortania/MetallibSupportPkg/15.0-24A5327a"
def _generate_sys_patch_dict(self):
"""
Generates the sys_patch_dict dictionary
@@ -804,6 +802,12 @@ class SystemPatchDictionary():
"default.metallib": self.metallib_directory,
},
},
"Remove": {
"/System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/Resources": [
# For some reason Ivy Bridge can't tell the metallib lacks AIR64 support, and errors out
"archive.metallib",
],
},
},
# Primarily for AMD GCN GPUs