产品名称Productname文档密级Confidentialitylevel内部公开产品版本ProductversionTotal11pages共11页如何升级Redhat内核和驱动(仅供内部使用)Forinternaluseonly拟制:Preparedby陈义全52925日期:Date2010-1-29审核:Reviewedby日期:Date审核:Reviewedby日期:Date批准:Grantedby日期:Date华为技术有限公司HuaweiTechnologiesCo.,Ltd.版权所有侵权必究Allrightsreserved文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第2页,共11页修订记录Revisionrecord日期Date修订版本Revisionversion修改描述changeDescription作者Author2010-1-301.00初稿完成initialtransmittal陈义全52925文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第3页,共11页目录TableofContents1升级内核...................................................................................................................................41.1自动编译.............................................................................................................................41.2手工编译.............................................................................................................................62升级驱动...................................................................................................................................92.1升级Broadcom5709驱动...................................................................................................92.2升级LSI1068E磁盘控制器驱动........................................................................................10文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第4页,共11页1升级内核1.1自动编译可以从redhat官方网站下载源码rpm包,然后通过rpmbuild命令,自动编译生成内核安装包。操作步骤:1、载Redhat内核源码包如下载RHEL5系列内核源码链接为:内核源码包文件为kernel-2.6.18-128.el5.src.rpm。2、将下载到的源码包文件拷贝到机器上。3、创建mockbuild用户和组[root@houyi-vm33~]#groupaddmockbuild[root@houyi-vm33~]#useraddmockbuild-gmockbuild4、安装内核源码包到系统中[root@houyi-vm33~]#rpm-ivhkernel-2.6.18-128.el5.src.rpmwarning:kernel-2.6.18-128.el5.src.rpm:V3DSAsignature:NOKEY,keyID370171861:kernel###########################################[100%][root@houyi-vm33~]#5、下载unifdef-1.171-5.fc6.src.rpm源码包,生成并安装rpm包。(RHEL4系列系统中必需)(1)安装源码包[root@houyi-vm33~]#rpm-ivhunifdef-1.171-5.fc6.src.rpmwarning:unifdef-1.171-5.fc6.src.rpm:V3DSAsignature:NOKEY,keyID370171861:unifdefwarning:userbrewbuilderdoesnotexist-usingrootwarning:groupbrewbuilderdoesnotexist-usingrootwarning:userbrewbuilderdoesnotexist-usingrootwarning:groupbrewbuilderdoesnotexist-usingroot###########################################[100%](2)编译源码包文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第5页,共11页[root@houyi-vm33~]#cd/usr/src/redhat/SPECS/[root@houyi-vm33SPECS]#lskernel-2.6.specunifdef.spec[root@houyi-vm33SPECS]#rpmbuild-baunifdef.spec(3)安装RPM安装包[root@houyi-vm33SPECS]#rpm-ivh/usr/src/redhat/RPMS/x86_64/unifdef-1.171-5.x86_64.rpmPreparing...###########################################[100%][root@houyi-vm33SPECS]#6、进入/usr/src/redhat/SPECS目录,会发现kernel-2.6.spec文件[root@houyi-vm33~]#cd/usr/src/redhat/SPECS/[root@houyi-vm33SPECS]#lskernel-2.6.specunifdef.spec[root@houyi-vm33SPECS]#pwd/usr/src/redhat/SPECS[root@houyi-vm33SPECS]#7、使用rpmbuild编译内核RPM包[root@houyi-vm33SPECS]#rpmbuild-bakernel-2.6.spec执行上面命令后,在RH2285服务器中编译等待约20分钟,内核RPM安装包制作完成。我们就可以直接使用rpm命令升级到新内核了。……Wrote:/usr/src/redhat/SRPMS/kernel-2.6.18-128.el5.src.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-devel-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-headers-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-debug-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-debug-debuginfo-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-debug-devel-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-xen-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-xen-devel-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-debuginfo-common-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-debuginfo-2.6.18-128.el5.x86_64.rpmWrote:/usr/src/redhat/RPMS/x86_64/kernel-xen-debuginfo-2.6.18-128.el5.x86_64.rpm……文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第6页,共11页常见问题:在编译内核源码过程中,通常会出现以下提示,编译无法正常继续运行。gpg:WARNING:unsafepermissionsonhomedir.gpg:keyring`./secring.gpg'createdgpg:keyring`./pubring.gpg'created++++++++++++++++++++.++++++++++++++++++++.++++++++++.+++++++++++++++++++++++++.++++++++++.+++++++++++++++..++++++++++....++++++++++++++++++++.+++++!.+++++++++++++++...++++++++++.++++++++++.++++++++++.++++++++++++++++++++++++++++++Notenoughrandombytesavailable.PleasedosomeotherworktogivetheOSachancetocollectmoreentropy!(Need276morebytes)解决办法:(1)创建一个大文件[root@houyi-vm33~]#[root@houyi-vm33~]#ddif=/dev/zeroof=zero.imgbs=1Mcount=512(2)将文件内容cat到/dev/null设备中[root@houyi-vm33~]#catzero.img/dev/null(3)将大文件发送到root用户[root@houyi-vm33~]#sendmailroot@rootzero.img一会编译内核就可继续进行。1.2手工编译若希望修改部分内核源码,然后再升级内核,可采用手工编译内核的方式。下载源码和安装RPM源码包步骤同上。操作步骤:1、载Redhat内核源码包2、将下载到的源码包文件拷贝到机器上。文档名称:如何升级Redhat内核和驱动文档密级:内部公开2010-1-30华为机密,未经许可不得扩散第7页,共11页3、创建mockbuild用户和组[root@houyi-vm33~]#groupaddmockbuild[root@houyi-vm33~]#useraddmockbuild-gmockbuild4、安装内核源码包到系统中[root@houyi-vm