CentOS下X710网卡升级驱动和固件脚本

对于CentOS7.1和7.5版本,安装X710网卡的驱动和固件版本太低,使用会有问题。这边整理了一份脚本自动检测安装,脚本会判断是否是DELL的几款机型,因为DELL机型的驱动和固件不能使用intel官方的,需要使用DELL官方出的

0x00  下载

驱动:i40e-2.7.29.tar.gz (通用)

固件:XL710_NVMUpdatePackage_v6_80_Linux.tar.gz (Intel)

固件:Network_Firmware_3W5Y5_LN_18.8.9_A00.BIN (DELL)

Intel下载地址:Intel-Ethernet-Converged-Network-Adapter-XL710-QDA2

DELL下载地址:Network_Firmware_3W5Y5_LN_18.8.9_A00.BIN

 

0x01  脚本

#!/bin/bash

# @Date :2019-06-12
# @Author :nieyf
# @Name :x710.sh --upgrade X710 drivers and firmware

 
pro_name=`dmidecode | egrep "Product Name" | egrep "PowerEdge" |awk -F " " '{print $4}'`
eth=`lshw -c network -businfo | egrep X710 | head -1 | awk -F " " '{print $2}'`

function drive(){

drive_ver=`ethtool -i $eth | egrep ^version | awk -F " " '{print $2}'`
if [ "$drive_ver"X != "2.7.29"X ];then
tar xf i40e-2.7.29.tar.gz -C /usr/local/src/
cd /usr/local/src/i40e-2.7.29/src/ && make
rmmod i40e && insmod /usr/local/src/i40e-2.7.29/src/i40e.ko
/usr/bin/install -m 644 /usr/local/src/i40e-2.7.29/src/i40e.ko /lib/modules/3.10.0-229.el7.x86_64/kernel/drivers/net/ethernet/intel/i40e/i40e.ko
cat /etc/rc.d/rc.local | egrep -q "rmmod i40e"
if [ $? -ne 0 ];then
echo "rmmod i40e && modprobe i40e" >> /etc/rc.d/rc.local
fi
cat /etc/rc.d/rc.local | egrep -q "systemctl restart network"
if [ $? -ne 0 ];then
echo "systemctl restart network" >> /etc/rc.d/rc.local
fi
else
echo "The driver version is $drive_ver ."
fi

function firmware(){

fw_ver=`ethtool -i $eth | egrep firmware | awk -F " " '{print $2}'`
if [ "$pro_name"X = "R640"X ] || [ "$pro_name"X = "R740xd"X ] || [ "$pro_name"X = "R7425"X ];then
if [ "$fw_ver"X = "f6.81"X ] || [ "$fw_ver"X = "6.80"X ];then
echo "The firmware version is $drive_ver ."
else
cd /tmp/build/XL710_v6_80
echo -e "y\ny\n " | ./Network_Firmware_3W5Y5_LN_18.8.9_A00.BIN -q -f
fi
else
tar xf XL710_NVMUpdatePackage_v6_80_Linux.tar.gz ; cd XL710/Linux_x64/ ; echo -e "a\nn\n " | ./nvmupdate64e -f
fi

}
drive
firmware
}

weinxin
聂扬帆博客
一个分享IT运维相关工作经验和实战技巧的个人博客

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: