Add dracut-remove.sh

This commit is contained in:
sedlav 2024-04-22 02:13:32 +02:00
parent 30366a03e6
commit 62f2a46a94

10
dracut-remove.sh Normal file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Save this file on /usr/local/bin/dracut-remove.sh
#
while read -r line; do
if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then
read -r pkgbase < "/${line}"
rm -f "/boot/vmlinuz-${pkgbase}" "/boot/initramfs-${pkgbase}.img" "/boot/initramfs-${pkgbase}-fallback.img"
fi
done