Strip unused kext entries during build

This commit is contained in:
Mykola Grymalyuk
2021-04-12 22:03:38 -06:00
parent af3d4c4af5
commit 9787645542
6 changed files with 9 additions and 4 deletions
+4
View File
@@ -502,6 +502,10 @@ class BuildOpenCore:
def cleanup(self):
print("- Cleaning up files")
# Remove unused kexts
for kext in list(self.config["Kernel"]["Add"]):
if not kext["Enabled"]:
self.config["Kernel"]["Add"].remove(kext)
plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True)
for kext in self.constants.kexts_path.rglob("*.zip"):
with zipfile.ZipFile(kext) as zip_file: