编译网卡驱动
操作背景
当裸金属服务器配套有Hi1822网卡硬件且无发行驱动或升级内核后驱动不可用,需要参考本节指导编译Hi1822网卡驱动,以为例进行说明。
前提条件
- 已登录虚拟机。
- 已获取Hi1822驱动源码安装包及管理软件并上传至虚拟机。
- 参考软件准备章节下载源码驱动的zip包。
- 此处以“IN500 solution 5.1.0.SPC213”版本为例,介绍如何获取最终需要的安装包。
操作步骤
具体编译和安装步骤如下:
例如:hinic version: 5.5.0.13
- Compile hinic
- cd hinic
- make
- Make the driver still effective after restarting
- cp hinic.ko /lib/modules/`uname -r`/updates/
note: If the / lib / modules / `uname -r` / updates directory does not exist, create it manually
- depmod `uname -r`
- find the first initramfs file from system startup file /boot/grub/grub.cfg
note: initramfs file follows command 'initrd', and file name usually contains '.img'.
- add hinic driver into initramfs file found in the previous step, for example, the file is initrd.img
- cp hinic.ko /lib/modules/`uname -r`/updates/