2016-08-15 23:05:52 +00:00
|
|
|
diff -ru -x '*~' kmod-17-orig/libkmod/libkmod.c kmod-17/libkmod/libkmod.c
|
|
|
|
--- kmod-17-orig/libkmod/libkmod.c 2014-04-01 12:40:37.161940089 +0200
|
|
|
|
+++ kmod-17/libkmod/libkmod.c 2014-04-17 13:47:15.871441987 +0200
|
|
|
|
@@ -201,7 +201,7 @@
|
2012-04-04 19:24:07 +00:00
|
|
|
static char *get_kernel_release(const char *dirname)
|
|
|
|
{
|
|
|
|
struct utsname u;
|
|
|
|
- char *p;
|
|
|
|
+ char *p, *dirname_prefix;
|
|
|
|
|
|
|
|
if (dirname != NULL)
|
|
|
|
return path_make_absolute_cwd(dirname);
|
2016-08-15 23:05:52 +00:00
|
|
|
@@ -209,7 +209,10 @@
|
2012-04-04 19:24:07 +00:00
|
|
|
if (uname(&u) < 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
- if (asprintf(&p, "%s/%s", dirname_default_prefix, u.release) < 0)
|
2016-08-15 23:05:52 +00:00
|
|
|
+ if ((dirname_prefix = getenv("MODULE_DIR")) == NULL)
|
|
|
|
+ dirname_prefix = dirname_default_prefix;
|
2012-04-04 19:24:07 +00:00
|
|
|
+
|
2016-08-15 23:05:52 +00:00
|
|
|
+ if (asprintf(&p, "%s/%s", dirname_prefix, u.release) < 0)
|
|
|
|
return NULL;
|
2012-04-04 19:24:07 +00:00
|
|
|
|
|
|
|
return p;
|
2016-08-15 23:05:52 +00:00
|
|
|
diff -ru -x '*~' kmod-17-orig/tools/static-nodes.c kmod-17/tools/static-nodes.c
|
|
|
|
--- kmod-17-orig/tools/static-nodes.c 2013-12-17 22:05:42.159047316 +0100
|
|
|
|
+++ kmod-17/tools/static-nodes.c 2014-04-17 13:51:17.945974320 +0200
|
|
|
|
@@ -159,6 +159,7 @@
|
2014-04-17 11:52:30 +00:00
|
|
|
FILE *in = NULL, *out = NULL;
|
|
|
|
const struct static_nodes_format *format = &static_nodes_format_human;
|
2016-08-15 23:05:52 +00:00
|
|
|
int r, ret = EXIT_SUCCESS;
|
|
|
|
+ char *dirname_prefix;
|
2014-04-17 11:52:30 +00:00
|
|
|
|
2016-08-15 23:05:52 +00:00
|
|
|
for (;;) {
|
|
|
|
int c, idx = 0, valid;
|
|
|
|
@@ -211,16 +212,19 @@
|
2014-04-17 11:52:30 +00:00
|
|
|
goto finish;
|
|
|
|
}
|
2016-08-15 23:05:52 +00:00
|
|
|
|
2014-04-17 11:52:30 +00:00
|
|
|
- snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
|
2016-08-15 23:05:52 +00:00
|
|
|
+ if ((dirname_prefix = getenv("MODULE_DIR")) == NULL)
|
|
|
|
+ dirname_prefix = "/lib/modules";
|
|
|
|
+
|
|
|
|
+ snprintf(modules, sizeof(modules), "%s/%s/modules.devname", dirname_prefix, kernel.release);
|
2014-04-17 11:52:30 +00:00
|
|
|
in = fopen(modules, "re");
|
|
|
|
if (in == NULL) {
|
|
|
|
if (errno == ENOENT) {
|
|
|
|
- fprintf(stderr, "Warning: /lib/modules/%s/modules.devname not found - ignoring\n",
|
|
|
|
- kernel.release);
|
2016-08-15 23:05:52 +00:00
|
|
|
+ fprintf(stderr, "Warning: %s/%s/modules.devname not found - ignoring\n",
|
|
|
|
+ dirname_prefix, kernel.release);
|
2014-04-17 11:52:30 +00:00
|
|
|
ret = EXIT_SUCCESS;
|
|
|
|
} else {
|
|
|
|
- fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname - %m\n",
|
|
|
|
- kernel.release);
|
2016-08-15 23:05:52 +00:00
|
|
|
+ fprintf(stderr, "Error: could not open %s/%s/modules.devname - %m\n",
|
|
|
|
+ dirname_prefix, kernel.release);
|
2014-04-17 11:52:30 +00:00
|
|
|
ret = EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
goto finish;
|