mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
Patch from Yann Morin to look for modules.conf in the right place on 2.6.
Fixes http://bugs.busybox.net/view.php?id=942
This commit is contained in:
parent
3e4da920bd
commit
3b0cfb40a5
@ -545,28 +545,36 @@ static struct dep_t *build_dep ( void )
|
|||||||
}
|
}
|
||||||
close ( fd );
|
close ( fd );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* First parse system-specific options and aliases
|
||||||
|
* as they take precedence over the kernel ones.
|
||||||
|
*/
|
||||||
if (!ENABLE_FEATURE_2_6_MODULES
|
if (!ENABLE_FEATURE_2_6_MODULES
|
||||||
|| ( fd = open ( "/etc/modprobe.conf", O_RDONLY )) < 0 )
|
|| ( fd = open ( "/etc/modprobe.conf", O_RDONLY )) < 0 )
|
||||||
if (( fd = open ( "/etc/modules.conf", O_RDONLY )) < 0 )
|
if (( fd = open ( "/etc/modules.conf", O_RDONLY )) < 0 )
|
||||||
if (( fd = open ( "/etc/conf.modules", O_RDONLY )) < 0 )
|
fd = open ( "/etc/conf.modules", O_RDONLY );
|
||||||
return first;
|
|
||||||
|
|
||||||
|
if (fd >= 0) {
|
||||||
include_conf (&first, ¤t, buffer, sizeof(buffer), fd);
|
include_conf (&first, ¤t, buffer, sizeof(buffer), fd);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only 2.6 has a modules.alias file */
|
||||||
|
if (ENABLE_FEATURE_2_6_MODULES) {
|
||||||
|
/* Parse kernel-declared aliases */
|
||||||
filename = bb_xasprintf("/lib/modules/%s/modules.alias", un.release);
|
filename = bb_xasprintf("/lib/modules/%s/modules.alias", un.release);
|
||||||
fd = open ( filename, O_RDONLY );
|
if ((fd = open ( filename, O_RDONLY )) < 0) {
|
||||||
|
/* Ok, that didn't work. Fall back to looking in /lib/modules */
|
||||||
|
fd = open ( "/lib/modules/modules.alias", O_RDONLY );
|
||||||
|
}
|
||||||
if (ENABLE_FEATURE_CLEAN_UP)
|
if (ENABLE_FEATURE_CLEAN_UP)
|
||||||
free(filename);
|
free(filename);
|
||||||
if (fd < 0) {
|
|
||||||
/* Ok, that didn't work. Fall back to looking in /lib/modules */
|
|
||||||
if (( fd = open ( "/lib/modules/modules.alias", O_RDONLY )) < 0 ) {
|
|
||||||
return first;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (fd >= 0) {
|
||||||
include_conf (&first, ¤t, buffer, sizeof(buffer), fd);
|
include_conf (&first, ¤t, buffer, sizeof(buffer), fd);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user