sys_patch_dict.py: Remove Nvidia Pref Pane

Broken in Mojave and newer, unneeded for ourselves
This commit is contained in:
Mykola Grymalyuk
2022-05-26 18:43:59 -06:00
parent 87df615150
commit 035d441cb9
2 changed files with 28 additions and 11 deletions
+6 -3
View File
@@ -303,9 +303,12 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"NVDANV50HalTeslaWeb.kext": "WebDriver-387.10.10.10.40.140", "NVDANV50HalTeslaWeb.kext": "WebDriver-387.10.10.10.40.140",
"NVDAResmanTeslaWeb.kext": "WebDriver-387.10.10.10.40.140", "NVDAResmanTeslaWeb.kext": "WebDriver-387.10.10.10.40.140",
}, },
"/Library/PreferencePanes": {
"NVIDIA Driver Manager.prefPane": "WebDriver-387.10.10.10.40.140", # Nvidia's control panel crashes on 10.14+
}, # For us, no real point in using it so ignore
# "/Library/PreferencePanes": {
# "NVIDIA Driver Manager.prefPane": "WebDriver-387.10.10.10.40.140",
# },
}, },
}, },
"AMD TeraScale Common": { "AMD TeraScale Common": {
+22 -8
View File
@@ -114,14 +114,17 @@ class PatchSysVolume:
def rebuild_snapshot(self): def rebuild_snapshot(self):
print("- Rebuilding Kernel Cache (This may take some time)") print("- Rebuilding Kernel Cache (This may take some time)")
args = ["kmutil", "install", "--volume-root", self.mount_location, "--update-all"] if self.constants.detected_os > os_data.os_data.catalina:
args = ["kmutil", "install", "--volume-root", self.mount_location, "--update-all"]
if self.needs_kmutil_exemptions is True: if self.needs_kmutil_exemptions is True:
# When installing to '/Library/Extensions', following args skip kext consent # When installing to '/Library/Extensions', following args skip kext consent
# prompt in System Preferences when SIP's disabled # prompt in System Preferences when SIP's disabled
print("- Disabling auth checks in kmutil") print("- Disabling auth checks in kmutil")
args.append("--no-authentication") args.append("--no-authentication")
args.append("--no-authorization") args.append("--no-authorization")
else:
args = ["kextcache", "-i", f"{self.mount_location}/"]
result = utilities.elevated(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result = utilities.elevated(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -132,7 +135,7 @@ class PatchSysVolume:
# - will return 71 on failure to build KCs # - will return 71 on failure to build KCs
# - will return 31 on 'No binaries or codeless kexts were provided' # - will return 31 on 'No binaries or codeless kexts were provided'
# - will return -10 if the volume is missing (ie. unmounted by another process) # - will return -10 if the volume is missing (ie. unmounted by another process)
if result.returncode != 0: if result.returncode != 0 or (self.constants.detected_os < os_data.os_data.catalina and "KernelCache ID" not in result.stdout.decode()):
print("- Unable to build new kernel cache") print("- Unable to build new kernel cache")
print(f"\nReason for Patch Failure ({result.returncode}):") print(f"\nReason for Patch Failure ({result.returncode}):")
print(result.stdout.decode()) print(result.stdout.decode())
@@ -142,6 +145,8 @@ class PatchSysVolume:
input("Press [ENTER] to continue") input("Press [ENTER] to continue")
else: else:
print("- Successfully built new kernel cache") print("- Successfully built new kernel cache")
self.update_preboot_kernel_cache()
self.rebuild_dyld_shared_cache()
if self.root_supports_snapshot is True: if self.root_supports_snapshot is True:
print("- Creating new APFS snapshot") print("- Creating new APFS snapshot")
bless = utilities.elevated( bless = utilities.elevated(
@@ -166,6 +171,15 @@ class PatchSysVolume:
print("- Unmounting Root Volume (Don't worry if this fails)") print("- Unmounting Root Volume (Don't worry if this fails)")
utilities.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode() utilities.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode()
def rebuild_dyld_shared_cache(self):
if self.constants.detected_os <= os_data.os_data.catalina:
print("- Rebuilding dyld shared cache")
utilities.process_status(utilities.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"]))
def update_preboot_kernel_cache(self):
if self.constants.detected_os == os_data.os_data.catalina:
print("- Rebuilding preboot kernel cache")
utilities.process_status(utilities.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def clean_skylight_plugins(self): def clean_skylight_plugins(self):
if (Path(self.mount_application_support) / Path("SkyLightPlugins/")).exists(): if (Path(self.mount_application_support) / Path("SkyLightPlugins/")).exists():