[root@localhost test]# ls
initrd.img
[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
[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
[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 2010, 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]# cpio -i --verbose --make-directories < modules.cgz
2.6.18-194.el5/x86_64/cciss.ko
2.6.18-194.el5/x86_64/scsi_transport_sas.ko
2.6.18-194.el5/x86_64/orinoco_plx.ko
2.6.18-194.el5/x86_64/dm-multipath.ko
2.6.18-194.el5/x86_64/sundance.ko
..............................................
[root@localhost modules]# cd 2.6.18-194.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
............................
[root@localhost modules]#cd /test
[root@localhost test]# ls
a initrd.img rh5.2img.zip
[root@localhost rh5.2img]# cd 2.6.18-194.el5
[root@localhost 2.6.18-194.el5]# ls
x86_64
[root@localhost 2.6.18-194.el5]# cd x86_64/
[root@localhost x86_64]# ls
pm8001.ko
[root@localhost x86_64]#cp pm8001.ko /test/a/modules/2.6.18-194.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-194.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-194.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 Aug 13 20:22:37 2010, max compression
到此完成操作,试验结果,待绪
阅读(1886) | 评论(0) | 转发(0) |