summarylogtreecommitdiffstats
path: root/dracut-remove
diff options
context:
space:
mode:
authorFranklyn Tackitt2020-01-30 16:04:57 -0700
committerFranklyn Tackitt2020-01-30 16:04:57 -0700
commitc445fa876c36ca18200f362b4020cad791e9f609 (patch)
tree079b7232a67ee49b2e2ba76c20dee6e3a68b0b8e /dracut-remove
parentc45e6f7b89dfae01b97f58b46bc3779ae3c89f4f (diff)
downloadaur-c445fa876c36ca18200f362b4020cad791e9f609.tar.gz
0.3 - Add remove hook
Diffstat (limited to 'dracut-remove')
-rw-r--r--dracut-remove8
1 files changed, 8 insertions, 0 deletions
diff --git a/dracut-remove b/dracut-remove
new file mode 100644
index 000000000000..af350c7f6df6
--- /dev/null
+++ b/dracut-remove
@@ -0,0 +1,8 @@
+#!/bin/bash -e
+
+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