diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c index 485143a58a..15c75b389e 100644 --- a/src/install/dracut-install.c +++ b/src/install/dracut-install.c @@ -1639,6 +1639,7 @@ static int install_dependent_module(struct kmod_ctx *ctx, struct kmod_module *mo _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; _cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL; _cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL; + _cleanup_kmod_module_unref_list_ struct kmod_list *modweak = NULL; log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]); install_firmware(mod); modlist = kmod_module_get_dependencies(mod); @@ -1651,6 +1652,9 @@ static int install_dependent_module(struct kmod_ctx *ctx, struct kmod_module *mo r = install_dependent_modules(ctx, modpost, NULL); *err = *err ? : r; } + *err = kmod_module_get_weakdeps(mod, &modweak); + if (*err == 0) + *err = install_dependent_modules(ctx, modweak, NULL); } } else { log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]); @@ -1710,6 +1714,7 @@ static int install_module(struct kmod_ctx *ctx, struct kmod_module *mod) _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; _cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL; _cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL; + _cleanup_kmod_module_unref_list_ struct kmod_list *modweak = NULL; const char *path = NULL; const char *name = NULL; @@ -1766,6 +1771,9 @@ static int install_module(struct kmod_ctx *ctx, struct kmod_module *mod) r = install_dependent_modules(ctx, modpost, NULL); ret = ret ? : r; } + ret = kmod_module_get_weakdeps(mod, &modweak); + if (ret == 0) + ret = install_dependent_modules(ctx, modweak, NULL); } return ret;