From 2536a9eaffbc9cc14c85579a2f537d3f3a1d5659 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Mar 2021 10:59:21 +0100 Subject: [PATCH] fix(install): handle builtin modules If a `kmod_module` is missing the `path`, it is `builtin`. --- install/dracut-install.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install/dracut-install.c b/install/dracut-install.c index f120307084..495ed2f1dc 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -1572,6 +1572,13 @@ static int install_module(struct kmod_module *mod) const char *name = NULL; name = kmod_module_get_name(mod); + + path = kmod_module_get_path(mod); + if (!path) { + log_debug("dracut_install '%s' is a builtin kernel module", name); + return 0; + } + if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) { log_debug("dracut_install '%s' is excluded", name); return 0; @@ -1582,10 +1589,6 @@ static int install_module(struct kmod_module *mod) return 0; } - path = kmod_module_get_path(mod); - if (!path) - return -ENOENT; - if (check_hashmap(items_failed, path)) return -1;