I need an initramfs hook to call a script after an initramfs has been generated.

The Debian Linux Kernel Handbook mentions /etc/initramfs/post-update.d/:

Packages for boot loaders that need to be updated whenever the files they load are modified must also install hook scripts in /etc/initramfs/post-update.d. […] The arguments given to these hook scripts are the kernel ABI version and the absolute path to the initramfs image.

This is exactly what I need, but this directory doesn't exist on my system. Though the directory /etc/initramfs-tools/ exists, but it doesn't contain a post-update.d.

Where is the correct place to hook in such a script?

OS: Debian sid

1 Answer 1


I have Debian stable, not sid, but it looks the same as what you describe so I think this answer is good for both.

The post-update.d directory doesn't exist in a default installation, but it is still checked by the update-initramfs script. The script doesn't distinguish between "nonexistent directory" and "exists but is empty". The intention is that if you are installing a bootloader that needs this functionality, you can just go ahead and create the directory yourself. The lilo and elilo packages do this, for example. Install one or both of those packages and you'll have an example to look at.

  • You're totally right, indeed. I assumed the mechanism had changed and the hook moved to a different place.
    – Marco
    Jul 18, 2013 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .