No obj-code changes.
buffer drivers etc.
comment "Options common to multiple modutils"
- depends on INSMOD || RMMOD || MODPROBE || LSMOD
+ depends on INSMOD || RMMOD || MODPROBE || LSMOD || DEPMOD
config FEATURE_CHECK_TAINTED_MODULE
# Simulate indentation
help
Support module loading for newer 2.6.x Linux kernels.
+config DEFAULT_MODULES_DIR
+ # Simulate indentation
+ string "default directory containing modules"
+ default "/lib/modules"
+ depends on INSMOD || RMMOD || MODPROBE || DEPMOD
+ help
+ Directory that contains kernel modules.
+ Defaults to "/lib/modules"
+
+config DEFAULT_DEPMOD_FILE
+ # Simulate indentation
+ string "default name of modules.dep"
+ default "modules.dep"
+ depends on INSMOD || RMMOD || MODPROBE || DEPMOD
+ help
+ Filename that contains kernel modules dependencies.
+ Defaults to "modules.dep"
config FEATURE_QUERY_MODULE_INTERFACE
bool
#include <libbb.h>
#include <sys/utsname.h> /* uname() */
-#ifndef DEFAULT_MODULES_DIR
-#define DEFAULT_MODULES_DIR "/lib/modules"
-#endif
-#ifndef DEFAULT_DEPMOD_FILE
-#define DEFAULT_DEPMOD_FILE "modules.dep"
-#endif
/*
* Theory of operation:
* - iterate over all modules and record their full path
/* if no modules are given on the command-line, -a is on per default */
option_mask32 |= *argv == NULL;
- moddir = concat_path_file(DEFAULT_MODULES_DIR, chp);
+ moddir = concat_path_file(CONFIG_DEFAULT_MODULES_DIR, chp);
// if (ENABLE_FEATURE_CLEAN_UP)
// free(chp);
if (option_mask32 & ARG_b) {
}
if (!(option_mask32 & ARG_n)) { /* --dry-run */
- chp = concat_path_file(moddir, DEFAULT_DEPMOD_FILE);
+ chp = concat_path_file(moddir, CONFIG_DEFAULT_DEPMOD_FILE);
filedes = xfopen(chp, "w");
if (ENABLE_FEATURE_CLEAN_UP)
free(chp);
#define SPFX ""
#endif
-
-#define _PATH_MODULES "/lib/modules"
enum { STRVERSIONLEN = 64 };
/*======================================================================*/
char *module_dir;
char *tmdn;
- tmdn = concat_path_file(_PATH_MODULES, myuname.release);
+ tmdn = concat_path_file(CONFIG_DEFAULT_MODULES_DIR, myuname.release);
/* Jump through hoops in case /lib/modules/`uname -r`
* is a symlink. We do not want recursive_action to
* follow symlinks, but we do want to follow the
free(m_filename);
m_filename = NULL;
- module_dir = xmalloc_readlink(_PATH_MODULES);
+ module_dir = xmalloc_readlink(CONFIG_DEFAULT_MODULES_DIR);
if (!module_dir)
- module_dir = xstrdup(_PATH_MODULES);
+ module_dir = xstrdup(CONFIG_DEFAULT_MODULES_DIR);
/* No module found under /lib/modules/`uname -r`, this
* time cast the net a bit wider. Search /lib/modules/ */
r = recursive_action(module_dir, ACTION_RECURSE,
k_version = un.release[2] - '0';
}
- filename = xasprintf("/lib/modules/%s/modules.dep", un.release);
+ filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%s/"CONFIG_DEFAULT_DEPMOD_FILE, un.release);
fd = open(filename, O_RDONLY);
if (ENABLE_FEATURE_CLEAN_UP)
free(filename);
if (fd < 0) {
/* Ok, that didn't work. Fall back to looking in /lib/modules */
- fd = open("/lib/modules/modules.dep", O_RDONLY);
+ fd = open(CONFIG_DEFAULT_MODULES_DIR"/"CONFIG_DEFAULT_DEPMOD_FILE, O_RDONLY);
if (fd < 0) {
- bb_error_msg_and_die("cannot parse modules.dep");
+ bb_error_msg_and_die("cannot parse " CONFIG_DEFAULT_DEPMOD_FILE);
}
}
/* Only 2.6 has a modules.alias file */
if (ENABLE_FEATURE_2_6_MODULES) {
/* Parse kernel-declared module aliases */
- filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
+ filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%s/modules.alias", 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.alias", O_RDONLY);
+ fd = open(CONFIG_DEFAULT_MODULES_DIR"/modules.alias", O_RDONLY);
}
if (ENABLE_FEATURE_CLEAN_UP)
free(filename);
}
/* Parse kernel-declared symbol aliases */
- filename = xasprintf("/lib/modules/%s/modules.symbols", un.release);
+ filename = xasprintf(CONFIG_DEFAULT_MODULES_DIR"/%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);
+ fd = open(CONFIG_DEFAULT_MODULES_DIR"/modules.symbols", O_RDONLY);
}
if (ENABLE_FEATURE_CLEAN_UP)
free(filename);
depend = build_dep();
if (!depend)
- bb_error_msg_and_die("cannot parse modules.dep");
+ bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
if (remove_opt) {
do {