aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
Diffstat (limited to 'modutils')
-rw-r--r--modutils/depmod.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/modutils/depmod.c b/modutils/depmod.c
index aa228ec85..a41b3e440 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -51,7 +51,11 @@ static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARA
info->dnext = info->dprev = info;
info->name = xstrdup(fname + 2); /* skip "./" */
- info->modname = xstrdup(filename2modname(fname, modname));
+ info->modname = xstrdup(
+ filename2modname(
+ bb_get_last_path_component_nostrip(fname),
+ modname
+ ));
for (ptr = image; ptr < image + len - 10; ptr++) {
if (strncmp(ptr, "depends=", 8) == 0) {
char *u;
@@ -242,17 +246,18 @@ int depmod_main(int argc UNUSED_PARAM, char **argv)
if (!(option_mask32 & OPT_n))
xfreopen_write("modules.alias", stdout);
for (m = modules; m != NULL; m = m->next) {
+ char modname[MODULE_NAME_LEN];
const char *fname = bb_basename(m->name);
- int fnlen = strchrnul(fname, '.') - fname;
+ filename2modname(fname, modname);
while (m->aliases) {
/* Last word can well be m->modname instead,
* but depmod from module-init-tools 3.4
* uses module basename, i.e., no s/-/_/g.
* (pathname and .ko.* are still stripped)
* Mimicking that... */
- printf("alias %s %.*s\n",
+ printf("alias %s %s\n",
(char*)llist_pop(&m->aliases),
- fnlen, fname);
+ modname);
}
}
#endif
@@ -260,12 +265,13 @@ int depmod_main(int argc UNUSED_PARAM, char **argv)
if (!(option_mask32 & OPT_n))
xfreopen_write("modules.symbols", stdout);
for (m = modules; m != NULL; m = m->next) {
+ char modname[MODULE_NAME_LEN];
const char *fname = bb_basename(m->name);
- int fnlen = strchrnul(fname, '.') - fname;
+ filename2modname(fname, modname);
while (m->symbols) {
- printf("alias symbol:%s %.*s\n",
+ printf("alias symbol:%s %s\n",
(char*)llist_pop(&m->symbols),
- fnlen, fname);
+ modname);
}
}
#endif