I ran into a case that a special module needs to know the network interface status during its initialization.
since openwrt network interfaces get initialized quite late, that module always failed during system startup.
I moved the ko to another path to assure it won't be auto inserted by kmodloader. and I tried to insert it in rc.local.
then I found that the command insmod (which is a sym link to kmodloader) does not accept a absolute path, it always looked for the module under /lib/modules/{uname -r}/.
I made a patch to correct this.
I'm not sure if it's the right place to post something like this. I hope it helps.
Index: ubox-2013-10-27/kmodloader.c
===================================================================
--- ubox-2013-10-27.orig/kmodloader.c
+++ ubox-2013-10-27/kmodloader.c
@@ -489,7 +489,7 @@ static int print_usage(char *arg)
static int main_insmod(int argc, char **argv)
{
- char *name, *cur, *options;
+ char *name, *cur, *options, *abspath;
int i, ret, len;
if (argc < 2)
@@ -526,7 +526,15 @@ static int main_insmod(int argc, char **
cur += sprintf(cur, "%s", argv[i]);
}
- ret = insert_module(get_module_path(name), options);
+ if(argv[1][0] == '/' ) // path starts with '/'
+ {
+ abspath = argv[1];
+ printf("absolute module path: %s\n", abspath);
+ }
+ else
+ abspath = get_module_path(name);
+
+ ret = insert_module(abspath, options);
free(options);
if (ret)