X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=debian%2Fpostrm;h=b94b3bdfb321196758842f84e1b9051db346e848;hb=e35cf97a1ac5bf8e72e6199c70ea66cc8268b911;hp=752b161b63471aeb0c439e083d09ed080cb36c00;hpb=3093ff10b1666c7f1cbf5bf6ce7d3031482fb23f;p=live-boot-grml.git diff --git a/debian/postrm b/debian/postrm old mode 100755 new mode 100644 index 752b161..b94b3bd --- a/debian/postrm +++ b/debian/postrm @@ -1,8 +1,25 @@ #!/bin/sh -if [ -x /usr/sbin/update-initramfs ] +case "$(ls -l /boot/vmlinu* | 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 ] && [ "${1}" != "triggered" ] && \ + 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#