Initramfs problems with the new kernel-package, and a solution

I’ve been using Manoj’s new kernel-package for some weeks now, and used it to compile two kernels (a reconfigured and the new Both times I’ve had trouble with initrd.

As the documentation says, kernel-package kernel packages no longer do their own initramfs generation. One must copy the example scripts at /usr/share/doc/kernel-package/examples/etc.kernel/postinst.d/initramfs and /usr/share/doc/kernel-package/examples/etc.kernel/postrm.d/initramfs to the appropriate subdirectories of /etc/kernel/. However, this is not enough.

My /etc/kernel-img.conf file had the usual posthook and prehook lines calling update-grub. Unfortunately, those hooks are called before the postinst.d hooks, and so update-grub never saw my initramfs images.

Fix? I removed those lines from /etc/kernel-img.conf and created a very simple postinst.d and postrm.d script:



I call the script zzz-grub-local, to ensure that it runs last.