+ {
+ dep_lst_t *mods = G.lst;
+
+ /* Fixup the module names in the depends list */
+ while (mods) {
+ llist_t *deps = NULL, *old_deps = mods->dependencies;
+
+ while (old_deps) {
+ dep_lst_t *all = G.lst;
+ char *longname = NULL;
+ char *shortname = llist_pop(&old_deps);
+
+ while (all) {
+ char *nam =
+ xstrdup(bb_get_last_path_component_nostrip(all->name));
+ char *tmp = strrstr(nam, ".ko");
+
+ *tmp = '\0';
+ if (!strcmp(nam, shortname)) {
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(nam);
+ longname = all->name;
+ break;
+ }
+ free(nam);
+ all = all->next;
+ }
+ llist_add_to_end(&deps, longname);
+ }
+ mods->dependencies = deps;
+ mods = mods->next;
+ }
+
+#if ENABLE_FEATURE_DEPMOD_PRUNE_FANCY