X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=debian%2Fpostinst;h=805eb0af8f0798a251e2ef321b46da20d0cd46fd;hb=a0e75528542d35969b4bccc200ec705a50b569e1;hp=752b161b63471aeb0c439e083d09ed080cb36c00;hpb=949eb8c66baddef83378dd677c10b02c3f23ca36;p=live-boot-grml.git 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#