| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Not passsing O_NONBLOCK to delete_module() is deprecated since kmod 11
and is being removed from the kernel. Force this flag in libkmod.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this flag kmod_module_probe_insert_module() check if module is
blacklisted only if it's also an alias. This is needed in order to allow
blacklisting a module by name and effectively blacklisting all its
aliases as module-init-tools was doing.
Before this patch we could load pcspkr module as follows:
/etc/modprobe.d/test.conf:
alias yay pcspkr
blacklist pcspkr
$ modprobe yay
Now libkmod has support to blacklist "yay" because "pcspkr" is blacklisted.
|
| |
|
|
|
|
|
|
| |
Only the public header maintains #ifndef in the header, together with
pragma. The other ones contain only pragma.
As reported by Shawn Landden on systemd mailing list this is compatible
with all major compilers and gcc has this since version 3.3.
|
| |
|
|
|
|
| |
This is a more generic method of applying filters to module lists. This
deprecates kmod_module_get_filtered_blacklist() which now simply returns
a call to _apply_filter with the extra filter enum arg.
|
| |
|
|
|
|
|
|
|
| |
Search modules.builtin file before saying the module was not found.
Note: these "modules" should not appear as dependencies of other modules
(in modules.dep) even if they appear in modinfo. This fixes the return
code of modprobe with builtin modules.
Also fixes a small coding style issue in module_is_inkernel().
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
We need a way to tell libkmod to ignore loaded modules, so modprobe can
tell it to dry-run and show dependencies. However there's a conflict
with two flags. KMOD_PROBE_STOP_ON_ALREADY_LOADED prevails if passed
together with KMOD_PROBE_IGNORE_LOADED.
|
| |
|
|
|
| |
This allows to implement dry-run in modprobe without exporting
kmod_module_get_probe_list().
|
| |
|
|
|
| |
Breaking flags is one of the reasons next version will need to bump ABI.
In future we don't want to bump it just because of this.
|
| | |
|
| |
|
|
| |
We always want to stop if module failed to loaded due to unknown reason.
|
| |
|
|
|
|
|
| |
It's not as simple as tell user to check if the module is loaded before
calling this function. Due to race conditions, module might not be
loaded before the function call, but fail later because another process
inserted it.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split kmod_module_probe_insert_module() in 2:
1) Get list of modules to be loaded
2) Iterate the list, loading the module
With this in future we will be able to cover use cases of modprobe,
that has a logic a bit more complicated.
With this we also change the logic to detect dependency loops: instead
of checking the recursion every STEP times, we now keep a field in
kmod_module, marking it as visited. We simply ignore already visited
modules and thus we break loops.
|
| | |
|
| |
|
|
|
|
|
| |
Provide a function to dump the index files to a certain fd. It could be
more optimized (particularly the functions to dump the index that were
copied and pasted from m-i-t), but it seems like the only user of it is
'modprobe -c', used for debugging purposes. So, keep it as is.
|
| | |
|
| |
|
|
|
|
|
|
| |
Config iterators are useful to get each configuration list, remember its
type and how to get their key/value pair.
softdeps don't have the value yet, because they are stored as string
vectors.
|
| |
|
|
|
| |
This is needed by gtk-doc (to be added later) to be able to properly
document the function.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Treat module insertion as modprobe does: look for (soft-)dependencies, run
install commands, apply blacklist.
The difference with the blacklist is that it's applied to all modules,
including the dependencies. If you want to apply a blacklist only on the
module it's better to call the filter function by yourself.
This implementation detects loops caused by poorly written
soft-dependencies and fail gracefully, printing the loop to the log.
|
| |
|
|
|
|
|
|
|
| |
Uses kmod_elf_get_dependency_symbols() that looks into ".symtab" for
UNDEF symbols and matches the name from ".strtab" to "__versions" to
get crc.
Likely the public API should unify the symbol information getters and
list release, they are almost the same.
|
| |
|
|
|
|
|
|
| |
Similar to module-init-tools load_symbols(), it will try .symtab and
.strtab for symbols starting with __crc_, if they are found their crc
is read from ELF's Elf_Sym::st_value.
If not found, then it will fallback to __ksymtab_strings.
|
| |
|
|
| |
Both removal and insertion flags are already implemented.
|
| |
|
|
| |
Needs testing, but should work.
|
| |
|
|
| |
walks the list in the reverse order.
|
| |
|
|
|
| |
This gets the last element in the list, that is, the previous element
of the head.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| | |
|