ERROR: modinfo: could not find module *

来源:互联网 发布:盖洛普q12数据分析 编辑:程序博客网 时间:2024/05/16 13:48

网友whipper在我的文章“(KVM连载)3.3.4 安装KVM”中提到了在编译KVM后安装时的一些错误提示,我以前也遇到过多次的,这次回答他的问题,简单总结一下吧。

问题描述:在编译内核后,make install 时可能遇到“ERROR: modinfo: could not find module XXX”的新题;命令行中操作看到的内容如下:

View Code BASH
1234567891011121314151617181920212223242526272829
[root@smilejay linux-3.12]# make modules_install  ..........  INSTALL sound/soundcore.ko  INSTALL sound/synth/emux/snd-emux-synth.ko  INSTALL sound/synth/snd-util-mem.ko  INSTALL sound/usb/snd-usb-audio.ko  INSTALL sound/usb/snd-usbmidi-lib.ko  INSTALL sound/usb/usx2y/snd-usb-usx2y.ko  DEPMOD  3.12.0[root@smilejay linux-3.12]# make installsh /root/linux-3.12/arch/x86/boot/install.sh 3.12.0 arch/x86/boot/bzImage \System.map "/boot"ERROR: modinfo: could not find module power_meterERROR: modinfo: could not find module nf_conntrack_ipv4ERROR: modinfo: could not find module nf_defrag_ipv4ERROR: modinfo: could not find module nf_conntrack_ipv6ERROR: modinfo: could not find module nf_defrag_ipv6ERROR: modinfo: could not find module xt_stateERROR: modinfo: could not find module nf_conntrackERROR: modinfo: could not find module i2c_piix4ERROR: modinfo: could not find module sgERROR: modinfo: could not find module ext4ERROR: modinfo: could not find module mbcacheERROR: modinfo: could not find module jbd2ERROR: modinfo: could not find module sr_modERROR: modinfo: could not find module cdromERROR: modinfo: could not find module pata_acpiERROR: modinfo: could not find module ata_genericERROR: modinfo: could not find module ata_piix

原因分析:在make install时,为了让新内核中不缺少所需module,会先检查当前系统已经加载了的module(lsmod命令可查看),然后对比新安装的内核模块,如果新的内核模块中缺少一些module(和当前lsmod命令的输出做对比),就会报“ERROR: modinfo: could not find module power_meter”这样的错误信息。

具体来说,缺少相应module而报错,大致可分为3种情况:
1. 确实是缺少了某个module,其解决方法是:如果报的module对于你来说是有用,检查编译kernel时的.config文件,加上对应的配置(配为=m),重新编译和安装modules即可;如果你觉得这个module没啥用,大可不必管它了。

2. 新编译的kernel已经将该选项编译进kernel了(.config中选择为=Y),从而不需要生成这个module的.ko文件,系统找不到对应的.ko文件,但是已经在新内核中了,不必理会这个报错。例如,上面的“ERROR: modinfo: could not find module ext4”是因为我将EXT4文件系统模块编译为built-in了,如下:

View Code BASH
12345
[root@smilejay linux-3.12]# grep EXT4 .configCONFIG_EXT4_FS=y# CONFIG_EXT4_FS_POSIX_ACL is not set# CONFIG_EXT4_FS_SECURITY is not set# CONFIG_EXT4_DEBUG is not set

3. 模块的名称变了,用当前系统lsmod命令查找的模块名称,在新编译的内核中找不到module了。只需要检查确认即可,如这里的“ERROR: modinfo: could not find module power_meter”就是这种类型,检查方式如下:

View Code BASH
12345678
# 当前系统已经加载了power_meter模块[root@smilejay ~]# lsmod | grep meterpower_meter             9169  1 # 但是kernel 3.12 中该module名称为 acpi_power_meter,和'lsmod'查到的power_meterb不一致。[root@smilejay ~]# find  /lib/ -name "*power_meter.ko"/lib/modules/2.6.32-358.el6.x86_64/kernel/drivers/acpi/power_meter.ko/lib/modules/3.12.0/kernel/drivers/hwmon/acpi_power_meter.ko

最后,如果那些错误报的内核模块,你认为不重要或者都经过上面的分析解决后,你就可以忽略这些错误提示了;尽管有这些“ERROR: modinfo: ”错误提示,但是kernel还是被正确安装了的,往下继续操作使用即可。

0 0