Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
You're totally right, indeed. I assumed the mechanism had changed and the hook moved to a different place. – Marco Jul 18 '13 at 20:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.