r8168-dkms 在 ubuntu 16.04.2 上构建失败

r8168-dkms 在 ubuntu 16.04.2 上构建失败

您好,我已经安装了 16.04.2,并且正在尝试安装 realtek 驱动程序。我尝试通过 apt-get 安装它,但它失败并在开始编译时退出。以下是 make 的日志:

  DKMS make.log for r8168-8.041.00 for kernel 4.8.0-36-generic (x86_64)
Thu Feb 16 21:25:44 PST 2017
make: Entering directory '/usr/src/linux-headers-4.8.0-36-generic'
  LD      /var/lib/dkms/r8168/8.041.00/build/built-in.o
  CC [M]  /var/lib/dkms/r8168/8.041.00/build/r8168_n.o
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c: In function ‘rtl8168_fix_features’:
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:4212:30: error: ‘NETIF_F_ALL_CSUM’ undeclared (first use in this function)
                 features &= ~NETIF_F_ALL_CSUM;
                              ^
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:4212:30: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c: In function ‘rtl8168_start_xmit’:
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:24599:12: error: ‘struct net_device’ has no member named ‘trans_start’
         dev->trans_start = jiffies;
            ^
scripts/Makefile.build:289: recipe for target '/var/lib/dkms/r8168/8.041.00/build/r8168_n.o' failed
make[1]: *** [/var/lib/dkms/r8168/8.041.00/build/r8168_n.o] Error 1
Makefile:1491: recipe for target '_module_/var/lib/dkms/r8168/8.041.00/build' failed
make: *** [_module_/var/lib/dkms/r8168/8.041.00/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.8.0-36-generic'

非常感谢您的帮助,因为我不知道如何修复此问题。谢谢。

答案1

您可以通过以下方式从 Yakkety 安装针对 4.8 内核驱动程序的修补程序:

wget http://mirrors.kernel.org/ubuntu/pool/universe/r/r8168/r8168-dkms_8.042.00-2_all.deb
sudo dpkg -i r8168-dkms_8.042.00-2_all.deb

答案2

找到了一种很好的解决方法,即手动安装模块。只需从此处下载模块源即可:http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2

只需使用内核版本高达 4.7 的 LINUX 驱动程序,该驱动程序也适用于 4.8 内核。您只需启动 autorun.sh,它就会为您的以太网适配器编译并安装内核模块。

相关内容