summaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
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/modprobe.c
parenta0319ba936236433e6b8c3a96e890c3531effbc9 (diff)
downloadbusybox-w32-f848305afc51836fd6e213610c8cbf37e038f433.tar.gz
busybox-w32-f848305afc51836fd6e213610c8cbf37e038f433.tar.bz2
busybox-w32-f848305afc51836fd6e213610c8cbf37e038f433.zip
modprobe: add scanning of /lib/modules/`uname -r`/modules.symbols
(by Yann E. MORIN)
Diffstat (limited to 'modutils/modprobe.c')
-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)
504 504
505 /* Only 2.6 has a modules.alias file */ 505 /* Only 2.6 has a modules.alias file */
506 if (ENABLE_FEATURE_2_6_MODULES) { 506 if (ENABLE_FEATURE_2_6_MODULES) {
507 /* Parse kernel-declared aliases */ 507 /* Parse kernel-declared module aliases */
508 filename = xasprintf("/lib/modules/%s/modules.alias", un.release); 508 filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
509 fd = open(filename, O_RDONLY); 509 fd = open(filename, O_RDONLY);
510 if (fd < 0) { 510 if (fd < 0) {
@@ -518,6 +518,21 @@ static struct dep_t *build_dep(void)
518 include_conf(&first, &current, buffer, sizeof(buffer), fd); 518 include_conf(&first, &current, buffer, sizeof(buffer), fd);
519 close(fd); 519 close(fd);
520 } 520 }
521
522 /* Parse kernel-declared symbol aliases */
523 filename = xasprintf("/lib/modules/%s/modules.symbols", un.release);
524 fd = open(filename, O_RDONLY);
525 if (fd < 0) {
526 /* Ok, that didn't work. Fall back to looking in /lib/modules */
527 fd = open("/lib/modules/modules.symbols", O_RDONLY);
528 }
529 if (ENABLE_FEATURE_CLEAN_UP)
530 free(filename);
531
532 if (fd >= 0) {
533 include_conf(&first, &current, buffer, sizeof(buffer), fd);
534 close(fd);
535 }
521 } 536 }
522 537
523 return first; 538 return first;