return true;
}
-static bool check_module_hostonly(struct kmod_module *mod)
-{
- const char *name = kmod_module_get_name(mod);
-
- if (check_hashmap(modules_loaded, name))
- return true;
-
- return false;
-}
-
static int install_module(struct kmod_module *mod)
{
int ret = 0;
return 0;
}
- if (arg_hostonly && ! check_module_hostonly(mod)) {
+ if (arg_hostonly && !check_hashmap(modules_loaded, name)) {
log_debug("dracut_install '%s' not hostonly", name);
return 0;
}
while (!feof(f)) {
size_t len;
+ char *dupname = NULL;
if(!(fgets(name, sizeof(name), f)))
continue;
if (name[len-1] == '\n')
name[len-1] = 0;
- hashmap_put(modules_loaded, name, strdup(name));
+ log_debug("Adding module '%s' to hostonly module list", name);
+ dupname = strdup(name);
+ hashmap_put(modules_loaded, dupname, dupname);
}
}
}