On Sun, 12 Feb 2012, Alexey Gladkov wrote:

In kmod-4:

$ modprobe --show-depends ext4
insmod /lib/modules/3.0.0-lks-wks-alt0.1/kernel/lib/crc16.ko
insmod /lib/modules/3.0.0-lks-wks-alt0.1/kernel/fs/jbd2/jbd2.ko
insmod /lib/modules/3.0.0-lks-wks-alt0.1/kernel/fs/mbcache.ko
insmod /lib/modules/3.0.0-lks-wks-alt0.1/kernel/fs/ext4/ext4.ko

but modprobe from kmod-5 doesn't show anything.


See the attached patch (which I think is from the Arch guys).
I haven't checked to see if it's identical to the commit in
git, but I do know that this works here.

-RW
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 0af3e2e..14a0a3d 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -1132,7 +1132,9 @@ KMOD_EXPORT int kmod_module_probe_insert_module(struct 
kmod_module *mod,
        if (mod == NULL)
                return -ENOENT;
 
-       if (module_is_inkernel(mod)) {
+       /* ignore module state if this is only for a dry run */
+       if (!(flags & KMOD_PROBE_DRY_RUN) && print_action == NULL &&
+                       module_is_inkernel(mod)) {
                if (flags & KMOD_PROBE_FAIL_ON_LOADED)
                        return -EEXIST;
                else

Reply via email to