summaryrefslogtreecommitdiffstats
path: root/debian/dracut.postinst
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/dracut.postinst27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/dracut.postinst b/debian/dracut.postinst
new file mode 100644
index 0000000..d0b55ed
--- /dev/null
+++ b/debian/dracut.postinst
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+
+mk_initrd() {
+
+ if ls /boot/vmlinu[zx]-* >/dev/null 2>&1; then
+
+ # Regenerate initramfs for all kernel that are installed
+ for kversion in `ls /boot/vmlinu[zx]-* | sed -e 's#/boot/vmlinu.-##'`; do
+ /etc/kernel/postinst.d/dracut $kversion
+ done
+ fi
+}
+
+if [ "x$1" != xtriggered ]; then
+ # activate trigger
+ if dpkg-trigger --no-await update-initramfs; then
+ echo "update-initramfs: deferring update (trigger activated)"
+ exit 0
+ fi
+else
+ mk_initrd
+fi
+
+#DEBHELPER#