aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-06-20 09:57:30 +0000
committerEric Andersen <andersen@codepoet.org>2003-06-20 09:57:30 +0000
commit25ea42de9bb947193ac759e7bef6067ddf9c77ad (patch)
tree2f6964ffa656ba3dd203b83e25da8c74fb1cedf6 /modutils
parent908e362133ed337f6adace218a236ff2bcf345ca (diff)
downloadbusybox-25ea42de9bb947193ac759e7bef6067ddf9c77ad.tar.gz
Fall back to looking in /lib/modules/modules.dep if
/lib/modules/<kernel version>/modules.dep is missing
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 13f17b869..b4bff5100 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -128,8 +128,13 @@ static struct dep_t *build_dep ( void )
strcat ( filename, un.release );
strcat ( filename, "/modules.dep" );
- if (( fd = open ( filename, O_RDONLY )) < 0 )
- return 0;
+ if (( fd = open ( filename, O_RDONLY )) < 0 ) {
+
+ /* Ok, that didn't work. Fall back to looking in /lib/modules */
+ if (( fd = open ( "/lib/modules/modules.dep", O_RDONLY )) < 0 ) {
+ return 0;
+ }
+ }
while ( reads ( fd, buffer, sizeof( buffer ))) {
int l = bb_strlen ( buffer );