1 –在编译网卡之前,先检查网卡使用的网卡驱动模块名。
[root@localhost ~]# cat/etc/modprobe.conf
alias eth0bnx2ß 表明网卡驱动模块名为bnx2
alias eth1 bnx2
alias eth2 bnx2
alias eth3 bnx2
2 – 检查当前是否有已加载网卡驱动模块bnx2
[root@localhost ~]# lsmod| grep bnx2
bnx2179021 0ß 表明系统已有加载完网卡驱动模块
bnx2i40413 0
cnic44877 1 bnx2i
libiscsi242693 6be2iscsi,ib_iser,iscsi_tcp,bnx2i,cxgb3i,libiscsi_tcp
scsi_transport_iscsi237709 8be2iscsi,ib_iser,iscsi_tcp,bnx2i,cxgb3i,libiscsi2
scsi_mod141973 15be2iscsi,ib_iser,iscsi_tcp,bnx2i,cxgb3i,libiscsi2,scsi_transport_iscsi2,scsi_dh,sg,pvscsi,libata,mptspi,mptscsih,scsi_transport_spi,sd_mod
3– 查看当前驱动模块信息,从而得到驱动模块的版本,以便验证稍后网卡驱动模块升级
[root@localhost redhat]# modinfo bnx2
filename:/lib/modules/2.6.18-194.el5/kernel/drivers/net/bnx2.koß 网卡驱动存放的路径,升级后网卡存放路径与此路径不同
version:2.0.2 ß 表明网卡模块版本为2.0.2,是系统默认网卡驱动版本
license:GPL
description:Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver
author:Michael Chan <mchan@broadcom.com>
srcversion:7025AAF3645EE432EAF1C00
alias:pci:v000014E4d0000163Csv*sd*bc*sc*i*
alias:pci:v000014E4d0000163Bsv*sd*bc*sc*i*
alias:pci:v000014E4d0000163Asv*sd*bc*sc*i*
alias:pci:v000014E4d00001639sv*sd*bc*sc*i*
alias:pci:v000014E4d000016ACsv*sd*bc*sc*i*
alias:pci:v000014E4d000016AAsv*sd*bc*sc*i*
alias:pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
alias:pci:v000014E4d0000164Csv*sd*bc*sc*i*
alias:pci:v000014E4d0000164Asv*sd*bc*sc*i*
alias:pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
alias:pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
depends:
vermagic:2.6.18-194.el5 SMP mod_unload 686 REGPARM 4KSTACKSgcc-4.1
parm:disable_msi:Disable Message Signaled Interrupt (MSI)(int)
parm:enable_entropy:Allow bnx2 to populate the /dev/random entropy pool(int)
module_sig:883f3504ba037551e1fa4939f6a62931127b30a0e5a160a7ad7a7b9b2c162b309b3316fddc41f280a0cbecbd80e777d961e16218019c365c4b328d1a8
4 – 从DELL网站下载Broadcom网卡驱动包Bcom_LAN_16.2.0_Linux_Source_A01.tar.gz。解压开始安装
[root@localhost mnt]# tar -vzxf Bcom_LAN_16.2.0_Linux_Source_A01.tar.gzß 解压驱动包
Bcom_LAN_16.2.0_Linux_Source_A01/
Bcom_LAN_16.2.0_Linux_Source_A01/Linux_Readme/
Bcom_LAN_16.2.0_Linux_Source_A01/Linux_Readme/linux_readme.txt
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/ChangeLog
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/README.TXT
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/tg3-3.115j-1.src.rpm
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/tg3-3.115j.tar.gz
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtreme/tg3_sup-3.115j-1.ISO.tar.gz
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/brcm_iscsi_uio-0.6.2.13.tar.gz
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/netxtreme2-6.2.23-1.src.rpm
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/netxtreme2-6.2.23.tar.gz
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/netxtreme2_sup-6.2.23-1.ISO.tar.gz
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/README
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/RELEASE.bnx2.TXT
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/RELEASE.bnx2i.TXT
Bcom_LAN_16.2.0_Linux_Source_A01/NetXtremeII/RELEASE.bnx2x.TXT
[root@localhost mnt]# cdBcom_LAN_16.2.0_Linux_Source_A01ß 进入解压出来的目录
[root@localhost Bcom_LAN_16.2.0_Linux_Source_A01]#lsß 显示文件夹内容
Linux_ReadmeNetXtreme NetXtremeII
[root@localhost Bcom_LAN_16.2.0_Linux_Source_A01]#cdNetXtremeII/ß 进入到网卡驱动资源目录
[root@localhost NetXtremeII]# lsß 显示此目录的内容
brcm_iscsi_uio-0.6.2.13.tar.gzREADME
netxtreme2-6.2.23-1.src.rpmRELEASE.bnx2i.TXT
netxtreme2-6.2.23.tar.gzRELEASE.bnx2.TXT
netxtreme2_sup-6.2.23-1.ISO.tar.gzRELEASE.bnx2x.TXT
[root@localhost NetXtremeII]# rpm -ivh netxtreme2-6.2.23-1.src.rpmß 安装编译网卡所需要的资源
1:netxtreme2########################################### [100%]
***************************************************************************
Note:
(1)–
RPM包netxtreme2-6.2.23-1.src.rpm所包含的内容,及存放的目录
[root@localhost NetXtremeII]# rpm -qlpnetxtreme2-6.2.23-1.src.rpm
/usr/src/redhat/SOURCES/netxtreme2-6.2.23.tar.bz2
/usr/src/redhat/SPECS/netxtreme2.spec
(2)-
Question:
安装netxtreme2-6.2.23-1.src.rpm时会报“error: cannot create %sourcedir/usr/src/redhat/SOURCES”信息。
Cause:
没有安装qlprpm-build-4.4.2.3-18.el5.i386.rpm包。
Resolution:
安装rpm-build,同时关联binutils,elfutils两个包。可解决此问题。
###/usr/src/redhat/SOURCES 此目录是由rpm-build软件包安装生成 ###
[root@localhost redhat]# rpm -qlprpm-build-4.4.2.3-18.el5.i386.rpmß 检查rpm-build软件包所包含的内容
/usr/bin/rpmbuild
/usr/src/redhat
/usr/src/redhat/BUILD
/usr/src/redhat/RPMS
/usr/src/redhat/RPMS/athlon
/usr/src/redhat/RPMS/geode
/usr/src/redhat/RPMS/i386
/usr/src/redhat/RPMS/i486
/usr/src/redhat/RPMS/i586
/usr/src/redhat/RPMS/i686
/usr/src/redhat/RPMS/noarch
/usr/src/redhat/SOURCES
/usr/src/redhat/SPECS
/usr/src/redhat/SRPMS
***************************************************************************
5– 编译网卡驱动
[root@localhost redhat]# rpmbuild -bbSPECS/netxtreme2.spec
Executing(%prep): /bin/sh -e/var/tmp/rpm-tmp.98884
+ umask022
+ cd/usr/src/redhat/BUILD
+LANG=C
+ exportLANG
+ unsetDISPLAY
+ cd/usr/src/redhat/BUILD
+ rm -rfnetxtreme2-6.2.23
+/usr/bin/bzip2 -dc/usr/src/redhat/SOURCES/netxtreme2-6.2.23.tar.bz2
+ tar-xvvf -
drwxr-xr-xroot/root0 2011-02-11 04:25:14 netxtreme2-6.2.23/
drwxr-xr-xroot/root0 2011-02-11 04:25:14 netxtreme2-6.2.23/bnx2x-1.62.15/
…… ß 省略编译过程
Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames)<= 3.0.4-1 rpmlib(PayloadFilesHavePrefix)<= 4.0-1
Requires(post): /bin/sh
Requires(postun): /bin/sh
Checkingfor unpackaged file(s): /usr/lib/rpm/check-files/var/tmp/netxtreme2-buildroot
Wrote:/usr/src/redhat/RPMS/i386/netxtreme2-6.2.23-1.i386.rpmß可以看到生成的网卡驱动RPM包:netxtreme2-6.2.23-1.i386.rpm
Executing(%clean): /bin/sh -e/var/tmp/rpm-tmp.28263
+ umask022
+ cd/usr/src/redhat/BUILD
+ cdnetxtreme2-6.2.23
+ rm -rf/var/tmp/netxtreme2-buildroot/usr/src/redhat/BUILD/file.list.netxtreme2
+ exit0
***************************************************************************
Note:
(1)-
Question:
编译网卡驱动报错,退出编译过程,无法编译成功
[root@localhost redhat]# rpmbuild -bbSPECS/netxtreme2.spec
/var/tmp/rpm-tmp.9077: line 32: make: command notfound
error: Bad exit status from /var/tmp/rpm-tmp.9077(%build)
RPM build errors:
Badexit status from /var/tmp/rpm-tmp.9077 (%build)
Cause:
是因为没有编译环境,或编译环境不全导致。
Resolution:
需要安装RPM包“kernel-devel”和RPM包组"Development Tools"
建议使用YUM环境安装以上RPM包,以解决RPM包关联性问题。安装命令如下:
[root@localhost ~]# yum groupinstall "DevelopmentTools"
[root@localhost ~]# yum installkernel-devel
***************************************************************************
6– 安装已编译好的网卡驱动
[root@localhost redhat]# rpm-ivh RPMS/i386/netxtreme2-6.2.23-1.i386.rpm
Preparing...########################################### [100%]
1:netxtreme2########################################### [100%]
***************************************************************************
Question:
安装编译好的网卡驱动RPM包netxtreme2-6.2.23-1.i386.rpm,检查网卡模块没有更新成功。
Cause:
安装编译好的驱动是有提示信息,表示安装的RPM包文件,与系统以后的文件有冲突
[root@localhost ~]# rpm -ivhnetxtreme2-6.2.23-1.x86_64.rpm
Preparing...########################################### [100%]
file /usr/share/man/man4/bnx2.4.gz from install ofnetxtreme2-6.2.23-1.x86_64 conflicts with file from packagenetxtreme2-5.0.17-1.dkms.noarch
file /usr/share/man/man4/bnx2x.4.gz from install ofnetxtreme2-6.2.23-1.x86_64 conflicts with file from packagenetxtreme2-5.0.17-1.dkms.noarch
会导致/lib/modules/2.6.18-194.el5/updates/目录下,没有新生成的网卡模块bnx2.ko,从而导致网卡升级失败。
Resolution:
# rpm -ivh netxtreme2-6.2.23-1.x86_64.rpm --forceß 使用“--force”参数,是以强制的方式安装,覆盖掉已有文件
即刻运行modinfobnx2,就可确认到网卡升级到新的版本。
***************************************************************************
7– 安装新网卡驱动RPM包后,重新检查已挂载的网卡驱动模块。
[root@localhost redhat]# modinfo bnx2
filename:/lib/modules/2.6.18-194.el5/updates/bnx2.koß 可以看到网卡驱动模块地址已经更新
version:2.0.23bß 可以新网卡驱动版本从2.0.2 升级到2.0.23b
license:GPL
description:Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver
author:Michael Chan <mchan@broadcom.com>
srcversion:6E0DD070AB24C11F50B2712
alias:pci:v000014E4d0000163Csv*sd*bc*sc*i*
alias:pci:v000014E4d0000163Bsv*sd*bc*sc*i*
alias:pci:v000014E4d0000163Asv*sd*bc*sc*i*
alias:pci:v000014E4d00001639sv*sd*bc*sc*i*
alias:pci:v000014E4d000016ACsv*sd*bc*sc*i*
alias:pci:v000014E4d000016AAsv*sd*bc*sc*i*
alias:pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
alias:pci:v000014E4d0000164Csv*sd*bc*sc*i*
alias:pci:v000014E4d0000164Asv*sd*bc*sc*i*
alias:pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
alias:pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
depends:
vermagic:2.6.18-194.el5 SMP mod_unload 686 REGPARM 4KSTACKSgcc-4.1
parm:disable_msi:Disable Message Signaled Interrupt (MSI)(int)
parm:stop_on_tx_timeout:For debugging purposes, prevent a chipreset when a tx timeout occurs (int)
8– 重启系统,在使用modinfo命令,再次验收升级结果,如果显示为新模块,表明升级成功。