[Bug 627] modprobe-small: incorrect alias-based probe with dep_bb_fd < 0

bugzilla at busybox.net bugzilla at busybox.net
Wed Aug 11 15:22:05 UTC 2010


--- Comment #20 from Denys Vlasenko <vda.linux at googlemail.com>  ---
Well, the solution needed here is to closely follow module-init-tools.

There is a comment in modprobe_small.c about the exact nature
of the problem:

 * Given modules definition and module name (or alias, or symbol)
 * load/remove the module respecting dependencies.
 * NB: also called by depmod with bogus name "/",
 * just in order to force modprobe.dep.bb creation.
static void process_module(char *name, const char *cmdline_options)
        module_info *info;

        if (!module_count) {
                /* Scan module directory. This is done only once.
                 * It will attempt module load, and will exit(EXIT_SUCCESS)
                 * on success. */
                dbg1_error_msg("dirscan complete");
                /* Module was not found, or load failed, or is_rmmod */
                if (module_found_idx >= 0) { /* module was found */
                        info = &modinfo[module_found_idx];
                } else { /* search for alias, not a plain module name */
                        info = find_alias(name);
        } else {
                info = find_alias(name);

// Problem here: there can be more than one module
// for the given alias. For example,
// "pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" matches
// ata_piix because it has an alias "pci:v00008086d00007010sv*sd*bc*sc*i*"
// and ata_generic, it has an alias "alias=pci:v*d*sv*sd*bc01sc01i*"
// Standard modprobe would load them both.
// In this code, find_alias() returns only the first matching module.

That's where the problem is: find_alias() returns one module_info;
but in order to mimic module-init-tools, it needs to return
*a list* of matching module_info's.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list