mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
sys_patch: Relocate old kexts instead of nuke
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- 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
|
||||
- Old kexts are relocated to `/Library/Relocated Extensions`
|
||||
- Add OpenCore Picker timeout selection
|
||||
|
||||
## 0.5.0
|
||||
|
||||
@@ -357,12 +357,18 @@ class PatchSysVolume:
|
||||
|
||||
# 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)
|
||||
# Move if file's age is older than October 2021 (year before Ventura)
|
||||
if self.constants.detected_os < os_data.os_data.ventura:
|
||||
return
|
||||
|
||||
relocation_path = "/Library/Relocated Extensions"
|
||||
if not Path(relocation_path).exists():
|
||||
utilities.elevated(["mkdir", relocation_path])
|
||||
|
||||
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)
|
||||
print(f" - Relocating {file.name} kext to {relocation_path}")
|
||||
utilities.elevated(["mv", file, relocation_path])
|
||||
|
||||
def write_patchset(self, patchset):
|
||||
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
||||
|
||||
Reference in New Issue
Block a user