Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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.