Commit Graph

30 Commits

Author SHA1 Message Date
Lucas De Marchi
3f1e970b5a Revert "tools/kmod-depmod: fix aliasing warning"
This reverts commit f63fc9e606. Wrong
author name. I'll apply it again later.
2012-01-06 10:44:45 -02:00
root
f63fc9e606 tools/kmod-depmod: fix aliasing warning 2012-01-06 10:39:39 -02:00
Lucas De Marchi
aa156c9860 tools: use basename in help message 2012-01-05 08:16:28 -02:00
Lucas De Marchi
56406fdb0a kmod-depmod: demote messages to WRN when non-critical files are missing 2012-01-04 21:02:20 -02:00
Dave Reisner
6369837707 tools: unify error verbiage and casing
Fix a typo and ensure that we always use "could not" instead of "Could
not" or the conjunction "couldn't".
2012-01-04 10:59:03 -05:00
Gustavo Sverzut Barbieri
3db5bf9d38 kmod-depmod: fix replacement of existing modules.
We cannot create a kmod_module for existing module name, it will fail
due existing in the hash table "modules_by_name".

To avoid it, we first delete the existing module, if lower priority,
then add the new one.

kmod_module_new_from_path() is called only when the former module was
deleted or does not exist.
2012-01-03 16:14:57 -02:00
Gustavo Sverzut Barbieri
026c7b448d kmod-depmod: fix comparison of module priority.
This code was never tested, my bad!

 * the prefix should be ignored, as it is not stored in cfg_search/override.

 * baselen should not include '/'.

 * search length should not include '\0'.

 * override path should not include cfg->dirname prefix.
2012-01-03 16:10:17 -02:00
Gustavo Sverzut Barbieri
8ea02fe056 kmod-depmod: fix incorrect math finding out end of dirname. 2012-01-03 15:11:58 -02:00
Gustavo Sverzut Barbieri
5988652597 kmod-depmod: document --config/-C in help output. 2012-01-03 15:06:08 -02:00
Gustavo Sverzut Barbieri
b0bcadd0ae kmod-depmod: add missing trailing \n to log messages. 2012-01-03 15:04:34 -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
5cd13064ec kmod-depmod: use hash implementation from util lib 2011-12-27 18:11:58 -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
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
Gustavo Sverzut Barbieri
64b8b586eb kmod-depmod: initial code (no files generated, untested)
this is the initial code for depmod, it should:
 * use configuration from /run/depmod.d, /etc/depmod.d, /lib/depmod.d
 * respect overrides and searches
 * resolve symbols and dependencies
 * break circular dependencies (dependency loops)
 * --errsyms: print out modules with unresolved symbols and incorrect crc
 * --symbol-prefix: respect architecture symbol prefix

it will not:
 * --quick: does not do quick mode
 * --warn: does not warn on duplicates
 * --filesyms: does not load symbols from map file
 * --symvers: does not load symbol versions from map file
 * dump files: does not dump any files at the moment.

it is highly untested, then I appreciate your help with real world
scenarios using overrides and searches. To get output run with -vvvvvv.

next version should fill in the gaps and at least generate the files
2011-12-27 12:09:16 -02:00