Commit Graph

24 Commits

Author SHA1 Message Date
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 8f767e2dfa Use true/false for bool return 2011-12-12 15:27:57 -02:00
Lucas De Marchi 98c80f44c9 Directories inside config directories are not supported
This was failing silent, both in libkmod and module-init-tools. Give a
warning if we created a dir inside config directories.
2011-12-12 15:26:59 -02:00
Lucas De Marchi 4782396cc4 Do not stat() dir twice 2011-12-12 15:00:51 -02:00
Lucas De Marchi 016d619cd9 Fix leak of DIR 2011-12-12 14:39:35 -02:00
Lucas De Marchi 28c175edd1 coding style: be consistent with blank lines 2011-12-12 11:52:59 -02:00
Lucas De Marchi c35347f15c coding style: fix lines over 80 chars
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
2011-12-12 10:54: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 bd3f553526 export module's options and commands.
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.
2011-12-11 20:58:21 -02:00
Lucas De Marchi a5cce6d6ef kmod_config: parse install and remove commands 2011-12-07 11:31:28 -02:00
Lucas De Marchi 615c42be5c kmod_config: parse module options 2011-12-07 10:59:44 -02:00
Lucas De Marchi 877e80cd93 Use streq() when possible 2011-12-07 02:32:28 -02:00
Lucas De Marchi b7b7ac298f kmod_config: optimize config files handling
1) Allocate less by not sorting the result with qsort. Instead,
    insert the nodes in the correct order;
 2) Do not maintain the whole path in memory, but rely on openat()
2011-12-06 03:34:51 -02:00
Gustavo Sverzut Barbieri 43c29d10ff kmod_alias: reduce from 3 mallocs to a single one. 2011-12-05 13:42:13 -02:00
Lucas De Marchi 2295acc5da Fix some coding style issues 2011-12-03 04:05:22 -02:00
Gustavo Sverzut Barbieri d13e606ff6 improve kmod_config api.
make the function names reflect the structure they are operating on.

the structure is now allocated and remembers the context it was
created, then no need to give the context in every function call.
2011-12-03 03:56:57 -02:00
Gustavo Sverzut Barbieri 1ce08a563e improve "const" keyword usage.
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.
2011-12-03 03:51:55 -02:00
Lucas De Marchi ca491ca99c Drop configurations from /usr/local 2011-12-02 15:02:50 -02:00
Lucas De Marchi 6f1bc6e36e Clean 'unused variable' warnings 2011-12-02 10:02:05 -02:00
Lucas De Marchi c11e62bfd4 Use strtok_r insteat of strtok
strtok is not thread-safe because it uses a static pointer to keep track
of position in the string. Using strtok_r solves the problem.
2011-12-01 18:59:54 -02:00
Lucas De Marchi b0ef19f7f5 Add getters for aliases 2011-11-30 18:18:13 -02:00
Lucas De Marchi 30be7513c0 Use underscores() in module names and aliases 2011-11-30 02:14:57 -02:00
Lucas De Marchi 81cf2060e0 Parse blacklists in config files 2011-11-29 18:48:02 -02:00
Lucas De Marchi 7c2ab358fd Add support for parsing config files
Right now only alias keyword is treated.
2011-11-29 18:07:43 -02:00