]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut-install): install all suppliers of a supplier's module
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Mon, 3 Jun 2024 08:03:32 +0000 (11:03 +0300)
committerLaszlo <laszlo.gombos@gmail.com>
Sun, 18 May 2025 10:43:16 +0000 (06:43 -0400)
After installing a module, we get its dependencies and suppliers' paths,
and recurse into two functions that handle installing those. The code
handling a supplier path tries to also handle suppliers-of-suppliers
relations. But when installing a supplier's module, it only recurses to
suppliers for that specific device provided by the module.

Having a subset of its suppliers might not be enough for a module to
work correctly. Recurse into all suppliers of the supplier modules we
are installing.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
src/install/dracut-install.c

index e9db63e5b446980f64f04aaa61db649ea7d6099f..be750a014b5a1a652492947b66d33bc351735425 100644 (file)
@@ -2369,20 +2369,20 @@ static int install_dependent_modules(struct kmod_ctx *ctx, struct kmod_list *mod
                 _cleanup_destroy_hashmap_ Hashmap *modules = hashmap_new(string_hash_func, string_compare_func);
                 find_modules_from_sysfs_node(ctx, supplier_path, modules);
 
-                _cleanup_destroy_hashmap_ Hashmap *suppliers = hashmap_new(string_hash_func, string_compare_func);
-                find_suppliers_for_sys_node(suppliers, supplier_path, strlen(supplier_path));
-
                 if (!hashmap_isempty(modules)) { // Supplier is a module
                         const char *module;
                         Iterator j;
                         HASHMAP_FOREACH(module, modules, j) {
                                 _cleanup_kmod_module_unref_ struct kmod_module *mod = NULL;
                                 if (!kmod_module_new_from_name(ctx, module, &mod)) {
+                                        Hashmap *suppliers = find_suppliers_paths_for_module(kmod_module_get_name(mod));
                                         if (install_dependent_module(ctx, mod, suppliers, &ret))
                                                 return -1;
                                 }
                         }
                 } else { // Supplier is builtin
+                        _cleanup_destroy_hashmap_ Hashmap *suppliers = hashmap_new(string_hash_func, string_compare_func);
+                        find_suppliers_for_sys_node(suppliers, supplier_path, strlen(supplier_path));
                         install_dependent_modules(ctx, NULL, suppliers);
                 }
         }