Skip to contentSkip to conversation

build initramfs: explain modprobe?

DISCUSSION John Reiser 2 participants 3 messages Aug 30, 2011 – Sep 6, 2011 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

What properties of modprobe are essential for building initramfs? Modprobe works for only one kernel module at a time, and this is a cause of slowness. For instance, computing the transitive closure of the Requires relationship over a non-small set of modules can be performed faster by loading modules.dep into a bash associative array, then processing in bash. Also, modinfo now is invoked once per module to find firmware, but this can be sped up by invoking on batches of modules, using "split -C 32000" to avoid the argsize limit of execve.

Invoking modprobe with --ignore-install seems to remove any effects due to (possibly host-specific) /etc/modules.d/*.conf. Is there anything else that modprobe does for building initramfs, other than transitive closure of Requires?

#2 lore raw
In reply to a message not in the archive
Quoted 9 lines · John Reiser

What properties of modprobe are essential for building initramfs? Modprobe works for only one kernel module at a time, and this is a cause of slowness. For instance, computing the transitive closure of the Requires relationship over a non-small set of modules can be performed faster by loading modules.dep into a bash associative array, then processing in bash. Also, modinfo now is invoked once per module to find firmware, but this can be sped up by invoking on batches of modules, using "split -C 32000" to avoid the argsize limit of execve.

Quoted 5 lines

Invoking modprobe with --ignore-install seems to remove any effects due to (possibly host-specific) /etc/modules.d/*.conf. Is there anything else that modprobe does for building initramfs, other than transitive closure of Requires?

Hmm, you are right. Modules loaded in "/etc/modules.d/*.conf" are not honored. And yes, "modprobe" is only used to easily get the requirements.

#4 lore raw
In reply to a message not in the archive
Quoted 4 lines
Quoted 2 lines

What properties of modprobe are essential for building initramfs? [snip]

And yes, "modprobe" is only used to easily get the requirements.

Explicitly:
0) Expand short names: "pcmcia" ==> "kernel/drivers/pcmcia/pcmcia.ko".
1) Compute transitive closure of Requires from modules.dep.
2) Ignore modules listed in modules.builtin.
3) Handle aliasing of underscore and minus:

     "usb_storage" ==> "usb-storage".