[Toybox] Does anybody have modprobe domain expertise?

Rob Landley rob at landley.net
Sun Oct 20 19:24:58 PDT 2024


I got a request to add a feature to it:

https://github.com/landley/toybox/issues/522

And the systems I build are almost always static, and the few times I 
_have_ needed a symbol (generally because a module parameter had to be 
calculated after boot time) I used insmod instead of modprobe.

Which means I'm reading through the modprobe.c in pending... except our 
modprobe hasn't got a "depmod", but we depend on the results of 
modules.dep as a file modprobe reads and kind of centrally depends on.

So I went "eh, the *.ko files are ELF and there's only a couple thousand 
of them, we've got readelf plumbing already, I can quickly parse out the 
library includes" but no, that's not how it works, it's a linker that's 
matching symbol imports and symbol exports by name.

Except that's STILL not right, it's using modules.symbols to RENAME a 
bunch of symbols. (And of course the "gpl symbols" that are name mangled 
so other stuff can't find them.) And my devuan laptop has a 
modules.symbols file full or nonsensical renames, and I'm pretty sure 
the kernel build put them there (probably by calling the host's depmod).

And for some reason, busybox's menuconfig has the ability to switch off 
FEATURE_MODUTILS_SYMBOLS except the kernel is exporting them. Can you 
switch off symbol aliasing in the _kernel_? (If so, why would it even 
exist?)

Does somebody already understand this stuff?

Rob


More information about the Toybox mailing list