]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(install): handle builtin modules
authorHarald Hoyer <harald@redhat.com>
Fri, 19 Mar 2021 09:59:21 +0000 (10:59 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 30 Mar 2021 08:27:02 +0000 (10:27 +0200)
If a `kmod_module` is missing the `path`, it is `builtin`.

install/dracut-install.c

index f1203070847c9a8367331dc9ef168f49967b0e2b..495ed2f1dc0218e3c714e5fb8360ec034ea390d8 100644 (file)
@@ -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;