openEuler 22.03 LTS SP1系统上intel源码编译成rpm包方法

一、intel

环境

安装依赖:

 make 、gcc、kernel-devel、rpmbuild

 kernel-devel 包安装方法

     uname -r //获取内核版本

     yum search kernel-devel --showduplicates //获取和内核相同版本的kernel-devel包名
     
     yum install -y kernel-devel-4.19.90-2112.8.0.0131.oe1.aarch64 //安装软件包

系统版本:

    openEuler 22.03 SP1

i40编译步骤(其它驱动类似)

从官网(https://www.intel.cn/content/www/cn/zh/download-center/home.html)下载2.20.12版本的i40e源码包。搜索i40e,可以看到相关的驱动链接,根据需要进行下载。

  1. tar xf i40e-2.20.12.tar.gz

  2. 按照后面“需要删除的内容”说明删除对应内容

  3. tar zcvf XX.tar.gz i40e-2.20.12

  4. rpmbuild -tb i40e-2.20.12.tar.gz

  5. cd /root/rpmbuild/RPMS/aarch64

  6. yum install -y i40e-2.20.12-1.aarch64.rpm

  7. modinfo i40e //查询驱动已经加载成功

需要删除的内容

i40e

删除/src/linux/auxiliary_bus.h文件中下面内容
image

删除/src/i40e_ethtool.c文件中下面内容
image

ice

删除/src/linux/auxiliary_bus.h文件中下面内容
image

删除/src/ice_ethtool.c文件中的下面内容
image

igb

删除src/igb_ethtool.c文件中的下面内容
image

ixgbe

image

FAQ

问题一:

image

解决方法:

cd /usr/src

ln -s /kernels/2.6.32-431.11.2.el6.x86_64/ linux

1 个赞

那是什么版本的ixgbe驱动,测试ixgbe-5.14.6 不行。

[root@localhost src]# diff ixgbe_ethtool.c  /tmp/ixgbe_ethtool.c 
2c2
< /* Copyright(c) 1999 - 2022 Intel Corporation. */
---
> /* Copyright(c) 1999 - 2021 Intel Corporation. */
1640,1644c1640,1641
< static void
< ixgbe_get_ringparam(struct net_device *netdev,
<                   struct ethtool_ringparam *ring,
<                   struct kernel_ethtool_ringparam __always_unused *ker,
<                   struct netlink_ext_ack __always_unused *extack)
---
> static void ixgbe_get_ringparam(struct net_device *netdev,
>                               struct ethtool_ringparam *ring)
1658,1662c1655,1656
< static int
< ixgbe_set_ringparam(struct net_device *netdev,
<                   struct ethtool_ringparam *ring,
<                   struct kernel_ethtool_ringparam __always_unused *ker,
<                   struct netlink_ext_ack __always_unused *extack)
---
> static int ixgbe_set_ringparam(struct net_device *netdev,
>                              struct ethtool_ringparam *ring)
3090a3085
> #ifdef HAVE_ETHTOOL_COALESCE_EXTACK
3093a3089,3091
> #else
>                             struct ethtool_coalesce *ec)
> #endif
3148a3147
> #ifdef HAVE_ETHTOOL_COALESCE_EXTACK
3151a3151,3153
> #else
>                             struct ethtool_coalesce *ec)
> #endif