aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-16 10:40:06 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-16 10:40:06 +0000
commitf848305afc51836fd6e213610c8cbf37e038f433 (patch)
tree924092fd6e68d21e563300078f6e8bc4af1c9628 /modutils
parenta0319ba936236433e6b8c3a96e890c3531effbc9 (diff)
downloadbusybox-f848305afc51836fd6e213610c8cbf37e038f433.tar.gz
modprobe: add scanning of /lib/modules/`uname -r`/modules.symbols
(by Yann E. MORIN)
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 3861dd1e3..fe399acfc 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -504,7 +504,7 @@ static struct dep_t *build_dep(void)
/* Only 2.6 has a modules.alias file */
if (ENABLE_FEATURE_2_6_MODULES) {
- /* Parse kernel-declared aliases */
+ /* Parse kernel-declared module aliases */
filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
fd = open(filename, O_RDONLY);
if (fd < 0) {
@@ -518,6 +518,21 @@ static struct dep_t *build_dep(void)
include_conf(&first, &current, buffer, sizeof(buffer), fd);
close(fd);
}
+
+ /* Parse kernel-declared symbol aliases */
+ filename = xasprintf("/lib/modules/%s/modules.symbols", un.release);
+ fd = open(filename, O_RDONLY);
+ if (fd < 0) {
+ /* Ok, that didn't work. Fall back to looking in /lib/modules */
+ fd = open("/lib/modules/modules.symbols", O_RDONLY);
+ }
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(filename);
+
+ if (fd >= 0) {
+ include_conf(&first, &current, buffer, sizeof(buffer), fd);
+ close(fd);
+ }
}
return first;