modprobe

1. 加载一个驱动四种途径

  1. kernel kernel.org make menuconfig 定制kernel加载的驱动模块

  2. initrd mkinitrd 打包initrd加载的驱动模块

  3. /etc/rc.d/rc.sysinit 其他的驱动

  4. /etc/modprobe.conf 放跟启动无关的驱动,被rc.sysinit调用  /RHEL6中已无被dracut取代

2.modprobe取代了insmod

  1.modprobe可以加载依赖模块

  2.在注册文件中查找   depmod注册

  3.modprobe -r 删除模块

  

 

On RHEL6, dracut is introduced instead of mkinitrd, then users will have to understand some difference with them to manage their systems.  

  • changing package mkinitrd to dracut (this information has been in release notes and migration guide)
  • there isn't /etc/modprobe.conf by default
  • needing to add kernel parameter 'rdloaddriver' to order module loading instead of 'scsi_hostadapter'
  • loading all drivers to initramfs by default

上面那幾點主要說明

  • 工具 mkinitrd​​​​​​ ​​​​​​ ( /etc/modprobe.conf 為 mkinitrd 所需要參考的檔案)已​​​​​​​經被 ​​​​​​​dracut 取​​​​​​​代​​​​​​​了

  • 預設已經沒有 /etc/modprobe.conf 這個檔案存在了

  • 以前透過 /etc/modprobe.conf 的 scsi_hostadapter 來決定模組的載入先後順序,現在改成為由核心參數 rdloaddriver 來取代.

  • 預設系統上所有的裝置模組(驅動程式) 都會載入在 initramfs (以前稱為 initrd) 裡面.

上 RedHat 官方網站查看 RHEL 6 的 Migration Planning Guide 裡面也提到 /etc/modprobe.conf 不再使用的問題.那 dracut 要怎麼用呢!!

[root@benjr ~]# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-new.img
[root@benjr ~]#
dracut --force /boot/initramfs-$(uname -r).img $(uname -r)

透過指令 dracut 就可以建構出全新的 initramfs ,但是要像 /etc/modprobe.conf 可以指定模組的載入先後順序,必須加在 /boot/grub/menu.lst 檔案的核心參數

 

posted @ 2013-04-06 14:51  屁屁熊  阅读(472)  评论(0编辑  收藏  举报