寻觅生命中的那一片浅草......

每日存档 十月 29th, 2010

将阵列卡驱动编辑进initrd.img

CentOS5.4无法识别五舟服务器的阵列卡,每次安装都要手动加载,十分麻烦

今天突发奇想,要把驱动加到安装光盘里,找到这篇文章,太给力了

以下为转载内容

原文见:http://hi.baidu.com/delovery/blog/item/b55c317aa1b329e12e73b33c.html/cmtid/c15bb909a772bc2a6b60fb00

[root@localhost test]# ls
initrd.img rh5.2img.zip
[root@localhost test]# file initrd.img
initrd.img: gzip compressed data, from Unix, last modified: Tue Jun 24 00:53:16 2008, max compression
[root@localhost test]# mv initrd.img initrd.img.gz
[root@localhost test]# ls
initrd.img.gz rh5.2img.zip
[root@localhost test]# gunzip initrd.img.gz
[root@localhost test]# ls
initrd.img rh5.2img.zip
[root@localhost test]# file initrd.img
initrd.img: ASCII cpio archive (SVR4 with no CRC)
[root@localhost test]# mkdir a
[root@localhost test]# ls
a initrd.img rh5.2img.zip
[root@localhost test]# cd a
[root@localhost a]# cpio -dumi < ../initrd.img
14988 blocks
[root@localhost a]# ls
bin dev etc init modules proc sbin selinux sys tmp var
[root@localhost a]# cd modules/
[root@localhost modules]# ls -l
total 4520
-rw-r–r– 1 root root 5791 Jun 24 2008 module-info
-rw-r–r– 1 root root 117885 Jun 24 2008 modules.alias
-rw-r–r– 1 root root 4396775 Jun 24 2008 modules.cgz
-rw-r–r– 1 root root 13152 Jun 24 2008 modules.dep
-rw-r–r– 1 root root 62055 Jun 24 2008 pci.ids
[root@localhost modules]# file modules.cgz
modules.cgz: gzip compressed data, from Unix, last modified: Tue Jun 24 00:53:05 2008, max compression
[root@localhost modules]# cat modules.dep
cciss: scsi_mod
aic94xx: libsas libata scsi_transport_sas scsi_mod
libsas: libata scsi_transport_sas scsi_mod
mptsas: mptscsih mptbase scsi_transport_sas scsi_mod
scsi_transport_sas: scsi_mod
orinoco_plx: orinoco hermes
dm-emc: dm-multipath dm-mod
……………………………..
[root@localhost modules]# mv modules.cgz modules.cgz.gz
[root@localhost modules]# ls
module-info modules.alias modules.cgz.gz modules.dep pci.ids
[root@localhost modules]# gunzip modules.cgz.gz
[root@localhost modules]# ls -lh modules.cgz
-rw-r–r– 1 root root 18M Jun 24 2008 modules.cgz
[root@localhost modules]# cpio -i –verbose –make-directories < modules.cgz
2.6.18-92.el5/x86_64/cciss.ko
2.6.18-92.el5/x86_64/scsi_transport_sas.ko
2.6.18-92.el5/x86_64/orinoco_plx.ko
2.6.18-92.el5/x86_64/dm-multipath.ko
2.6.18-92.el5/x86_64/sundance.ko
2.6.18-92.el5/x86_64/rtl8150.ko
2.6.18-92.el5/x86_64/lock_nolock.ko
2.6.18-92.el5/x86_64/raid1.ko
2.6.18-92.el5/x86_64/vga16fb.ko
……………………………………….
[root@localhost modules]# cd 2.6.18-92.el5/x86_64
[root@localhost x86_64]# ls
3c574_cs.ko dm-zero.ko mptspi.ko sata_via.ko
3c589_cs.ko e1000e.ko msdos.ko sata_vsc.ko
3c59x.ko e1000.ko natsemi.ko scsi_mod.ko
3w-9xxx.ko e100.ko ne2k-pci.ko scsi_transport_fc.ko
3w-xxxx.ko edd.ko netwave_cs.ko scsi_transport_iscsi.ko
8139cp.ko ehci-hcd.ko netxen_nic.ko scsi_tra
……………………….
[root@localhost modules]#cd /test
[root@localhost test]# ls
a initrd.img rh5.2img.zip
[root@localhost test]# unzip rh5.2img.zip
Archive: rh5.2img.zip
creating: rh5.2img/
extracting: rh5.2img/disk-info
inflating: rh5.2img/modinfo
inflating: rh5.2img/modules.alias
inflating: rh5.2img/modules.cgz
extracting: rh5.2img/modules.dep
inflating: rh5.2img/modules.pcimap
inflating: rh5.2img/pci.ids
inflating: rh5.2img/pcitable
inflating: rh5.2img/replace_ahci.sh
inflating: rh5.2img/replace_ahci_readme.txt
extracting: rh5.2img/rhdd
[root@localhost test]# cd rh5.2img
[root@localhost rh5.2img]# ls
disk-info modules.alias modules.dep pci.ids replace_ahci_readme.txt rhdd
modinfo modules.cgz modules.pcimap pcitable replace_ahci.sh
[root@localhost rh5.2img]# more pcitable
0x8086 0x2682 “megasr” “MegaSR|INTEL-ESB2”
0x8086 0x2683 “megasr” “MegaSR|INTEL-ESB2”
0x8086 0x27C3 “megasr” “MegaSR|INTEL-ICH7R”
0x8086 0x2925 “megasr” “MegaSR|LSI-NEC”
0x8086 0x3A25 “megasr” “MegaSR|LSI-ICH10R”
0x1000 0x0055 “megasr” “MegaSR|LSI-1068”
0x1000 0x0057 “megasr” “MegaSR|LSI-1064E”
0x1000 0x0059 “megasr” “MegaSR|LSI-1068E”
[root@localhost rh5.2img]# mv modules.cgz modules.cgz.gz
[root@localhost rh5.2img]# ls
disk-info modules.alias modules.dep pci.ids replace_ahci_readme.txt rhdd
modinfo modules.cgz.gz modules.pcimap pcitable replace_ahci.sh
[root@localhost rh5.2img]# gunzip modules.cgz.gz
[root@localhost rh5.2img]# ls
disk-info modules.alias modules.dep pci.ids replace_ahci_readme.txt rhdd
modinfo modules.cgz modules.pcimap pcitable replace_ahci.sh
[root@localhost rh5.2img]# file modules.cgz
modules.cgz: ASCII cpio archive (SVR4 with CRC)
[root@localhost rh5.2img]# cpio -i –verbose –make-directories < modules.cgz
2.6.18-92.el5xen/x86_64/megasr.ko
2.6.18-92.el5/x86_64/megasr.ko
2.6.18-92.el5xen/i686/megasr.ko
2.6.18-92.el5PAE/i686/megasr.ko
2.6.18-92.el5/i686/megasr.ko
6214 blocks
[root@localhost rh5.2img]# ls
2.6.18-92.el5 modinfo modules.pcimap replace_ahci.sh
2.6.18-92.el5PAE modules.alias pci.ids rhdd
2.6.18-92.el5xen modules.cgz pcitable
disk-info modules.dep replace_ahci_readme.txt
[root@localhost rh5.2img]# cd 2.6.18-92.el5
[root@localhost 2.6.18-92.el5]# ls
i686 x86_64
[root@localhost 2.6.18-92.el5]# cd x86_64/
[root@localhost x86_64]# ls
megasr.ko
[root@localhost x86_64]#cp megasr.ko /test/a/modules/2.6.18-92.el5/x86_64/
下面我们要修改/test/a/modules下的:pci.ids modules.alias modules.info
[root@localhost modules]# vi cpi.ids
[root@localhost modules]#vi modules.alias
在上述文件中加入rh5.2img中cpi.ids和modules.alias modinfo中的内容追加在后面
[root@localhost modules]# ls
2.6.18-92.el5 module-info modules.alias modules.cgz modules.dep pci.ids
[root@localhost modules]# rm -rf modules.cgz
[root@localhost modules]# find 2.6.18-92.el5/ |cpio -H newc -ov |gzip -9 -c – > modules.cgz
[root@localhost modules]# cd ..
[root@localhost a]# ls
bin dev etc init modules proc sbin selinux sys tmp var
[root@localhost a]#find . |cpio -H newc -ov |gzip -9 -c – > /test/b/initrd.img
[root@localhost a]#cd ..
[root@localhost test]# cd b
[root@localhost b]# ls
initrd.img
[root@localhost b]# file initrd.img
initrd.img: gzip compressed data, from Unix, last modified: Sun Sep 13 20:22:37 2009, max compression
到此完成操作,试验结果,待绪

另外有一篇文章也值得一读

http://www.torkwrench.com/2010/01/06/installing-rhel-5-using-the-vmware-paravirtualized-scsi-driver-pvscsi/

2010年十月
« 9月   11月 »
 123
45678910
11121314151617
18192021222324
25262728293031