百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> Linux kernel在“make install”时的问题分析总结
分享文章到:

Linux kernel在“make install”时的问题分析总结

发布时间:01/15 来源: 浏览: 关键词:
编译KVM后安装时的经常有错误提示,make install 也可能会遇到类似的 “ERROR: modinfo: could not find module XXX”的问题,现在我们来分析一些这些问题然后解决掉。

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

 代码如下
[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 install
sh /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_meter
ERROR: modinfo: could not find module nf_conntrack_ipv4
ERROR: modinfo: could not find module nf_defrag_ipv4
ERROR: modinfo: could not find module nf_conntrack_ipv6
ERROR: modinfo: could not find module nf_defrag_ipv6
ERROR: modinfo: could not find module xt_state
ERROR: modinfo: could not find module nf_conntrack
ERROR: modinfo: could not find module i2c_piix4
ERROR: modinfo: could not find module sg
ERROR: modinfo: could not find module ext4
ERROR: modinfo: could not find module mbcache
ERROR: modinfo: could not find module jbd2
ERROR: modinfo: could not find module sr_mod
ERROR: modinfo: could not find module cdrom
ERROR: modinfo: could not find module pata_acpi
ERROR: modinfo: could not find module ata_generic
ERROR: 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了,如下:

 代码如下
[root@smilejay linux-3.12]# grep EXT4 .config
CONFIG_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”就是这种类型,检查方式如下:

 代码如下
# 当前系统已经加载了power_meter模块
[root@smilejay ~]# lsmod | grep meter
power_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还是被正确安装了的,往下继续操作使用即可。

 

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有6人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板