kmod/tools
Dan McGee a23f0c9c55 modinfo: handle arguments more carefully
A simple case of breakage before this commit:

    $ touch aes
    $ modinfo aes
    filename:       /tmp/aes
    ERROR: could not get modinfo from 'aes': Invalid argument

Add a new is_module_filename() function that attempts to do more than
just check if the passed argument is a regular file. We look at the name
for a '.ko' string, and if that is found, ensure it is either at the end
of the string or followed by another '.' (for .gz and .xz modules, for
instance). We don't make this second option conditional on the way the
tools are built with compression support; the file is a module file
regardless and should always be treated that way.

When doing this, and noticed in the test suite output, we open the
system modules index unconditionally, even if it is never going to be
used during the modinfo call, which is the case when passing module
filenames directly. For only one module there's not much advantage in
pre-loading the index, so just remove the call to kmod_load_resources().

With-help-from: Dave Reisner <dreisner@archlinux.org>
[lucas.demarchi@profusion.mobi: remove call to kmod_load_resources()]
2012-02-06 20:29:08 -02:00
..
.gitignore Update .gitignore files 2012-02-05 02:15:20 -02:00
kmod-depmod.c depmod: Dont use errno unconditionally 2012-02-03 14:52:59 -02:00
kmod-insmod.c Update copyright 2012-01-09 00:41:07 -02:00
kmod-lsmod.c Update copyright 2012-01-09 00:41:07 -02:00
kmod-modinfo.c modinfo: handle arguments more carefully 2012-02-06 20:29:08 -02:00
kmod-modprobe.c libkmod-module: probe: rename flag to be more meaningful 2012-02-06 12:46:39 -02:00
kmod-rmmod.c rmmod: behavior more like m-i-t's rmmod 2012-01-10 22:35:18 -05:00
kmod.c Update copyright 2012-01-09 00:41:07 -02:00
kmod.h Update copyright 2012-01-09 00:41:07 -02:00