libkmod: Prefer builtin index over builtin.alias

The modules.builtin.alias.bin is way larger than the
modules.builtin.bin.  On a normal "distro kernel":

	21k modules.builtin.alias.bin
	11k modules.builtin.bin

From the kernel we get both modules.builtin and modules.builtin.modinfo.
depmod generates modules.builtin.bin and modules.builtin.alias.bin
from them respectively. modules.bultin is not going away: it's not
deprecated by the new index added. So, let's just stop duplicating the
information inside modules.builtin.alias.bin and just use the other
index.
This commit is contained in:
Lucas De Marchi 2022-02-09 18:21:03 -08:00
parent 4e391ac92d
commit a965641625

View File

@ -576,13 +576,15 @@ 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);
CHECK_ERR_AND_FINISH(err, fail, list, finish);
DBG(ctx, "lookup modules.builtin.modinfo %s\n", alias);
err = kmod_lookup_alias_from_kernel_builtin_file(ctx, alias, list);
if (err == -ENOSYS) {
/* Optional index missing, try the old one */
DBG(ctx, "lookup modules.builtin %s\n", alias);
err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);
}
/* Optional index missing, ignore */
if (err == -ENOSYS)
err = 0;
CHECK_ERR_AND_FINISH(err, fail, list, finish);