summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2020-03-09 22:00:28 -0700
committerLucas De Marchi <lucas.demarchi@intel.com>2020-03-23 12:37:51 -0700
commitd8d1d54051053d770643b59c3f5cf5608a17a0ce (patch)
tree9ef2628f922241ffa517ac22c0f56f6b082f12c4
parent3bd7187ff549a2ef2441dcddabf382cc53cf6f22 (diff)
downloadkmod-d8d1d54051053d770643b59c3f5cf5608a17a0ce.tar.gz
kmod-d8d1d54051053d770643b59c3f5cf5608a17a0ce.tar.bz2
kmod-d8d1d54051053d770643b59c3f5cf5608a17a0ce.zip
libkmod: allow modules.alias.builtin to be optional
-rw-r--r--libkmod/libkmod.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index ab5c1e8..43423d6 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -855,8 +855,8 @@ KMOD_EXPORT int kmod_validate_resources(struct kmod_ctx *ctx)
*/
KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx)
{
+ int ret = 0;
size_t i;
- int ret;
if (ctx == NULL)
return -ENOENT;
@@ -874,8 +874,17 @@ KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx)
index_files[i].fn);
ret = index_mm_open(ctx, path, &ctx->indexes_stamp[i],
&ctx->indexes[i]);
- if (ret)
- break;
+
+ /*
+ * modules.builtin.alias are considered optional since it's
+ * recently added and older installations may not have it;
+ * we allow failing for any reason
+ */
+ if (ret) {
+ if (i != KMOD_INDEX_MODULES_BUILTIN_ALIAS)
+ break;
+ ret = 0;
+ }
}
if (ret)