MODPROBE: next generation

dronnikov at gmail.com dronnikov at gmail.com
Tue Jun 17 17:24:29 UTC 2008


0. Intro

depmod + modprobe is some kind of complicated codec.
Though the syntax of modprobe.conf and friends is human-friendly most of module dependencies
is intrinsic and are hardly a subject to be customized manually.
du modules.* gives 150Kb on my reasonably small system and this amount of loosely defined textual data
must be parsed at every modprobe invocation.

I suggest to invent for BB a custom modules.dep format which bites all above issues.

1. Format of modules.dep (draft)

Consider a module X which depends on Y and Z, has aliases X1 and X2 and must be loaded with options O1 and O2.
We could write this definition down as follows:

-------
X
Y Z
X1 X2
O1 O2
-------

If any of parts of definition is missed we use empty line for it.
No more continuation lines, delimiters and so on!
Just mmap() the whole file and count for well-known amount of EOLs for each module and use skip_whitespace().
<off>I wish we had gzmmap() invented (or have we?)</off>
Extensions to such a format can be done trivially.

9. Miscellany

depmod can be trivially (IMO) updated to generate new modules.dep
Personally I think of depmod as of something redundant in terms of BB.
modules.dep could be generated on-the-fly during the first call to modprobe if it is missed.

To not interfere with "old-style" modutils "new" modules.dep should be named, say, modules.bb.

Comments?

--
Vladimir


More information about the busybox mailing list