summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/postinst20
-rw-r--r--debian/postrm20
-rw-r--r--debian/triggers1
3 files changed, 37 insertions, 4 deletions
diff --git a/debian/postinst b/debian/postinst
index 752b161..805eb0a 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,8 +1,24 @@
#!/bin/sh
-if [ -x /usr/sbin/update-initramfs ]
+case "$(ls -l /boot/vmlinuz* | wc -l)" in
+ 1)
+ # We only have one kernel installed, so we can use "-u"
+ # which will use dpkg-trigger inside update-initramfs
+ INITRAMFS_ARGS="-u"
+ ;;
+ *)
+ INITRAMFS_ARGS="-u -k all"
+ ;;
+esac
+
+if [ -x /usr/sbin/update-initramfs ] && [ "x$1" != "xtriggered" ] && \
+ dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.18'
then
- update-initramfs -k all -u
+ # this activates the trigger, if triggers are working
+ update-initramfs ${INITRAMFS_ARGS}
+else
+ # force it to actually happen
+ DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs ${INITRAMFS_ARGS}
fi
#DEBHELPER#
diff --git a/debian/postrm b/debian/postrm
index 752b161..805eb0a 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,8 +1,24 @@
#!/bin/sh
-if [ -x /usr/sbin/update-initramfs ]
+case "$(ls -l /boot/vmlinuz* | wc -l)" in
+ 1)
+ # We only have one kernel installed, so we can use "-u"
+ # which will use dpkg-trigger inside update-initramfs
+ INITRAMFS_ARGS="-u"
+ ;;
+ *)
+ INITRAMFS_ARGS="-u -k all"
+ ;;
+esac
+
+if [ -x /usr/sbin/update-initramfs ] && [ "x$1" != "xtriggered" ] && \
+ dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.18'
then
- update-initramfs -k all -u
+ # this activates the trigger, if triggers are working
+ update-initramfs ${INITRAMFS_ARGS}
+else
+ # force it to actually happen
+ DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs ${INITRAMFS_ARGS}
fi
#DEBHELPER#
diff --git a/debian/triggers b/debian/triggers
new file mode 100644
index 0000000..6c9f454
--- /dev/null
+++ b/debian/triggers
@@ -0,0 +1 @@
+activate update-initramfs