Commit Graph

22 Commits

Author SHA1 Message Date
Lucas De Marchi 3e8de63d2d kmod_modprobe: use basename(argv[0]) in help message 2011-12-23 01:36:27 -02:00
Gustavo Sverzut Barbieri 5f9f58f9f6 kmod-modprobe: fix leak in command line option processing.
not that it should matter for the binary, but let's be strict with
leaks so running in valgrind never complains.
2011-12-23 01:25:21 -02:00
Lucas De Marchi 2c96693eb2 kmod_modprobe: fix description of -C flag 2011-12-20 16:39:59 -02:00
Kay Sievers a308abec37 introduce --with-rootprefix=DIR
Configure the location of the rootfs directories and use it
to find (/usr)/lib/modules and (/usr)/lib/modprobe.d.
2011-12-20 16:22:07 -02:00
Lucas De Marchi 95dd837daf kmod_modprobe: Fix regression when inserting module
Commit "e5e2a68 kmod_modprobe: properly handle install/remove commands"
introduced a regression that, while it worked for install/remove
commands, it ceased to work for normal module names. Move the check for
whether it's a install command or a module so both cases work.
2011-12-20 13:11:33 -02:00
Gustavo Sverzut Barbieri b014c490cb kmod-modinfo: -p (-F parm) shows also parmtype in Debian expected formatting.
debian expected formatting is:

    name:description (type)

variants:

    name:description
    name: (type)
2011-12-19 18:32:58 -02:00
Gustavo Sverzut Barbieri 515ec7960b kmod-modinfo: fix typo and output format.
* it's parm, not param (does not have the second 'a');
 * output format requires ':' after the name.
2011-12-19 18:32:58 -02:00
Gustavo Sverzut Barbieri 022e1f0e0d kmod-modinfo: add missing short options.
Thanks to falconindy for testing.
2011-12-19 18:32:58 -02:00
Gustavo Sverzut Barbieri 0cc3ccfd52 Introduce kmod-modinfo. 2011-12-19 15:06:49 -02:00
Gustavo Sverzut Barbieri ab70dce181 kmod-modprobe: improve --help output. 2011-12-19 15:06:49 -02:00
Gustavo Sverzut Barbieri 0e3e2f436e kmod-modprobe: implement --dump-modversions 2011-12-19 15:06:49 -02:00
Lucas De Marchi e5e2a683f7 kmod_modprobe: properly handle install/remove commands
Handle install/remove commands just like modprobe does. Test configure
file:

install installme echo "this is a install message"
remove  removeme echo "this is a remove message"

Tests:

$ ./tools/kmod-modprobe installme
this is a install message

$ ./tools/kmod-modprobe -r removeme
this is a remove message

$ ./tools/kmod-modprobe removeme
FATAL: Module removeme not found.

./tools/kmod-modprobe -r installme
FATAL: Module installme not found.
2011-12-19 12:17:44 -02:00
Lucas De Marchi 9bf60d21f3 kmod_modprobe: fix handling of remove commands
The check for remove/install commands must be before the ignore_loaded
check because we will actually run something instead of
removing/inserting a module and the modname might not correspond to a
real module. Otherwise a fake module like "remove removeme echo 'bla'"
would not work.

This also keeps compatibility with modprobe.
2011-12-19 09:35:43 -02:00
Gustavo Sverzut Barbieri e793f1eae9 kmod-modprobe: implement softdeps.
Implement soft dependencies in a way similar to module-init-tools
modprobe. Unlike regular dependencies they are allowed to fail
inserting or removing.

The rmmod version walks the lists in reverse order, also doing post
before and pre later.
2011-12-17 20:03:44 -02:00
Lucas De Marchi 8122985dbb tools: fix kmod-modprobe -R trying to insert module 2011-12-16 02:58:48 -02:00
Lucas De Marchi cb451f35d9 Change licenses
libkmod is under LGPL 2.1 or later
tools/* are under GPL
2011-12-12 18:24:35 -02:00
Lucas De Marchi 45f2778174 Remove warnings: ‘err’ may be used uninitialized in this function 2011-12-12 17:23:04 -02:00
Lucas De Marchi 2411c07794 Do not use config if it's not needed/wanted 2011-12-12 15:41:02 -02:00
Lucas De Marchi a102e262e6 Rename kmod_loaded_get_list() to kmod_module_new_from_loaded()
Be consistent with other similar functions already present and improve
documentation.
2011-12-12 13:50:19 -02:00
Gustavo Sverzut Barbieri cb8d4d3e99 API-BREAK: kmod_new() takes a second parameter for configuration directory.
This is required by modprobe and also to help doing unit tests in future.
2011-12-11 20:58:22 -02:00
Gustavo Sverzut Barbieri c3d0a5f2ef tools: add modprobe
try to mimic original module-init-tools' modprobe as much as possible,
but this exposed some missing features in libkmod, these are now
listed in TODO.
2011-12-11 20:58:22 -02:00
Gustavo Sverzut Barbieri 72c51a9e4d add lsmod, insmod and rmmod tools.
these tools are compatible with module-init-tools (except insmod does
not take data from stdin).
2011-12-11 20:58:22 -02:00