]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Delete empty firmware subdirectories 3142/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Oct 2024 13:36:32 +0000 (14:36 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Oct 2024 13:41:37 +0000 (14:41 +0100)
Fixes #3124

mkosi/kmod.py

index 6ba873fbe6efc6d7f0ef2accf9fade42931aa6ce..73491410720082dd3a970eb26d40cf2559233ba4 100644 (file)
@@ -242,5 +242,7 @@ def process_kernel_modules(
             p = root / fw
             if p.is_file() or p.is_symlink():
                 p.unlink()
+                if p.parent != root / firmwared and not any(p.parent.iterdir()):
+                    p.parent.rmdir()
             else:
                 p.rmdir()