aboutsummaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-27 10:55:34 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-27 10:55:34 +0000
commitb85fb693c149e6e574b4693c3abadfb554bb18dc (patch)
tree5a02d581d4235ec8d86f8122bca0dd21f55026e9 /modutils/modprobe.c
parent4fec3469668faf0022d32fc195c9451523219cb2 (diff)
downloadbusybox-w32-b85fb693c149e6e574b4693c3abadfb554bb18dc.tar.gz
busybox-w32-b85fb693c149e6e574b4693c3abadfb554bb18dc.tar.bz2
busybox-w32-b85fb693c149e6e574b4693c3abadfb554bb18dc.zip
- Add config option for DEFAULT_DEPMOD_FILE and DEFAULT_DEPMOD_FILE.
No obj-code changes.
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r--modutils/modprobe.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index b7903469d..3a89d9814 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -364,15 +364,15 @@ static struct dep_t *build_dep(void)
364 k_version = un.release[2] - '0'; 364 k_version = un.release[2] - '0';
365 } 365 }
366 366
367 filename = xasprintf("/lib/modules/%s/modules.dep", un.release); 367 filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%s/"CONFIG_DEFAULT_DEPMOD_FILE, un.release);
368 fd = open(filename, O_RDONLY); 368 fd = open(filename, O_RDONLY);
369 if (ENABLE_FEATURE_CLEAN_UP) 369 if (ENABLE_FEATURE_CLEAN_UP)
370 free(filename); 370 free(filename);
371 if (fd < 0) { 371 if (fd < 0) {
372 /* Ok, that didn't work. Fall back to looking in /lib/modules */ 372 /* Ok, that didn't work. Fall back to looking in /lib/modules */
373 fd = open("/lib/modules/modules.dep", O_RDONLY); 373 fd = open(CONFIG_DEFAULT_MODULES_DIR"/"CONFIG_DEFAULT_DEPMOD_FILE, O_RDONLY);
374 if (fd < 0) { 374 if (fd < 0) {
375 bb_error_msg_and_die("cannot parse modules.dep"); 375 bb_error_msg_and_die("cannot parse " CONFIG_DEFAULT_DEPMOD_FILE);
376 } 376 }
377 } 377 }
378 378
@@ -522,11 +522,11 @@ static struct dep_t *build_dep(void)
522 /* Only 2.6 has a modules.alias file */ 522 /* Only 2.6 has a modules.alias file */
523 if (ENABLE_FEATURE_2_6_MODULES) { 523 if (ENABLE_FEATURE_2_6_MODULES) {
524 /* Parse kernel-declared module aliases */ 524 /* Parse kernel-declared module aliases */
525 filename = xasprintf("/lib/modules/%s/modules.alias", un.release); 525 filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%s/modules.alias", un.release);
526 fd = open(filename, O_RDONLY); 526 fd = open(filename, O_RDONLY);
527 if (fd < 0) { 527 if (fd < 0) {
528 /* Ok, that didn't work. Fall back to looking in /lib/modules */ 528 /* Ok, that didn't work. Fall back to looking in /lib/modules */
529 fd = open("/lib/modules/modules.alias", O_RDONLY); 529 fd = open(CONFIG_DEFAULT_MODULES_DIR"/modules.alias", O_RDONLY);
530 } 530 }
531 if (ENABLE_FEATURE_CLEAN_UP) 531 if (ENABLE_FEATURE_CLEAN_UP)
532 free(filename); 532 free(filename);
@@ -537,11 +537,11 @@ static struct dep_t *build_dep(void)
537 } 537 }
538 538
539 /* Parse kernel-declared symbol aliases */ 539 /* Parse kernel-declared symbol aliases */
540 filename = xasprintf("/lib/modules/%s/modules.symbols", un.release); 540 filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%s/modules.symbols", un.release);
541 fd = open(filename, O_RDONLY); 541 fd = open(filename, O_RDONLY);
542 if (fd < 0) { 542 if (fd < 0) {
543 /* Ok, that didn't work. Fall back to looking in /lib/modules */ 543 /* Ok, that didn't work. Fall back to looking in /lib/modules */
544 fd = open("/lib/modules/modules.symbols", O_RDONLY); 544 fd = open(CONFIG_DEFAULT_MODULES_DIR"/modules.symbols", O_RDONLY);
545 } 545 }
546 if (ENABLE_FEATURE_CLEAN_UP) 546 if (ENABLE_FEATURE_CLEAN_UP)
547 free(filename); 547 free(filename);
@@ -895,7 +895,7 @@ int modprobe_main(int argc, char **argv)
895 depend = build_dep(); 895 depend = build_dep();
896 896
897 if (!depend) 897 if (!depend)
898 bb_error_msg_and_die("cannot parse modules.dep"); 898 bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
899 899
900 if (remove_opt) { 900 if (remove_opt) {
901 do { 901 do {