Add a simple post transaction hook to clean remnant dir/files

Since the move to the new hooking mechanisms, we got remnant files after package upgrade.
They aren't part of the package and get generated by the depmod hook.
This addresses the issue by checking for tkg kernels module dirs and removing the ones missing a vmlinuz file (which is part of the package).
Due to the way it works, it'll also get rid of all past remnants to stay transparent for users.
This commit is contained in:
Tk-Glitch
2020-05-01 00:22:00 +02:00
parent 95efd2d545
commit f0f7c029f3
12 changed files with 139 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
#!/bin/bash
for _f in /usr/lib/modules/*tkg*; do
if [[ ! -e ${_f}/vmlinuz ]]; then
rm -rf "$_f"
fi
done
# vim:set ft=sh sw=2 et: