summarylogtreecommitdiffstats
path: root/90-kernel-install-remove.hook
diff options
context:
space:
mode:
Diffstat (limited to '90-kernel-install-remove.hook')
-rw-r--r--90-kernel-install-remove.hook13
1 files changed, 13 insertions, 0 deletions
diff --git a/90-kernel-install-remove.hook b/90-kernel-install-remove.hook
new file mode 100644
index 000000000000..223251a8e8bd
--- /dev/null
+++ b/90-kernel-install-remove.hook
@@ -0,0 +1,13 @@
+[Trigger]
+Operation = Upgrade
+Operation = Remove
+Type = File
+Target = usr/lib/modules/*/vmlinuz
+
+[Action]
+Description = Removing kernel and initrd from $BOOT (kernel-install)
+When = PreTransaction
+Exec = /bin/bash -c 'while read -r vmlinuz; do : && kver="$(basename "$(dirname "$vmlinuz")")" && echo + kernel-install remove "$kver" && kernel-install -v remove "$kver" | sed "/^\+/d"; done'
+Depends = bash
+Depends = systemd
+NeedsTargets