Commit Graph

408 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri
6717994157 utils/read_str_safe(): fix wrong behavior and bugs.
ouch, I did a mess in the original function, fix them:

 * on errors (read() < 0), continue reading after the done bytes, not
   at position 0.

 * read buflen - 1 bytes, so there is always room to store the
   trailing \0, as expected by user due behavior of snprintf(),
   fgets() and others.
2012-01-03 14:22:05 -02:00
Lucas De Marchi
657722dd9d TODO: add task for providing man page 2012-01-01 06:18:16 -02:00
Lucas De Marchi
51e873d1b9 Add test to check kmod_validate_resources 2012-01-01 06:18:16 -02:00
Lucas De Marchi
c4dc3ca8a2 Add call to check if resources are valid 2012-01-01 06:18:16 -02:00
Lucas De Marchi
9fd58f30bf index: save timestamp of each loaded index 2012-01-01 06:18:16 -02:00
Lucas De Marchi
b6a4dfb1b4 config: save list of config paths with their timestamps
Save a list of config paths with their timestamps so they can be checked
later.
2012-01-01 06:18:01 -02:00
Lucas De Marchi
0b29ef6f59 util: add helper function to compare timestamps 2012-01-01 06:17:54 -02:00
Lucas De Marchi
d8a6c0ccb8 kmod-modprobe: mimic modprobe when removing deps with usecount=0 2012-01-01 06:13:09 -02:00
Lucas De Marchi
c9a144481d Fix leak of kmod_module and fix code style 2012-01-01 06:12:59 -02:00
Lucas De Marchi
5a96c5f1d5 TODO: add list of things that are different on kmod 2012-01-01 06:12:00 -02:00
Dave Reisner
0e9bd2d1ca kmodprobe: post-remove module deps with 0 refcnt 2011-12-31 18:21:00 -05:00
Dave Reisner
d98880ad5c modprobe: use lighter access call instead of stat 2011-12-31 18:02:30 -05:00
Dave Reisner
b09668cf64 modprobe: remove --list option
This was marked as deprecated in m-i-t's modprobe in favor of find and
basename.
2011-12-31 16:51:40 -05:00
Dave Reisner
9070b117ec libkmod-config: remove warning for skipped config files
conf_files_filter_out() already skips these files, but writes to the log
to warn that they'll be ignored in the future.
2011-12-31 19:30:26 -02:00
Lucas De Marchi
2f76fda259 Use last enum value instead of ARRAY_SIZE 2011-12-31 19:30:09 -02:00
Lucas De Marchi
4926cb501d Do not call exported function for mod->name
Name is always available and we don't neet to call a exported function
to get it.
2011-12-31 11:21:52 -02:00
Lucas De Marchi
0d46743ca5 Move function to the right place 2011-12-31 11:15:52 -02:00
Lucas De Marchi
e47c604525 Ignore "already loaded" error in module_probe_insert_module()
It also fixes a leak in the error path.
2011-12-30 14:16:15 -02:00
Lucas De Marchi
bbf59327e3 Use errno instead of return value of init_module()
Return -errno instead of the value returned by init_module(). We need to
differentiate between the several errors that might occur, e.g. "module
already loaded", access denied, etc.
2011-12-30 14:13:33 -02:00
Leandro Pereira
1698456259 libkmod-util: getline_wrapped: return NULL when buffer allocation fails 2011-12-28 15:55:45 -02:00
Leandro Pereira
40ee8dadca Do not forget parenthesis around if (streq(A, B)). 2011-12-28 15:54:38 -02:00
Lucas De Marchi
0c010fae10 Move libkmod-util.c to convenience util lib
Share more code between tools and libkmod. underscores() in kmod-depmod
can not use the same function as in the lib, so rename it.
2011-12-28 13:33:26 -02:00
Lucas De Marchi
6670c63344 Move array implementation from depmode to libkmod-util 2011-12-28 12:58:47 -02:00
Lucas De Marchi
f6cf14ce13 tools: kmod: bundle depmod together with the others 2011-12-27 19:56:33 -02:00
Lucas De Marchi
bcb812275e Fix header guard 2011-12-27 19:53:38 -02:00
Leandro Pereira
4783d69e48 kmod tool: don't keep iterating when command has been executed 2011-12-27 19:46:44 -02:00
Lucas De Marchi
a4848e249f Move util functions to libkmod-util.c
These allow them to be later shared with tools.
2011-12-27 18:11:58 -02:00
Lucas De Marchi
5cd13064ec kmod-depmod: use hash implementation from util lib 2011-12-27 18:11:58 -02:00
Lucas De Marchi
8d1278d03f hash: add iterator 2011-12-27 18:11:58 -02:00
Lucas De Marchi
529148ea70 build-sys: create libkmod-util.la convenience lib
Util functions can be shared betweeing libkmod and tools. Start with the
hash implementation.
2011-12-27 18:11:58 -02:00
Lucas De Marchi
d707380744 Copy missing hash functions from kmod-depmod to libkmod 2011-12-27 18:11:58 -02:00
Lucas De Marchi
822913d74c Remove kmod_ prefix from hash implementation
In a future commit, hash implementation will be shared between libkmod
and depmod. kmod_hash is not exported, so remove the namespace.
2011-12-27 18:11:58 -02:00
Lucas De Marchi
ebaa7beb0a Log paths if kmod_module_new_from_path() failed 2011-12-27 18:11:12 -02:00
Lucas De Marchi
3af535c97b TODO: format and add task 2011-12-27 17:32:55 -02:00
Lucas De Marchi
ea1b8c3702 kmod-depmod: Fix leak of dependency vector 2011-12-27 15:21:31 -02:00
Gustavo Sverzut Barbieri
a627c3f31a kmod-depmod: refactor extension matching array, support XZ.
move the extensions array match to global, conditionally add GZ and XZ
if the support is enabled.
2011-12-27 12:09:17 -02:00
Gustavo Sverzut Barbieri
18cd9da303 kmod-depmod: implement -A (--quick) 2011-12-27 12:09:17 -02:00
Gustavo Sverzut Barbieri
4a0e46dac2 kmod-depmod: implement -F and -E options.
Read System.map and Module.symvers from kernel built, then be able to
report unknown symbols.
2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
009ed664d7 update TODO
depmod was done, and without map support
2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
7436788ca0 kmod-depmod: dump modules.dep.bin 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
ec77abb918 kmod-depmod: dump modules.alias.bin 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
75a9723bb2 kmod-depmod: dump modules.symbols.bin 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
4b144e5fb4 kmod-depmod: dump modules.builtin.bin 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
92df661697 kmod-depmod: add utility functions to be used by binary dumps.
Binary dumps will use functions to convert alias to underscores and
paths to module names.
2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
0de40463ba kmod-depmod: copy code from module-init-tools/index.c
Copy code from module-init-tools/index.c, the following copyright applies:

    Copyright (C) 2008  Alan Jenkins <alan-jenkins@tuffmail.co.uk>.
2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
8e3505c504 kmod-depmod: dump deps. 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
0d13174578 kmod-depmod: dump aliases 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
8bc830efc5 kmod-depmod: dump softdeps. 2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
9a14d0e989 kmod-depmod: dump modules.symbols
note that the hash algorithm is different thus the output order will
be different as well.

to compare the outputs, sort the files:

   depmod -n | grep '^alias symbol:' | sort > /tmp/orig
   kmod-depmod -n | grep '^alias symbol:' | sort > /tmp/new
   diff /tmp/orig /tmp/new
2011-12-27 12:09:16 -02:00
Gustavo Sverzut Barbieri
25c4151203 kmod-depmod: dump devname
first try to dump files: modules.devname.
2011-12-27 12:09:16 -02:00