Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463592 - sys-apps/kmod - modprobe cannot find module
Summary: sys-apps/kmod - modprobe cannot find module
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 10:50 UTC by petr bravenec
Modified: 2013-03-28 17:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info,4.43 KB, text/plain)
2013-03-28 10:50 UTC, petr bravenec
Details
strace -o strace-output modprobe ipv6 (strace.output,6.78 KB, text/plain)
2013-03-28 10:51 UTC, petr bravenec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description petr bravenec 2013-03-28 10:50:52 UTC
Created attachment 343508 [details]
emerge --info

When I installed kmod istead of module-init-tools I cannot boot one of my servers automatically because the modprobe cannot find modules:

modprobe ipv6
modprobe: FATAL: Module ipv6 not found.

Modules are compiled so insmod is working fine:
insmod `find /lib/modules/3.7.10-gentoo/ -name 'ipv6.ko'`

Debugging output:

modprobe -v -v -v -v sg
modprobe: INFO: libkmod/libkmod.c:351 kmod_set_log_fn() custom logging function 0x40fab0 registered
modprobe: DEBUG: libkmod/libkmod-index.c:787 index_mm_open() file=/lib/modules/3.7.10-gentoo/modules.dep.bin
modprobe: DEBUG: libkmod/libkmod-index.c:787 index_mm_open() file=/lib/modules/3.7.10-gentoo/modules.alias.bin
modprobe: DEBUG: libkmod/libkmod-index.c:787 index_mm_open() file=/lib/modules/3.7.10-gentoo/modules.symbols.bin
modprobe: DEBUG: libkmod/libkmod-index.c:787 index_mm_open() file=/lib/modules/3.7.10-gentoo/modules.builtin.bin
modprobe: DEBUG: libkmod/libkmod-module.c:524 kmod_module_new_from_lookup() input alias=sg, normalized=sg
modprobe: DEBUG: libkmod/libkmod-module.c:530 kmod_module_new_from_lookup() lookup modules.dep sg
modprobe: DEBUG: libkmod/libkmod.c:541 kmod_search_moddep() use mmaped index 'modules.dep' modname=sg
modprobe: DEBUG: libkmod/libkmod-module.c:534 kmod_module_new_from_lookup() lookup modules.symbols sg
modprobe: DEBUG: libkmod/libkmod-module.c:538 kmod_module_new_from_lookup() lookup install and remove commands sg
modprobe: DEBUG: libkmod/libkmod-module.c:542 kmod_module_new_from_lookup() lookup modules.aliases sg
modprobe: DEBUG: libkmod/libkmod.c:421 kmod_lookup_alias_from_alias_bin() use mmaped index 'modules.alias' for name=sg
modprobe: DEBUG: libkmod/libkmod-module.c:546 kmod_module_new_from_lookup() lookup modules.builtin sg
modprobe: DEBUG: libkmod/libkmod.c:491 kmod_lookup_alias_from_builtin_file() use mmaped index 'modules.builtin' modname=sg
modprobe: DEBUG: libkmod/libkmod-module.c:551 kmod_module_new_from_lookup() lookup sg=0, list=(nil)
modprobe: DEBUG: lookup failed - trying to check if it's builtin
modprobe: DEBUG: libkmod/libkmod.c:389 kmod_pool_get_module() get module name='sg' found=(nil)
modprobe: DEBUG: libkmod/libkmod.c:397 kmod_pool_add_module() add 0x61a670 key='sg'
modprobe: DEBUG: libkmod/libkmod-module.c:1656 kmod_module_get_initstate() could not open '/sys/module/sg/initstate': No such file or directory
modprobe: DEBUG: libkmod/libkmod-module.c:1666 kmod_module_get_initstate() could not open '/sys/module/sg': No such file or directory
modprobe: DEBUG: libkmod/libkmod-module.c:436 kmod_module_unref() kmod_module 0x61a670 released
modprobe: DEBUG: libkmod/libkmod.c:405 kmod_pool_del_module() del 0x61a670 key='sg'
modprobe: FATAL: Module sg not found.

This problem appeared on two servers. On one of the the reemerging kmod and udev helped. On the second server problem remains.
Comment 1 petr bravenec 2013-03-28 10:51:50 UTC
Created attachment 343510 [details]
strace -o strace-output modprobe ipv6
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-03-28 16:29:40 UTC
I've seen "this" before in forums, some mailing list, ... which is why:

Which version of sys-apps/kmod did you emerge, and I mean the CVS revision and not the ebuild revision:

$ head -n 3 /usr/portage/sys-apps/kmod/kmod-12-r1.ebuild 
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-12-r1.ebuild,v 1.18 2013/03/26 08:14:18 ssuominen Exp $

v 1.18 is correct. Please try re-emerging to be sure after emerge --sync'ing.

I just made it run depmod automatically to prevent thesetype of breakages. 

Alternatively, the easier way, does running `depmod -a` fix things? Does the files in /lib/modules/3.7.10-gentoo/ get re-generated?
When you install the modules, like `make modules_install`, when you install your kernel, it runs depmod, and if that depmod used was from module-init-tools, the generated files might not be compatible anymore with kmod
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-03-28 16:32:54 UTC
This also doesn't look right:

could not open '/sys/module/sg': No such file or directory
modprobe: FATAL: Module sg not found.

When you emerge sys-fs/udev, does it warn about missing kernel options? Such as:

$ zgrep BSG /proc/config.gz 
CONFIG_BLK_DEV_BSG=y

That's mandatory to be enabled. /sys/module/sg should exist.
Comment 4 petr bravenec 2013-03-28 17:00:26 UTC
(In reply to comment #3)
> This also doesn't look right:
> 
> could not open '/sys/module/sg': No such file or directory
> modprobe: FATAL: Module sg not found.
> 
> When you emerge sys-fs/udev, does it warn about missing kernel options? Such
> as:
> 
> $ zgrep BSG /proc/config.gz 
> CONFIG_BLK_DEV_BSG=y
> 
> That's mandatory to be enabled. /sys/module/sg should exist.

I have more the ten servers so I'm pretty sure that CONFIG_BLK_DEV_BSG is set:
zgrep BSG /proc/config.gz
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y

I used module sg as an example. I do not use that module so I can remove or insert it safely.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2013-03-28 17:01:49 UTC
OK, and Comment #2?
Comment 6 petr bravenec 2013-03-28 17:06:39 UTC
(In reply to comment #2)
> I've seen "this" before in forums, some mailing list, ... which is why:
> 
> Which version of sys-apps/kmod did you emerge, and I mean the CVS revision
> and not the ebuild revision:
> 
> $ head -n 3 /usr/portage/sys-apps/kmod/kmod-12-r1.ebuild 
> # Copyright 1999-2013 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-12-r1.ebuild,v 1.18
> 2013/03/26 08:14:18 ssuominen Exp $
> 
> v 1.18 is correct. Please try re-emerging to be sure after emerge --sync'ing.
> 
> I just made it run depmod automatically to prevent thesetype of breakages. 
> 
> Alternatively, the easier way, does running `depmod -a` fix things? Does the
> files in /lib/modules/3.7.10-gentoo/ get re-generated?
> When you install the modules, like `make modules_install`, when you install
> your kernel, it runs depmod, and if that depmod used was from
> module-init-tools, the generated files might not be compatible anymore with
> kmod

I'm trying to solve this problem about a week. I recompiled the kmod and udev after many times. The version is the requested 1.18:

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-12-r1.ebuild,v 1.18 2013/03/26 08:14:18 ssuominen Exp $

Depmod -a did not fix the problem and files in /lib/modules/3.7.10-gentoo are regenerated:

# depmod -a
# modprobe  ipv6
modprobe: FATAL: Module ipv6 not found.
# ls -l
celkem 1220
lrwxrwxrwx 1 root root     28 22. bře 19.28 build -> /usr/src/linux-3.7.10-gentoo
drwxr-xr-x 9 root root   4096 22. bře 19.28 kernel
-rw-r--r-- 1 root root 314262 28. bře 18.04 modules.alias
-rw-r--r-- 1 root root 300818 28. bře 18.04 modules.alias.bin
-rw-r--r-- 1 root root   3344 22. bře 19.28 modules.builtin
-rw-r--r-- 1 root root   4560 28. bře 18.04 modules.builtin.bin
-rw-r--r-- 1 root root  93903 28. bře 18.04 modules.dep
-rw-r--r-- 1 root root 133181 28. bře 18.04 modules.dep.bin
-rw-r--r-- 1 root root    194 28. bře 18.04 modules.devname
-rw-r--r-- 1 root root  30599 22. bře 19.28 modules.order
-rw-r--r-- 1 root root    131 28. bře 18.04 modules.softdep
-rw-r--r-- 1 root root 138566 28. bře 18.04 modules.symbols
-rw-r--r-- 1 root root 173924 28. bře 18.04 modules.symbols.bin
lrwxrwxrwx 1 root root     28 22. bře 19.28 source -> /usr/src/linux-3.7.10-gentoo
drwxr-xr-x 2 root root   4096 28. bře 07.34 video

There are right date&time values: "bře" is "march".
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2013-03-28 17:12:48 UTC
And there was no warnings about kernel options during udev's emerge?
Does modules.dep actually have an entry for "kernel/drivers/scsi/sg.ko"?
Comment 8 petr bravenec 2013-03-28 17:13:41 UTC
(In reply to comment #7)
> And there was no warnings about kernel options during udev's emerge?
> Does modules.dep actually have an entry for "kernel/drivers/scsi/sg.ko"?

What I tried and it worked was the compiling the kmod by hand:

./configure
make

The main difference is that the modprobe compiled in such way is linked staticaly:
ldd modprobe
        linux-vdso.so.1 (0x00007fff1a550000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc2e0005000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc2e03b0000)

and this is working:
# lsmod | grep sg
---- no output - no module inserted
# ./modprobe sg
# lsmod | grep sg
sg                     24124  0 
---- module is inserted
Comment 9 petr bravenec 2013-03-28 17:16:18 UTC
(In reply to comment #7)
> And there was no warnings about kernel options during udev's emerge?
> Does modules.dep actually have an entry for "kernel/drivers/scsi/sg.ko"?

No complains:


 * Messages for package sys-fs/udev-197-r8:

 * 
 * udev-197 and newer introduces a new method of naming network
 * interfaces. The new names are a very significant change, so
 * they are disabled by default on live systems.
 * Please see the contents of /etc/udev/rules.d/80-net-name-slot.rules for more
 * information on this feature.
 * You still have /etc/udev/rules.d/70-persistent-net.rules in place from previous udev release.
 * Upstream has removed the possibility of renaming to existing
 * network interfaces. For example, it's not possible to assign based
 * on MAC address to existing interface eth0.
 * See http://bugs.gentoo.org/453494 for more information.
 * Rename your file to something else starting with 70- to silence
 * this warning.
 * 
 * You need to restart udev as soon as possible to make the upgrade go
 * into effect.
 * The method you use to do this depends on your init system.
 * 
 * 
 * For more information on udev on Gentoo, writing udev rules, and
 *          fixing known issues visit:
 *          http://www.gentoo.org/doc/en/udev-guide.xml
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-03-28 17:23:11 UTC
I noticed you have this:

CFLAGS="-O3 -march=k8 -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time"

Reduce that madness to CFLAGS="-O2 -march=k8" and try again. Remember to recompile zlib and xz-utils also with the sane flags, as libkmod gets linked against them.
Comment 11 petr bravenec 2013-03-28 17:29:06 UTC
(In reply to comment #10)
> I noticed you have this:
> 
> CFLAGS="-O3 -march=k8 -funroll-all-loops -fpeel-loops -ftracer
> -funswitch-loops -funit-at-a-time"
> 
> Reduce that madness to CFLAGS="-O2 -march=k8" and try again. Remember to
> recompile zlib and xz-utils also with the sane flags, as libkmod gets linked
> against them.

Nice :-)
It is working now. Thank you.