summaryrefslogtreecommitdiff
path: root/libkmod/libkmod.h
Commit message (Collapse)AuthorAgeFilesLines
* libkmod: always pass O_NONBLOCK to kernelLucas De Marchi2013-09-201-1/+1
| | | | | Not passsing O_NONBLOCK to delete_module() is deprecated since kmod 11 and is being removed from the kernel. Force this flag in libkmod.
* Update copyright noticesLucas De Marchi2013-01-161-1/+1
|
* libkmod-module: Add KMOD_PROBE_APPLY_BLACKLIST_ALIAS_ONLY flagLucas De Marchi2012-08-171-0/+1
| | | | | | | | | | | | | | | | | 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.
* Use #pragma once instead of #ifndefLucas De Marchi2012-07-181-0/+1
| | | | | | | | 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.
* libkmod/module: add kmod_module_apply_filter methodDave Reisner2012-02-241-0/+10
| | | | | | 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.
* kmod-module: lookup: search modules.builtin file tooLucas De Marchi2012-02-161-0/+1
| | | | | | | | | 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().
* libkmod-module: probe: rename flag to be more meaningfulLucas De Marchi2012-02-061-1/+1
|
* libkmod: organize public headerLucas De Marchi2012-01-311-36/+56
|
* libkmod-module: probe: remove useless KMOD_PROBE_STOP_ON_COMMANDLucas De Marchi2012-01-311-1/+0
|
* libkmod-module: probe: return -EEXIST if told to stop on already loadedLucas De Marchi2012-01-311-1/+1
|
* libkmod-module: probe: add flag to dry-runLucas De Marchi2012-01-311-0/+1
|
* libkmod-module: probe: add flag to ignore loaded modulesLucas De Marchi2012-01-311-0/+1
| | | | | | | 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.
* libkmod-module: probe: add print_action callbackLucas De Marchi2012-01-311-1/+2
| | | | | This allows to implement dry-run in modprobe without exporting kmod_module_get_probe_list().
* libkmod-module: probe: add room in flags for future extensionLucas De Marchi2012-01-301-7/+7
| | | | | 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.
* libkmod-module: probe: ignore-command flag can't be used in returnLucas De Marchi2012-01-301-4/+4
|
* libkmod-module: probe: remove useless flag to stop on failureLucas De Marchi2012-01-301-4/+3
| | | | We always want to stop if module failed to loaded due to unknown reason.
* libkmod-module: probe: add flag to stop loading on already loadedLucas De Marchi2012-01-301-0/+1
| | | | | | | 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.
* libkmod-module: probe: add flag to ignore commandsLucas De Marchi2012-01-301-0/+1
|
* libkmod-module: probe: change insertion to cover more use casesLucas De Marchi2012-01-301-5/+8
| | | | | | | | | | | | | | 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.
* Add doc to kmod_dump_indexLucas De Marchi2012-01-161-1/+1
|
* libkmod: dump index filesLucas De Marchi2012-01-161-0/+2
| | | | | | | 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.
* libkmod: export enum kmod_index and rename membersLucas De Marchi2012-01-161-0/+8
|
* config: add exported iterator functionsLucas De Marchi2012-01-131-0/+19
| | | | | | | | 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.
* Match param names on header and source codeLucas De Marchi2012-01-091-9/+9
| | | | | This is needed by gtk-doc (to be added later) to be able to properly document the function.
* Update copyrightLucas De Marchi2012-01-091-1/+1
|
* Add call to check if resources are validLucas De Marchi2012-01-011-0/+8
|
* Add implementation of modprobe's insertionLucas De Marchi2011-12-271-0/+13
| | | | | | | | | | | | 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.
* elf: implement kmod_module_get_dependency_symbols()Gustavo Sverzut Barbieri2011-12-241-0/+14
| | | | | | | | | 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.
* elf: add get_symbols()Gustavo Sverzut Barbieri2011-12-241-0/+5
| | | | | | | | 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.
* Removing comments saying flags are not implementedLucas De Marchi2011-12-201-2/+2
| | | | Both removal and insertion flags are already implemented.
* ELF: initial support for modinfo and strip of modversions and vermagic.Gustavo Sverzut Barbieri2011-12-191-0/+10
| | | | Needs testing, but should work.
* introduce kmod_list_foreach_reverse().Gustavo Sverzut Barbieri2011-12-171-0/+5
| | | | walks the list in the reverse order.
* introduce kmod_list_last()Gustavo Sverzut Barbieri2011-12-171-0/+2
| | | | | This gets the last element in the list, that is, the previous element of the head.
* implement softdeps.Gustavo Sverzut Barbieri2011-12-171-0/+2
|
* Add comment in public header about flags not implementedLucas De Marchi2011-12-151-0/+2
|
* Remove flags that likely will not be usedLucas De Marchi2011-12-151-2/+0
|
* Remove function kmod_resolve_alias_options()Lucas De Marchi2011-12-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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'
* Change licensesLucas De Marchi2011-12-121-1/+2
| | | | | libkmod is under LGPL 2.1 or later tools/* are under GPL
* Rename kmod_loaded_get_list() to kmod_module_new_from_loaded()Lucas De Marchi2011-12-121-2/+1
| | | | | Be consistent with other similar functions already present and improve documentation.
* API-BREAK: kmod_new() takes a second parameter for configuration directory.Gustavo Sverzut Barbieri2011-12-111-1/+1
| | | | This is required by modprobe and also to help doing unit tests in future.
* insmod: allows providing option to module.Gustavo Sverzut Barbieri2011-12-111-1/+1
|
* export module's options and commands.Gustavo Sverzut Barbieri2011-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | 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.
* Load and unload resourcesLucas De Marchi2011-12-081-0/+2
| | | | | This call will mmap all the index files and in future some of the work done in ctx creation can be put here.
* log: give log function its data instead of kmod_ctx.Gustavo Sverzut Barbieri2011-12-081-2/+3
| | | | | This will be the most common use case for logging, also changed log_stderr() to log_filep() with data being stderr to test it.
* add kmod_module_get_filtered_blacklist()Gustavo Sverzut Barbieri2011-12-081-0/+2
| | | | | | This function will filter the given list against the known blacklist, returning a new list with remaining modules with the reference incremented.
* kmod_module: return a new list and increase ref of dependenciesLucas De Marchi2011-12-061-1/+1
| | | | | | 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().
* Add padding to enum to make sure it's an intLucas De Marchi2011-12-051-1/+3
|
* no more kmod_loaded and kmod_loaded_module.Gustavo Sverzut Barbieri2011-12-041-16/+2
| | | | | | 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.
* kmod_module: extended information gathering.Gustavo Sverzut Barbieri2011-12-041-0/+17
| | | | | | | | | | | 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).
* kmod_module_get_module: safety against NULL pointersGustavo Sverzut Barbieri2011-12-041-1/+1
|