安装 displaylink 驱动程序时无法构建 evdi

安装 displaylink 驱动程序时无法构建 evdi

所以我正在尝试安装这个司机启用 displaylink。在 12.04 上,它警告我的内核已过时,因此我安装了 3.14 内核。然后它通过了内核检查,但在构建 evdi 内核时失败。然后我将整个操作系统以及内核升级到 14.04。错误仍然显示。我的终端如下所示:

blaineatkins@ubuntu:~$ cd ~/Downloads
blaineatkins@ubuntu:~/Downloads$ sudo ./displaylink-driver-1.3.54.run
[sudo] password for blaineatkins: 
Verifying archive integrity... All good.
Uncompressing DisplayLink Linux Driver 1.3.54  100%  
DisplayLink Linux Software 1.3.54 install script called: install
Distribution discovered: Ubuntu 14.04.5 LTS
Installing
Configuring EVDI DKMS module
Registering EVDI kernel module with DKMS
Building EVDI kernel module with DKMS
ERROR (code 3): Failed to build evdi/1.3.54. Consult /var/lib/dkms/evdi/1.3.54/build/make.log for details..
blaineatkins@ubuntu:~/Downloads$ 

以下是其中提到的日志内容:

DKMS make.log for evdi-1.3.54 for kernel 3.14.0-031400-generic (x86_64)
Sat Jul 22 10:13:12 PHT 2017
make KBUILD_VERBOSE=1 SUBDIRS=/var/lib/dkms/evdi/1.3.54/build SRCROOT=/var/lib/dkms/evdi/1.3.54/build CONFIG_MODULE_SIG= -C /lib/modules/3.14.0-031400-generic/build modules
make[1]: Entering directory `/usr/src/linux-headers-3.14.0-031400-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
    echo >&2;                           \
    echo >&2 "  ERROR: Kernel configuration is invalid.";       \
    echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
    echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
    echo >&2 ;                          \
    /bin/false)
mkdir -p /var/lib/dkms/evdi/1.3.54/build/.tmp_versions ; rm -f /var/lib/dkms/evdi/1.3.54/build/.tmp_versions/*
make -f scripts/Makefile.build obj=/var/lib/dkms/evdi/1.3.54/build
  gcc -Wp,-MD,/var/lib/dkms/evdi/1.3.54/build/.evdi_drv.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/src/linux-headers-3.14.0-031400-generic/arch/x86/include -Iarch/x86/include/generated  -Iinclude -I/usr/src/linux-headers-3.14.0-031400-generic/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-headers-3.14.0-031400-generic/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-headers-3.14.0-031400-generic/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -fstack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO -Iinclude/drm  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(evdi_drv)"  -D"KBUILD_MODNAME=KBUILD_STR(evdi)" -c -o /var/lib/dkms/evdi/1.3.54/build/.tmp_evdi_drv.o /var/lib/dkms/evdi/1.3.54/build/evdi_drv.c
  if [ "-pg" = "-pg" ]; then if [ /var/lib/dkms/evdi/1.3.54/build/evdi_drv.o != "scripts/mod/empty.o" ]; then /usr/src/linux-headers-3.14.0-031400-generic/scripts/recordmcount  "/var/lib/dkms/evdi/1.3.54/build/evdi_drv.o"; fi; fi;
  gcc -Wp,-MD,/var/lib/dkms/evdi/1.3.54/build/.evdi_modeset.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/src/linux-headers-3.14.0-031400-generic/arch/x86/include -Iarch/x86/include/generated  -Iinclude -I/usr/src/linux-headers-3.14.0-031400-generic/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-headers-3.14.0-031400-generic/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-headers-3.14.0-031400-generic/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -fstack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO -Iinclude/drm  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(evdi_modeset)"  -D"KBUILD_MODNAME=KBUILD_STR(evdi)" -c -o /var/lib/dkms/evdi/1.3.54/build/.tmp_evdi_modeset.o /var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c: In function ‘evdi_crtc_mode_set’:
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:67:10: error: ‘struct drm_crtc’ has no member named ‘primary’
  if (crtc->primary == NULL) {
          ^
In file included from include/drm/drmP.h:45:0,
                 from /var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:14:
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:74:23: error: ‘struct drm_crtc’ has no member named ‘primary’
  efb = to_evdi_fb(crtc->primary->fb);
                       ^
include/linux/kernel.h:833:49: note: in definition of macro ‘container_of’
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                 ^
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:74:8: note: in expansion of macro ‘to_evdi_fb’
  efb = to_evdi_fb(crtc->primary->fb);
        ^
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c: In function ‘evdi_sched_page_flip’:
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:136:11: error: ‘struct drm_crtc’ has no member named ‘primary’
  fb = crtc->primary->fb;
           ^
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c: In function ‘evdi_crtc_page_flip’:
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:192:40: error: ‘struct drm_crtc’ has no member named ‘primary’
   struct drm_framebuffer *old_fb = crtc->primary->fb;
                                        ^
/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.c:200:7: error: ‘struct drm_crtc’ has no member named ‘primary’
   crtc->primary->fb = fb;
       ^
make[2]: *** [/var/lib/dkms/evdi/1.3.54/build/evdi_modeset.o] Error 1
make[1]: *** [_module_/var/lib/dkms/evdi/1.3.54/build] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.14.0-031400-generic'
make: *** [all] Error 2

答案1

您可以通过以下方式解决此问题

  • 从 Ubuntu 14.04 LTS 升级到 Ubuntu 16.04 LTS或者
  • 安装已正式移植到 14.04 LTS 的 16.04 LTS 内核。

我已经测试过了适用于 Ubuntu 的 DisplayLink USB 图形软件 (1.3.54)在运行 64 位版本 14.04 LTS 和 16.04 LTS 的 VirtualBox 虚拟机中。

卸载(或至少停止使用)您手动安装的内核。

您当前正在运行在升级到 14.04 之前在 12.04 中安装的 3.14 内核,因为 14.04 LTS 附带 3.13 内核,而 GRUB 会自动首先列出编号最高的版本并引导到列出的第一个条目。您可以通过运行来验证这一点uname -r。请注意 DisplayLink 构建日志中的顶行:

DKMS make.log for evdi-1.3.54 for kernel 3.14.0-031400-generic (x86_64)

您收到的构建错误似乎特定于您安装的内核。我无法使用官方的 Ubuntu 内核重现它们。

如果您只是为了让此驱动程序工作而安装它,那么我建议您在继续操作之前先卸载它,尽管我无法告诉您如何操作,因为我不知道您是如何安装它的。虽然 DisplayLink 需要内核版本 3.14 或更高版本,但您不需要该版本(它不是 Ubuntu 14.04 官方提供的版本之一)。

我已经在虚拟机中测试了以下两个选项,并且能够成功构建和安装 DisplayLink 驱动程序。

选项 1:升级到 16.04 LTS

您刚刚从 12.04 LTS 升级到 14.04 LTS。如果您没有特别的理由想要继续使用 14.04,那么您应该考虑升级到 16.04。这不仅可以解决这个问题,而且还可以得到更长时间的支持,并且它有其他官方为其打包的新软件。

要升级,请运行:

do-release-upgrade

省略sudo可以更轻松地确保您不会意外升级到错误的版本。(另一种方法是检查/etc/update-manager/release-upgrades是否有Prompt=lts一行没有前导#字符。)它应该说:

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [836 B]
Get:2 Upgrade tool [1,265 kB]
Fetched 1,266 kB in 0s (0 B/s)
authenticate 'xenial.tar.gz' against 'xenial.tar.gz.gpg'
extracting 'xenial.tar.gz'
[sudo] password for blaineatkins:

也就是说,应该说是xenial要升级到的版本。然后您可以输入密码并执行升级。

选项 2:安装反向移植的 4.4 内核

然而,14.04 将继续支持至 2019 年 4 月并且没有理由不使用它。此外,您可能出于各种原因更喜欢继续使用 14.04。特别是,如果您依赖(或只是喜欢)使用 Upstart 而不是 systemd,这可能是继续坚持使用 14.04 一段时间的一个原因。

Ubuntu 的 LTS 版本从 Ubuntu 的后续版本正式移植了内核,以支持新的硬件和驱动程序——你所处的正是这种情况。Ubuntu 16.04 LTS 中的 4.4 内核已正式移植到 14.04 LTS。安装它的一种方法是简单地运行:

sudo apt install linux-generic-lts-xenial

然后重新启动。

以上就是我所要做的全部工作,以便能够无错误地构建和安装 DisplayLink 驱动程序。但是,我的 14.04 系统是虚拟机,没有安装 GUI。

如果这是一个桌面系统(即您正在运行图形桌面环境),然后LTSEnablementStack 建议安装一些其他软件包。这可能有助于您避免以后必须安装软件包的情况。

您可以运行这个命令(然后仍然重新启动):

sudo apt install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial

我将apt-get其改为apt,这样可以产生更易于阅读的输出。(14.04 有apt;一些早期版本没有。)该--install-recommends标志可能是不必要的,因为这是默认设置并且你不太可能改变它,但它不会造成任何伤害。

安装驱动程序

使用官方的 Ubuntu 内核(版本号足够高),安装应该会成功。本节主要针对那些在安装驱动程序方面可能没有像您一样完成的读者。您(以及任何知道如何完成其​​余驱动程序安装的人)不必亲自遵循此部分。

安装依赖项:

sudo apt update
sudo apt install build-essential linux-headers-generic dkms

cd进入解压文件的目录后DisplayLink USB Graphics Software for Ubuntu 1.3.54.zip,运行安装程序:

sudo ./displaylink-driver-1.3.54.run

它必须在后台构建(至少部分)驱动程序,在某些计算机上这可能会很慢,所以如果它没有立即完成,请不要担心。

您应该看到类似这样的输出:

Verifying archive integrity... All good.
Uncompressing DisplayLink Linux Driver 1.3.54  100%
DisplayLink Linux Software 1.3.54 install script called: install
Distribution discovered: Ubuntu 16.04.2 LTS
Installing
Configuring EVDI DKMS module
Registering EVDI kernel module with DKMS
Building EVDI kernel module with DKMS
Installing EVDI kernel module to kernel tree
EVDI kernel module built successfully
Installing x64-ubuntu-1604/DisplayLinkManager
Installing libraries
Installing firmware packages
Installing license file
Adding udev rule for DisplayLink DL-3xxx/5xxx devices

如果您看到类似内容,并且没有错误,则安装成功。我建议在尝试使用 DisplayLink 设备之前重新启动,尽管运行sudo modprobe evdi似乎可以成功加载驱动程序,即使没有中间重新启动。

故障排除

当驱动程序加载到内核时,输出lsmod | grep evdi应该类似于:

evdi                   53248  0
drm_kms_helper        155648  2 evdi,vboxvideo
drm                   364544  5 ttm,evdi,drm_kms_helper,vboxvideo
syscopyarea            16384  3 evdi,drm_kms_helper,vboxvideo
sysfillrect            16384  3 evdi,drm_kms_helper,vboxvideo
sysimgblt              16384  3 evdi,drm_kms_helper,vboxvideo

如果你没有连接 DisplayLink 设备,那么模块可能不会自动加载到内核中。如果已连接,那么应该加载。您可以尝试sudo modprobe evdi。发布有关此驱动程序出现的问题的新问题安装它时,我建议包括完整输出lsmod(即不带| grep evdi)以及uname -a

相关内容