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 2.6.29.1 and the new 2.6.29.2). 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:

#!/bin/sh

update-grub

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

2 thoughts on “Initramfs problems with the new kernel-package, and a solution

  1. kernel-package (12.008) unstable; urgency=low

    * [55b39b3]: Move invocation of postinst hook scripts after
    /etc/kernel/*.d/* scripts A lot of people have update-grub in their
    /etc/kernel-img.conf postint_hook setting. If that is called early,
    the initramfs invocation in /etc/kernel/postinst.d/initramfs has not
    yet happened, so the update grub script does not notice the
    initramfs, making the system unbootable. Yes, the update grub cant
    be moved into /etc/kernel/postinst.d/ too, but this is friendlier.
    Bug fix: “postinst hook script (update-grub) ran before
    /etc/kernel/postinst.d/initramfs.”, thanks to Jean-Luc Coulon (f5ibh)
    (Closes: #523931).

    Did this not work for you?

  2. Well, for some reason my aptitude never upgraded kernel-package beyond 12.002. I never looked at what the vesrion is in unstable, since I assumed my apt would have upgraded it if so. It turns out I had kernel-package pinned (in a broken way) to experimental.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>