diff --git a/CHANGELOG.md b/CHANGELOG.md index 808d531c3..a11aa9c07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/resources/sys_patch/sys_patch.py b/resources/sys_patch/sys_patch.py index 1c441c99f..13f5ebbc8 100644 --- a/resources/sys_patch/sys_patch.py +++ b/resources/sys_patch/sys_patch.py @@ -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.