+ module_info **first = (module_info **) data;
+ char *image, *ptr;
+ module_info *info;
+ size_t len = sb->st_size;
+
+ if (strrstr(fname, ".ko") == NULL)
+ return TRUE;
+
+ image = xmalloc_open_zipped_read_close(fname, &len);
+ info = xzalloc(sizeof(module_info));
+
+ info->next = *first;
+ *first = info;
+
+ info->dnext = info->dprev = info;
+ info->name = xstrdup(fname);
+ info->modname = filename2modname(fname, NULL);
+ for (ptr = image; ptr < image + len - 10; ptr++) {
+ if (strncmp(ptr, "depends=", 8) == 0) {
+ char *u;
+
+ ptr += 8;
+ for (u = ptr; *u; u++)
+ if (*u == '-')
+ *u = '_';
+ ptr += string_to_llist(ptr, &info->dependencies, ",");
+ } else if (ENABLE_FEATURE_MODUTILS_ALIAS &&
+ strncmp(ptr, "alias=", 6) == 0) {
+ llist_add_to(&info->aliases, xstrdup(ptr + 6));
+ ptr += strlen(ptr);
+ } else if (ENABLE_FEATURE_MODUTILS_SYMBOLS &&
+ strncmp(ptr, "__ksymtab_", 10) == 0) {
+ ptr += 10;
+ if (strncmp(ptr, "gpl", 3) == 0 ||
+ strcmp(ptr, "strings") == 0)
+ continue;
+ llist_add_to(&info->symbols, xstrdup(ptr));
+ ptr += strlen(ptr);
+ }
+ }
+ free(image);
+