From: Lucas De Marchi Date: Tue, 10 Mar 2020 05:00:28 +0000 (-0700) Subject: libkmod: allow modules.alias.builtin to be optional X-Git-Tag: v28~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8d1d54051053d770643b59c3f5cf5608a17a0ce;p=thirdparty%2Fkmod.git libkmod: allow modules.alias.builtin to be optional --- diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index ab5c1e84..43423d63 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)