Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Remove function kmod_resolve_alias_options since it's not needed
anymore. Test is using the following configuration file:
alias blablabla ac
options ac test=1
options blablabla test=2
Lookup test by module name:
$ ./test/test-lookup ac
libkmod version 1
Alias: 'ac'
Modules matching:
ac
options: 'test=1'
Lookup test by alias:
$ ./test/test-lookup blablabla
libkmod version 1
Alias: 'blablabla'
Modules matching:
ac
options: 'test=1 test=2'
|
|
libkmod is under LGPL 2.1 or later
tools/* are under GPL
|
|
Be consistent with other similar functions already present and improve
documentation.
|
|
This is required by modprobe and also to help doing unit tests in future.
|
|
|
|
This will be required to implement modprobe later. The implementation
follows "man modprobe.conf" and allows options to be specified for
alias as well, thus the need for kmod_resolve_alias_options().
Example mod-a.conf:
options mod-a a=1 b=2
options mod-a c=3
alias mymod-a mod-a
options mymod-a d=4
Results in:
options mod-a a=1 b=2 c=3
options mymod-a a=1 b=2 c=3 d=4
Install commands are being concatenated with ";", but manpage is not
clean about this behavior.
|
|
This call will mmap all the index files and in future some of the work
done in ctx creation can be put here.
|
|
This will be the most common use case for logging, also changed
log_stderr() to log_filep() with data being stderr to test it.
|
|
This function will filter the given list against the known blacklist,
returning a new list with remaining modules with the reference
incremented.
|
|
kmod_module_get_dependency is renamed to kmod_module_get_dependencies
since it's returning a list. To match other APIs, now it returns a new
list that user must free with kmod_module_unref_list().
|
|
|
|
kmod_loaded_get_list() now returns a regular list of kmod_modules, use
kmod_module_get_module(), kmod_module_unref() and
kmod_module_unref_list() to operate on it.
|
|
provide means to get:
* refcount
* initstate
* holders
* sections
this can be used to individually query properties from modules,
similar to /proc/modules (kmod_loaded / kmod_loaded_module).
|
|
|
|
functions that do not modify their parameters get them as const pointers.
special cases:
* kmod_get_userdata/kmod_set_userdata: return as void* for user convenience.
* kmod_list_append/kmod_list_prepend: take const void* for user convenience.
|
|
|
|
|
|
We return a kmod_list when searching for an alias. Right now, it only
search for aliases in config files.
To use it, we create a list:
list = NULL;
kmod_module_new_from_lookup(..., &list);
And iterate over it to get the modules and their details:
kmod_list_foreach(l, list) {
struct kmod_mod *mod = kmod_module_get_module(l);
...
... kmod_module_get_name(mod);
... kmod_module_get_path(mod);
}
Aliases might contain globs and are match by using fnmatch().
|
|
|
|
I'm the author, not the copyright owner.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All the functions needed by a lsmod binary are in place.
test/test-loaded.c implements it with the same output of lsmod.
|
|
|
|
|
|
|
|
|
|
|