]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod, depmod: prefer -ENODATA over -ENOENT if no section found
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 19 May 2023 09:36:30 +0000 (12:36 +0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 30 May 2023 19:54:12 +0000 (12:54 -0700)
commit5c004af29daf38119cc472dc8f1f080f10da6d82
tree80ac5dfe49617c1c13f67d33c4793ae7d35036cf
parent116e7c7fc00e8565caf913399c38852975094a75
libkmod, depmod: prefer -ENODATA over -ENOENT if no section found

When the module is definitely present but CONFIG_MODVERSIONS is
disabled, the following error message may be somewhat confusing:

modprobe --dump-modversions /path/to/module.ko.xz
modprobe: FATAL: could not get modversions of /path/to/module.ko.xz: No such file or directory

Choosing among the convenient errno values, I would suggest to use
ENODATA when the module lacks a particular ELF section (and vermagic
as well). So now it is expected to be:

modprobe: FATAL: could not get modversions of /path/to/module.ko.xz: No data available

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://lore.kernel.org/r/20230519093630.474185-1-dmantipov@yandex.ru
libkmod/libkmod-elf.c
tools/depmod.c