Commit Graph

998 Commits

Author SHA1 Message Date
Lucas De Marchi ecced7dd77 doc: fix out of tree build 2012-01-09 13:32:31 -02:00
Lucas De Marchi ae2612e327 build-sys: give recommended configure options for hacking 2012-01-09 13:27:20 -02:00
Lucas De Marchi dd420605b2 README: add more information 2012-01-09 13:15:46 -02:00
Lucas De Marchi 63dc83291c build-sys: do not run configure in autogen.sh 2012-01-09 13:00:28 -02:00
Lucas De Marchi 6681951bbe doc: organize sections 2012-01-09 05:28:57 -02:00
Lucas De Marchi 646b83b841 doc: add gtk-doc to generate documentation
Current limitation is horrible no support to sections: we have to to
have separate header files or to maintain the libkmod-sections.txt file.
We are doing the latter.
2012-01-09 05:28:57 -02:00
Lucas De Marchi db74ceec80 doc: fix broken links to other functions 2012-01-09 03:45:48 -02:00
Lucas De Marchi e1daa4f54b doc: fix order of param descriptions 2012-01-09 03:30:10 -02:00
Lucas De Marchi 6a82921113 Match param names on header and source code
This is needed by gtk-doc (to be added later) to be able to properly
document the function.
2012-01-09 03:29:48 -02:00
Lucas De Marchi f4cc6ea5eb doc: fix comments format 2012-01-09 03:29:29 -02:00
Lucas De Marchi a66a6a999f Update copyright 2012-01-09 00:41:07 -02:00
Lucas De Marchi cb0d0b7212 modprobe: fix error path when loading dependencies
demarchi> scenario is the following:
demarchi> modA depends on modB and modC
demarchi> if there's a race when trying to insert a dependency of a module, say
          modB, it will stop loading all the modules
demarchi> it should check by "module already loaded error"
demarchi> like it does for modA
2012-01-08 18:08:05 -02:00
Gustavo Sverzut Barbieri 525fa07b8f modprobe: show is independent from verbose level.
"modprobe --quiet --show-depends" now works.
2012-01-08 14:32:23 -02:00
Lucas De Marchi 6daceb2f1f Replace NAME_MAX with PATH_MAX for module aliases
Module aliases can be bigger than NAME_MAX. So, replace with PATH_MAX
that is bigger enough to hold them.

Technically in some places NAME_MAX would be sufficient (those using
module names only), but they use functions that can be called with
alias. So increase the buffers in these cases to PATH_MAX too.
2012-01-08 01:02:29 -02:00
Lucas De Marchi dd1cf10fc4 config: check if opening /proc/cmdline succeeded 2012-01-06 19:22:41 -02:00
Rolf Eike Beer 55021bed20 tools/kmod-depmod: fix aliasing warning 2012-01-06 10:47:47 -02:00
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
Dave Reisner 7f37491375 tools/modprobe: exit non-zero on module not found with --all 2012-01-06 02:33:58 -02:00
Dave Reisner 5f85a133f8 tools/modinfo: exit non-zero on module not found 2012-01-06 02:32:28 -02:00
Lucas De Marchi b30a71b8e8 kmod 3 2012-01-05 08:16:28 -02:00
Lucas De Marchi aa156c9860 tools: use basename in help message 2012-01-05 08:16:28 -02:00
Dave Reisner 4f17bb0bd2 libkmod/hash: check for NULL before freeing hash 2012-01-04 22:34:36 -02:00
Lucas De Marchi b5b4d8e8a5 Add missing doc for function argument 2012-01-04 21:07:59 -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 b787b5693d libkmod: Fix casing in error output 2012-01-04 10:59:49 -05: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
Lucas De Marchi 8d75053eb7 build-sys: do not install kmod-* tools 2012-01-04 08:58:19 -02:00
Lucas De Marchi 3f63505812 file: use log facilities
Don't clutter stderr with messages that might be useful in the log.
2012-01-04 08:49:23 -02:00
Lucas De Marchi c68e92f731 file: take a weakref to ctx 2012-01-04 08:49:15 -02:00
Lucas De Marchi 29b69c0b98 config: take a weakref to ctx
Commit "b6a4dfb config: save list of config paths with their timestamps"
removed the weakref to ctx. Add it back.
2012-01-04 08:49:10 -02:00
Lucas De Marchi 7749bedbf7 Add missing static const 2012-01-04 08:00:45 -02: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 79b656faeb utils/array: add array_remove_at()
remove array element at given position, will be used by depmod.
2012-01-03 15:58:24 -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
Gustavo Sverzut Barbieri 599a032467 elf: zero *array when count is zero. 2012-01-03 14:53:15 -02:00
Gustavo Sverzut Barbieri db5d14cf24 libkmod-file: refactor code to avoid ifdef mess.
Refactor code to use pointer to functions, avoiding the previous

Now comp_types defines a magic header to be checked (size and bytes),
with the associated load() and unload() operations. If a header
matches, their operations are used. Otherwise the regular file
operations (mmap/munmap) are used.

File descriptor close is managed by the common code if it's valid
(>=0). If some code steals the file descriptor (eg: gzopen), then they
must change file->fd to -1.

This way the code should be easier to extend and avoid bugs.
2012-01-03 14:25:49 -02:00
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