0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.142.131.51


Current Path : /proc/self/root/usr/share/doc/initramfs-tools-core/
Upload File :
Current File : //proc/self/root/usr/share/doc/initramfs-tools-core/HACKING

> I am not sure how to modify mkinitramfs to do this automatically, maybe you know?

I need to document this more clearly, but the initramfs-tools have a collection of hooks that will solve your problem.  While there's no way that Breezy could do this in the install, we could certainly include the scripts in the package (Especially if you're willing to test them to make sure they work! *g*)

There are two phases that need to be accounted for.  The first is the install phase for generating the initramfs, the second is run-time phase for actually doing the needed magic.

To install the components you need, look at the scripts in /usr/share/initramfs-tools/hooks.  evms and acpid are good choices.  You can see a bunch of header stuff at the top that basically guarantees that things are run in the right order if they need to be.  Two functions that will interest you:

copy_exec copies a binary and any libraries it depends on
manual_add_modules takes bareword module names (like fan, thermal, etc) and installs those modules and any of their dependancies into the initramfs.

The runtime phase is handled by scripts in /usr/share/initramfs-tools/scripts/ you probably want to start up at about the same point as lvm, md, and evms do, so local-top is a good directory to look in.
You can see the same sort of magic at the top of the script, although lvm and evms each require that md run first.

I hope this helps.  I'll paste this text into a HACKING file on the hopes that someone will see fit to improve it.  That person will probably be me, mind you... =)

Tks,
Jeff Bailey