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
+1
View File
@@ -6,6 +6,7 @@
- Applicable for BCM94328, BCM94322 and Atheros chipsets - Applicable for BCM94328, BCM94322 and Atheros chipsets
- Implement Wifi-only patches when no internet connection available but required (ie. KDKs) - 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 - 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: - Increment Binaries:
- PatcherSupportPkg 0.7.2 - release - PatcherSupportPkg 0.7.2 - release
+11 -14
View File
@@ -339,23 +339,20 @@ class PatchSysVolume:
if self.constants.detected_os < os_data.os_data.big_sur: if self.constants.detected_os < os_data.os_data.big_sur:
return return
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if not Path(oclp_path).exists():
return
print("- Cleaning Auxiliary Kernel Collection") print("- Cleaning Auxiliary Kernel Collection")
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb")) oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if Path(oclp_path).exists():
for key in oclp_plist_data: oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
if "Install" not in oclp_plist_data[key]: for key in oclp_plist_data:
continue if "Install" not in oclp_plist_data[key]:
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
continue continue
for file in oclp_plist_data[key]["Install"][location]: for location in oclp_plist_data[key]["Install"]:
if not file.endswith(".kext"): if not location.endswith("Extensions"):
continue 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* # 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. # ex. Nvidia Web Drivers, NetUSB, dosdude1's patches, etc.