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.
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.
Install and remove commands are now properly treated on lookup. Example
config file:
$ ./test/test-lookup installme
libkmod version 1
Alias: 'installme'
Modules matching:
installme
install commands: 'echo "this is a install message"'
$ ./test/test-lookup removeme
libkmod version 1
Alias: 'removeme'
Modules matching:
removeme
remove commands: 'echo "this is a remove message"'
1 alias may correspond to more than 1 module. This would cause a
conflict in the hash table when inserting a module there and bad things
could happen.
Now we use 'modname/aliasname' as key, '/aliasname' part being optional.
Internally kmod_module_new_from_alias() will setup a 'modname/aliasname'
string and pass to kmod_module_new_from_name() that will treat the case
with a '/' in the name.
User might call kmod_module_new_from_name() without any slashes, so the
key my not contain it.
Lines should not go over 80 chars with a few exceptions:
- headers
- function definitions with only 1 argument
- long strings, otherwise we break grep
This should go later in a coding-style file
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.