因项目需要,将当前内核(2.6.32-220.el6.x86_64)升级到目标内核(2.6.33-110.el6.x86_64),但是编译的目标 内核(2.6.33-110.el6.x86_64)的对应驱动程序并不一定支持当前系统的对应设备。本篇将详细讲述目标内核驱动无法支持当前网卡设备的 处理步骤。

01、编译目标内核
请参考内核编译相关文档(省略)

02、显示所有网卡
由于一个系统可以支持多张网卡,可通过如下命显示当前系统的所有网卡及其基本信息:
#ifconfig -a

em1 Link encap:Ethernet HWaddr EC:F4:BB:D0:0B:60
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

em2 Link encap:Ethernet HWaddr EC:F4:BB:D0:0B:62
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

em3 Link encap:Ethernet HWaddr EC:F4:BB:D0:0B:64
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Memory:dbe80000-dbf00000

03、查看网卡所需驱动

使用ethtool命令可以查看指定网卡所以来的网卡驱动信息:

#ethtool -i em3

driver: igb - 网卡em3依赖igb驱动
version: 3.0.6-k
firmware-version: 1.6-7
bus-info: 0000:08:00.0

注:igb 驱动程序支持所有基于 82575 、 82576 、 82580 和 I350 的千兆位网络连接。

04、查看网卡型号

通过③我们已经知道了网卡所依赖的驱动,但是还不知具体的网卡驱动型号,此时可通过如下命令查询:

# lspci -nn | grep "Eth"

01:00.0 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)
01:00.1 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)
03:00.0 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFP+ Network Connection [8086:154d] (rev 01)
03:00.1 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFP+ Network Connection [8086:154d] (rev 01)
08:00.0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
08:00.1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)

注:Gigabit为千兆 10-Gigabit为万兆

由④的操作可知当前内核(2.6.32-220.el6.x86_64)千兆网络驱动igb支持网卡型号[8086:1521],因此必须要求目标内核(2.6.33-110.el6.x86_64)对该型号网卡[8086:1521]的支持。

05、查看目标内核的网卡驱动是否支持当前型号网卡

可以通过modinfo命令查看*.ko对哪种设备型号的支持,目标内核(2.6.33-110.el6.x86_64)的相关驱动可在/lib/modules/2.6.33-110.el6.x86_64的目录想找到,如下所示:

#modinfo /lib/modules/2.6.33-110.el6.x86_64/kernel/drivers/net/igb/igb.ko

filename: igb.ko
version: 2.1.0-k2
license: GPL
description: Intel(R) Gigabit Ethernet Network Driver
author: Intel Corporation, <e1000-devel@lists.sourceforge.net>
srcversion: 412D1CB4C85682CBF07976F
alias: pci:v00008086d000010D6sv*sd*bc*sc*i*
alias: pci:v00008086d000010A9sv*sd*bc*sc*i*
alias: pci:v00008086d000010A7sv*sd*bc*sc*i*
alias: pci:v00008086d000010E8sv*sd*bc*sc*i*
alias: pci:v00008086d0000150Dsv*sd*bc*sc*i*
alias: pci:v00008086d000010E7sv*sd*bc*sc*i*
alias: pci:v00008086d000010E6sv*sd*bc*sc*i*
alias: pci:v00008086d00001518sv*sd*bc*sc*i*
alias: pci:v00008086d0000150Asv*sd*bc*sc*i*
alias: pci:v00008086d000010C9sv*sd*bc*sc*i*
alias: pci:v00008086d00001516sv*sd*bc*sc*i*
alias: pci:v00008086d00001511sv*sd*bc*sc*i*
alias: pci:v00008086d00001510sv*sd*bc*sc*i*
alias: pci:v00008086d0000150Fsv*sd*bc*sc*i*
alias: pci:v00008086d0000150Esv*sd*bc*sc*i*
depends:
vermagic: 2.6.33-110.el6.x86_64 SMP mod_unload modversions

从以上信息中找不到[8086:1521]的信息,因此,目标内核(2.6.33-110.el6.x86_64)网卡驱动不支持当前网卡!

06、到官网下载网卡驱动
    
既然已经明确了目标内核的网卡驱动并不支持当前的网卡设备,也就是说一旦启用新的内核,将导致系统无法正常使用网络功能。如果是英特尔的网卡设备,则可
到:http://www.intel.cn/content/www/cn/zh/homepage.html 下载所需的驱动源码到本地。

07、编译网卡驱动
解压驱动源码后,按照以下命令格式编译驱动源码:
#make BUILD_KERNEL=2.6.33-110.el6.x86_64
以上命令将会生成网卡驱动igb.ko。其中BUILD_KERNEL指明需要为哪个内核编译驱动,默认是给当前正在运行的内核编译,在此我们设定为目标内核(2.6.33-110.el6.x86_64)。那么又该如何查看新生成的网卡驱动igb.ko是否支持当前的网卡设备呢?

08、检查网卡驱动是否支持当前网卡
步骤⑦将会生成网卡驱动igb.ko,这时可通过modinfo命令验证该驱动是否支持网卡设备[8086:1521],如下所示:
#modinfo igb.ko
filename: igb.ko
version: 5.2.9.4
license: GPL
description: Intel(R) Gigabit Ethernet Network Driver
author: Intel Corporation, <e1000-devel@lists.sourceforge.net>
srcversion: E377200391EBF74638FEDA2
alias: pci:v00008086d000010D6sv*sd*bc*sc*i*
......

......
alias: pci:v00008086d00001522sv*sd*bc*sc*i*
alias: pci:v00008086d00001521sv*sd*bc*sc*i*
alias: pci:v00008086d00001539sv*sd*bc*sc*i*
......
depends: hwmon
vermagic: 2.6.33-110.el6.x86_64 SMP mod_unload modversions
parm: InterruptThrottleRate:Maximum interrupts per second, per vector, (max 100000), default 3=adaptive (array of int)
parm: IntMode:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2 (array of int)
parm: Node:set the starting node to allocate memory on, default -1 (array of int)
parm: LLIPort:Low Latency Interrupt TCP Port (0-65535), default 0=off (array of int)
parm: LLIPush:Low Latency Interrupt on TCP Push flag (0,1), default 0=off (array of int)
parm: LLISize:Low Latency Interrupt on Packet Size (0-1500), default 0=off (array of int)
parm: RSS:Number of Receive-Side Scaling Descriptor Queues (0-8), default 1, 0=number of cpus (array of int)
parm: VMDQ:Number of Virtual Machine Device Queues: 0-1 = disable, 2-8 enable, default 0 (array of int)
parm: max_vfs:Number of Virtual Functions: 0 = disable, 1-7 enable, default 0 (array of int)
parm: MDD:Malicious Driver Detection (0/1), default 1 = enabled. Only available when max_vfs is greater than 0 (array of int)
parm: QueuePairs:Enable Tx/Rx queue pairs for interrupt handling (0,1), default 1=on (array of int)
parm: EEE:Enable/disable on parts that support the feature (array of int)
parm: DMAC:Disable or set latency for DMA Coalescing ((0=off, 1000-10000(msec), 250, 500 (usec)) (array of int)
parm: LRO:Large Receive Offload (0,1), default 0=off (array of int)
parm: debug:Debug level (0=none, ..., 16=all) (int)
终于在显示的信息中找到了[8086:1521]信息,说明新生成的驱动文件能够支持当前网卡型号。那么如何让目标内核(2.6.33-110.el6.x86_64)能够载入新驱动呢?

09、更新目标内核驱动
首先,将新驱动igb.ko拷贝到目标内核/lib/modules/2.6.33-110.el6.x86_64下的指定目录
#cp igb.ko /lib/modules/2.6.33-110.el6.x86_64/kernel/drivers/net/igb/
其次,使用depmod更新目标内核(2.6.33-110.el6.x86_64)模块的依赖关系
#depmod -a 2.6.33-110.el6.x86_64

10、以上工作完成后,可以重启系统了!

LINUX内核升级-更新网卡驱动的更多相关文章

  1. 【转】 linux内核移植和网卡驱动(二)

    原文网址:http://blog.chinaunix.net/uid-29589379-id-4708911.html 一,内核移植步骤: 1, 修改顶层目录下的Makefile ARCH       ...

  2. LINUX 内核移植以及网卡驱动添加

    我用的板子是sama5d3xek,原来板子内核是linux-at91-3.13,升级使用linux-at91-4.10 首先去官网下载一个linux—at91-4.10压缩包,然后在ubuntu里解压 ...

  3. 基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四)

    作者信息 作者: 彭东林 邮箱:pengdonglin137@163.com QQ:405728433 平台简介 开发板:tiny4412ADK + S700 + 4GB Flash 要移植的内核版本 ...

  4. linux内核升级图文攻略(转)

    一.Linux内核概览Linux是一个一体化内核(monolithic kernel)系统.设备驱动程序可以完全访问硬件.Linux内的设备驱动程序可以方便地以模块化(modularize)的形式设置 ...

  5. linux内核升级图文攻略

    Linux内核概览 Linux是一个一体化内核(monolithic kernel)系统. 设备驱动程序可以完全访问硬件. Linux内的设备驱动程序可以方便地以模块化(modularize)的形式设 ...

  6. linux 内核升级2 转

    linux内核升级 一.Linux内核概览 Linux是一个一体化内核(monolithic kernel)系统. 设备驱动程序可以完全访问硬件. Linux内的设备驱动程序可以方便地以模块化(mod ...

  7. Linux内核升级修复系统漏洞-RHSA-2017:2930-Important: kernel security and bug fix update

    公司使用的阿里云服务器(Centos7.4 x86_64bit)内核版本为:3.10.0-693.21.1.el7.x86_64, 2019年3月4日 02:07:58通过云盾安骑士-->漏洞管 ...

  8. linux 内核升级

    LINUX 内核升级 linux 内核官网 https://www.kernel.org/ POST BIOS(boot sequence) 所选择的启动设备次序的MBR中是否有引导程序, ----& ...

  9. 从Linux内核升级的必要性说开去

    Linux内核更新超级频繁,可是有必要时刻升级吗?个人感觉没有必要,可是你要时刻关注新特性列表,然后把自己的内核升级到离最新版本号差一两个月公布的版本号而不是最新版本号.以保证稳定性,由于一两个月的时 ...

随机推荐

  1. Java高级架构师(一)第21节:通过X-gen生成商品模块

    package com.sishuok.architecture1.goodsmgr.vo; import com.sishuok.architecture1.common.vo.BaseModel; ...

  2. Scala实战高手****第13课:Scala模式匹配实战和Spark源码鉴赏

    package com.dt.spark.scala.bascis class Dataframework case class Computerframework (name:String,popu ...

  3. Android 中AlarmManager升级4.2

  4. sql server线程等待信息

    http://www.cnblogs.com/lyhabc/articles/3236984.html http://blog.csdn.net/isoleo/article/details/4547 ...

  5. 我们知道写入过程比ZooKeeper集合中的读取过程要贵,因为所有节点都需要在数据库中写入相同的数据。因此,对于平衡的环境拥有较少数量(例如3,5,7)的节点比拥有大量的节点要好。

    我们知道写入过程比ZooKeeper集合中的读取过程要贵,因为所有节点都需要在数据库中写入相同的数据.因此,对于平衡的环境拥有较少数量(例如3,5,7)的节点比拥有大量的节点要好. 组件 描述 写入( ...

  6. powerbuilder webbrowser 内嵌浏览器 select下拉框无法使用

        Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MA ...

  7. pandas判断缺失值的办法

    参考这篇文章: https://blog.csdn.net/u012387178/article/details/52571725 python pandas判断缺失值一般采用 isnull(),然而 ...

  8. mipmap of unity

    遇到个奇怪的事情 mipmap generation 0级不压缩 1级 4个合1个 在unity里面 明显开了 mipmapgenerate之后 level0变糊了 ================ ...

  9. 关于Linux开源项目基础组件make编译流程

     关于Linux开源项目基础组件make编译流程 非常多Linux开源项目都会用到编译出可运行文件的make.这个是有一套流程的. 首先,GNU构建系统:https://en.wikipedia. ...

  10. Web学习篇之---css基础知识(一)

    css基础知识(一) 1.css样式: 载入css样式有下面四种: 1).外部样式 2).内部样式 3).行内样式 4).导入样式 <link href="layout.css&quo ...