sys_patch: Clean LE properly

This commit is contained in:
Mykola Grymalyuk
2022-12-21 21:15:06 -07:00
parent 5fdde346cf
commit 1277fef735
2 changed files with 12 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
- Applicable for BCM94328, BCM94322 and Atheros chipsets
- Implement Wifi-only patches when no internet connection available but required (ie. KDKs)
- Allows users to install Legacy Wireless patches, then connect to the internet to install remaining patches
- Resolve `/Library/Extensions` not being cleaned on KDK-less root patches
- Increment Binaries:
- PatcherSupportPkg 0.7.2 - release

View File

@@ -339,23 +339,20 @@ class PatchSysVolume:
if self.constants.detected_os < os_data.os_data.big_sur:
return
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if not Path(oclp_path).exists():
return
print("- Cleaning Auxiliary Kernel Collection")
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
for key in oclp_plist_data:
if "Install" not in oclp_plist_data[key]:
continue
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if Path(oclp_path).exists():
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
for key in oclp_plist_data:
if "Install" not in oclp_plist_data[key]:
continue
for file in oclp_plist_data[key]["Install"][location]:
if not file.endswith(".kext"):
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
continue
self.remove_file("/Library/Extensions", file)
for file in oclp_plist_data[key]["Install"][location]:
if not file.endswith(".kext"):
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.