mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-15 20:00:00 +10:00
sys_patch.py: Handle migrated kexts from old installs
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
- ie. stock SSD found in MacBookAir6,x
|
||||
- Lax KDK N-1 logic to allow 1 minor version difference
|
||||
- ex. Allow 13.0 KDK on 13.1
|
||||
- Clean out `/Library/Extensions` on KDK-less root patches
|
||||
- Ensures old, incompatible kexts are not linked against
|
||||
|
||||
## 0.5.0
|
||||
- Ventura Specific Updates:
|
||||
|
||||
@@ -36,6 +36,7 @@ import plistlib
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from resources import constants, utilities, sys_patch_download, sys_patch_detect, sys_patch_auto, sys_patch_helpers, kdk_handler
|
||||
from data import os_data
|
||||
@@ -354,6 +355,15 @@ class PatchSysVolume:
|
||||
continue
|
||||
self.remove_file("/Library/Extensions", file)
|
||||
|
||||
# Handle situations where users migrated from older OSes with a lot of garbage in /L*/E*
|
||||
# ex. Nvidia Web Drivers, NetUSB, dosdude1's patches, etc.
|
||||
# Delete if file's age is older than October 2021 (year before Ventura)
|
||||
if self.constants.detected_os < os_data.os_data.ventura:
|
||||
return
|
||||
for file in Path("/Library/Extensions").glob("*.kext"):
|
||||
if datetime.fromtimestamp(file.stat().st_mtime) < datetime(2021, 10, 1):
|
||||
self.remove_file("/Library/Extensions", file.name)
|
||||
|
||||
def write_patchset(self, patchset):
|
||||
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
||||
file_name = "OpenCore-Legacy-Patcher.plist"
|
||||
|
||||
Reference in New Issue
Block a user