summaryrefslogtreecommitdiff
path: root/libkmod/libkmod-module.c
diff options
context:
space:
mode:
authorAlexey Gladkov <gladkov.alexey@gmail.com>2019-11-08 18:25:22 +0100
committerLucas De Marchi <lucas.demarchi@intel.com>2019-12-18 16:56:58 -0800
commitb866b2165ae6cf18fb26b635f4a7ee57c0334731 (patch)
treeba634e5ce071c1e3b6d7dec08c20e60421f1962d /libkmod/libkmod-module.c
parent73eed2aba3cbe18bbda40f18f7bc32e8de1ec81f (diff)
downloadkmod-b866b2165ae6cf18fb26b635f4a7ee57c0334731.tar.gz
kmod-b866b2165ae6cf18fb26b635f4a7ee57c0334731.tar.bz2
kmod-b866b2165ae6cf18fb26b635f4a7ee57c0334731.zip
Lookup aliases in the modules.builtin.modinfo
New modules.builtin.modinfo duplicates modules.builtin in the built-in module name search. If it exists, then we can use this file, but if not, then we need to fallback to the old file. Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Diffstat (limited to 'libkmod/libkmod-module.c')
-rw-r--r--libkmod/libkmod-module.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 8fbabd2..ee7e6bd 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -575,10 +575,16 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
err = kmod_lookup_alias_from_aliases_file(ctx, alias, list);
CHECK_ERR_AND_FINISH(err, fail, list, finish);
- DBG(ctx, "lookup modules.builtin %s\n", alias);
- err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);
+ DBG(ctx, "lookup modules.builtin.modinfo %s\n", alias);
+ err = kmod_lookup_alias_from_kernel_builtin_file(ctx, alias, list);
CHECK_ERR_AND_FINISH(err, fail, list, finish);
+ if (err == 0) {
+ DBG(ctx, "lookup modules.builtin %s\n", alias);
+ err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);
+ CHECK_ERR_AND_FINISH(err, fail, list, finish);
+ }
+
finish:
DBG(ctx, "lookup %s=%d, list=%p\n", alias, err, *list);
return err;