};
static struct avl_tree modules;
+static char *prefix = "";
static struct module *find_module(const char *name)
{
return name;
uname(&ver);
- snprintf(path, 256, DEF_MOD_PATH "%s.ko", ver.release, name);
+ snprintf(path, 256, "%s" DEF_MOD_PATH "%s.ko", prefix, ver.release, name);
if (!stat(path, &s))
return path;
t++;
}
- snprintf(path, 256, DEF_MOD_PATH "%s.ko", ver.release, name);
+ snprintf(path, 256, "%s" DEF_MOD_PATH "%s.ko", prefix, ver.release, name);
if (!stat(path, &s))
return path;
if (argc > 1)
dir = argv[1];
+ if (argc > 2)
+ prefix = argv[2];
+
path = malloc(strlen(dir) + 2);
strcpy(path, dir);
strcat(path, "*");