X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=debian%2Flive-initramfs.postinst;h=b94b3bdfb321196758842f84e1b9051db346e848;hb=d655e60289cedb0cfb968e09a0b4f8c902479cb3;hp=9a508c6c0f573ba2c790907b0deeaef954f332a6;hpb=0a1b827c113b85f48bcd58e64ccd94d094b9bd8a;p=live-boot-grml.git diff --git a/debian/live-initramfs.postinst b/debian/live-initramfs.postinst index 9a508c6..b94b3bd 100644 --- a/debian/live-initramfs.postinst +++ b/debian/live-initramfs.postinst @@ -1,5 +1,25 @@ #!/bin/sh -update-initramfs -k all -u +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 + # 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#