
# 编译网卡驱动
#### 操作背景
当裸金属服务器配套有Hi1822网卡硬件且无发行驱动或升级内核后驱动不可用，需要参考本节指导编译Hi1822网卡驱动。
#### 前提条件
- 已登录虚拟机。
- 已获取Hi1822驱动源码安装包及管理软件并上传至虚拟机。 获取方式如下：
  1. 参考[软件准备](https://support.huaweicloud.com/bpicg-bms/zh-cn_topic_0000001409181017.html#ZH-CN_TOPIC_0000001409181017)章节下载源码驱动的zip包。
  
  2. 此处以"IN500 solution 5.1.0.SPC213"版本为例，介绍如何获取最终需要的安装包。 下载"hinic-5.5.0.13.zip"驱动包并解压，根据Readme.txt步骤编译驱动和安装。
     
   
 
#### 操作步骤
具体编译和安装步骤如下：
例如：hinic version: 5.5.0.13
1. Compile hinic
   1. cd hinic
   
   2. make
    
2. Make the driver still effective after restarting
   1. cp hinic.ko /lib/modules/\`uname -r\`/updates/ note: If the / lib / modules / \`uname -r\` / updates directory does not exist, create it manually
      
   
   2. depmod \`uname -r\`
   
   3. 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'.
      
   
   4. add hinic driver into initramfs file found in the previous step, for example, the file is initrd.img dracut --force-drivers hinic --force /boot/initrd.img
      
    
 
