Commit Graph

729 Commits

Author SHA1 Message Date
Lucas De Marchi
6d96056303 man: build depmod man page 2012-01-12 14:33:04 -02:00
Lucas De Marchi
c0bcb67059 man: build modules.dep{,.bin} man pages 2012-01-12 14:33:04 -02:00
Lucas De Marchi
5173e8e842 man: build modprobe.d man page 2012-01-12 14:21:22 -02:00
Lucas De Marchi
904b57d022 build-sys: build man pages 2012-01-12 14:21:22 -02:00
Lucas De Marchi
5b24df2ffc man: convert depmod.d.sgml to xml and update it 2012-01-12 14:21:22 -02:00
Lucas De Marchi
e3ebcff7a4 build-sys: fix clean rule removing tracked files 2012-01-12 14:21:22 -02:00
Lucas De Marchi
cb8547c98f rename doc dir to man 2012-01-12 10:05:25 -02:00
Robby Workman
43042306cb doc/modprobe.sgml: Various updates wrt inclusion with kmod
* TODO: document "--remove-dependencies" flag
2012-01-12 00:07:44 -06:00
Robby Workman
2b3f9c7430 doc/depmod.sgml: Remove references to legacy map files 2012-01-12 00:07:37 -06:00
Robby Workman
e4f17fdc32 doc/depmod.sgml: Remove refs to depmod.conf 2012-01-12 00:07:20 -06:00
Robby Workman
c5570980e8 doc/depmod.d.sgml: Various touchups; mostly s/depmod.conf/depmod.d/g 2012-01-12 00:07:18 -06:00
Robby Workman
092a948850 doc/modprobe.d.sgml: Various touchups
* change references to "kmod" instead of "module-init-tools"
* remove references to modprobe.conf
2012-01-12 00:06:27 -06:00
Robby Workman
923590709d doc: Import sgml manpages from module-init-tools repo 2012-01-12 00:04:57 -06:00
Lucas De Marchi
92122614b2 modprobe: show if module is in kernel
Now with './tools/modprobe --show-depends ahci' (ahci is builtin) we have the following
output:

$ ./tools/modprobe --show-depends ahci
builtin ahci

Just like modprobe from m-i-t. Previously we had:

$ ./tools/modprobe --show-depends ahci
FATAL: Module ahci not found.
2012-01-11 21:54:25 -02:00
Lucas De Marchi
efd2cec66e test: add check of module's state 2012-01-11 21:22:21 -02:00
Jan Alexander Steffens (heftig)
00bd319113 depmod: Postpone creation of module array
Deleting modules (we have found replacements) invalidates the indices
because the array collapses removed elements, hitting the assertion.

Since we don't make use of the array until the sorting step, build it from
the modules_by_name hash instead.
2012-01-11 20:35:18 -02:00
Lucas De Marchi
af0ff2f22a modprobe: break dependency loop by checking if module is loaded
modprobe doesn't have support for handling dependency loop. That happens
with poorly written softdeps that can introduce a loop. We must deal
with them like it's being done in libkmod.

However, we can break a dependency loop when the dependency was already
inserted. This commit fixes this issue, that happens in the following
scenario:

dependencies:
-------------

modA:
modB: modA
modC: modA

config:

softdep modA post: modB modC

This creates the following loop:

modA
    inserted ok
    handle post-soft-deps of modA -> modB modC
        modB
            handle dependencies of modB -> modA
                modA is already inserted
                    handle post-soft-deps of modA -> modB modC

And so on and so forth.

Now we break the loop by checking if module is already inserted, before
handling it. Thus this gives us:

modA
    inserted ok
    handle post-soft-deps of modA -> modB modC
        modB
            handle dependencies of modB -> modA
                modA is already inserted
            inserted ok
        modC
            handle dependencies of modC -> modA
                modA is already inserted
            inserted ok
2012-01-11 18:29:55 -02:00
Lucas De Marchi
21e14d36f1 autogen.sh: configure with 3-clicks + paste 2012-01-11 17:54:05 -02:00
Lucas De Marchi
8f1922101e modprobe: adhere do coding style 2012-01-11 15:48:20 -02:00
Dave Reisner
6da9cdf1f7 rmmod: behavior more like m-i-t's rmmod
In line with m-i-t's behavior, we should check to see if each module is:

- loaded
- has any holders
- has a 0 refcnt

Detecting any of these lets us provide a more useful message than the
kernel's EPERM response to delete_module(2).

Additionally, alter the main loop behavior to avoid exiting early on the
first error.
2012-01-10 22:35:18 -05:00
Dave Reisner
b54f1bf06a modprobe: check for EPERM on insertion
Throw an appropriate error when an unprivileged user attempts to load a
module.
2012-01-10 22:33:05 -05:00
Lucas De Marchi
0ad5dd0837 config: deprecate 'include' and 'config' commands 2012-01-11 00:29:34 -02:00
Lucas De Marchi
ba998b9c9e Fix error code returned on module removal 2012-01-11 00:08:14 -02:00
Lucas De Marchi
39baaec11b build-sys: fix build with zlib/xz after private lib 2012-01-10 16:22:59 -02:00
Lucas De Marchi
ca1f0f303e TODO: add task to modprobe 2012-01-10 15:45:14 -02:00
Lucas De Marchi
0b22179acd build-sys: workaround libtool issue with argv[0]
Symlinking tools to kmod doesn't work because argv[0] is not the name of
the symlink, but rather 'kmod' (since libtool's wrapper script calls the
tools/.libs/kmod directly)

Now we create another binary kmod-nolib that is statically linked to
libkmod so we can call the binary directly and do not worry about
LD_LIBRARY_PATH.
2012-01-10 15:31:58 -02:00
Lucas De Marchi
043b3f9833 build-sys: build tests as part of check phase
Do not unconditionally compile tests, make them as target of 'make
check'. Only those listed in TESTS var are run.
2012-01-10 15:31:58 -02:00
Lucas De Marchi
00fc926cd8 build-sys: create symlinks instead of building separate tools 2012-01-10 15:31:58 -02:00
Lucas De Marchi
4fb900c09e build-sys: allow building without having gtk-doc installed 2012-01-10 15:31:58 -02:00
Lucas De Marchi
83121fdea6 config: be reliable againt syntax errors in configs 2012-01-10 15:00:07 -02:00
Lucas De Marchi
ab8440a48a TODO: add tasks to modprobe 2012-01-10 10:19:01 -02:00
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