--- module-init-tools-0.6/modprobe.c 2002-10-30 20:03:06.000000000 -0800 +++ module-init-tools-0.6.ajr/modprobe.c 2002-11-18 07:20:59.000000000 -0800 @@ -36,7 +36,7 @@ #include "backwards_compat.c" -#define MODULE_DIR "/lib/modules/%s/kernel/" +#define MODULE_DIR "/lib/modules" #define MODULE_EXTENSION ".o" #define MODULE_NAME_LEN (64 - ELF_TYPE / 8) @@ -227,14 +227,14 @@ return new; } -static struct module *load_all_exports(const char *revision) +static struct module *load_all_exports(const char *parent, const char *subdir, + struct module *mods) { - struct module *mods = NULL; struct dirent *dirent; DIR *dir; - char dirname[strlen(revision) + sizeof(MODULE_DIR)]; + char dirname[strlen(parent) + strlen(subdir) + 2]; - sprintf(dirname, MODULE_DIR, revision); + sprintf(dirname, "%s/%s", parent, subdir); dir = opendir(dirname); if (dir) { while ((dirent = readdir(dir)) != NULL) { @@ -242,6 +242,9 @@ if (ends_in(dirent->d_name, MODULE_EXTENSION)) mods = add_module(dirname, dirent->d_name, mods); + else + mods = load_all_exports(dirname, + dirent->d_name, mods); } closedir(dir); } @@ -440,12 +443,13 @@ struct module *modules; struct module *i; char pathname[strlen(revision) + sizeof(MODULE_DIR) + strlen(modname) - + sizeof(MODULE_EXTENSION)]; + + sizeof(MODULE_EXTENSION) + 1]; /* Create path name */ - sprintf(pathname, MODULE_DIR "%s" MODULE_EXTENSION, revision, modname); + sprintf(pathname, "%s/%s/%s%s", MODULE_DIR, + revision, modname, MODULE_EXTENSION); - modules = load_all_exports(revision); + modules = load_all_exports(MODULE_DIR, revision, NULL); order = 1; if (get_deps(order, pathname, modules, verbose)) { /* We need some other modules. */