无法在内核高于 5.8 的 ubuntu 上安装 Broadcom BCM43142。*

无法在内核高于 5.8 的 ubuntu 上安装 Broadcom BCM43142。*

最近我将内核更新到 5.10,发现我的 wifi 无法使用。因此我尝试重新安装 DKMS 驱动程序,但仍然失败,输出如下:

root@Home:~# sudo dkms build broadcom-sta/6.30.223.271

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.10.0-15.2-liquorix-amd64 KVER=5.10.0-15.2-liquorix-amd64...(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.10.0-15.2-liquorix-amd64 is not supported
Error! Bad return status for module build on kernel: 5.10.0-15.2-liquorix-amd64 (x86_64)
Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more information.

make.log 的输出

root@Home:~# cat /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log
DKMS make.log for broadcom-sta-6.30.223.271 for kernel 5.10.0-15.2-liquorix-amd64 (x86_64)
Wednesday 17 February 2021 09:41:40 AM IST
CFG80211 API is prefered for this kernel version
Makefile:89: Neither CFG80211 nor Wireless Extension is enabled in kernel
KBUILD_NOPEDANTIC=1 make -C /lib/modules/5.10.0-15.2-liquorix-amd64/build M=`pwd`
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-15.2-liquorix-amd64'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
Kernel architecture is X86_64
  CC [M]  /var/lib/dkms/broadcom-sta/6.30.223.271/build/src/shared/linux_osl.o
  CC [M]  /var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.o
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c: In function ‘wl_pci_probe’:
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:787:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  787 |  if ((val & 0x0000ff00) != 0)
      |  ^~
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:789:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  789 |   bar1_size = pci_resource_len(pdev, 2);
      |   ^~~~~~~~~
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c: In function ‘wl_ioctl’:
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:1666:6: error: implicit declaration of function ‘segment_eq’ [-Werror=implicit-function-declaration]
 1666 |  if (segment_eq(get_fs(), KERNEL_DS))
      |      ^~~~~~~~~~
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:1666:17: error: implicit declaration of function ‘get_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
 1666 |  if (segment_eq(get_fs(), KERNEL_DS))
      |                 ^~~~~~
      |                 sget_fc
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:1666:27: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 1666 |  if (segment_eq(get_fs(), KERNEL_DS))
      |                           ^~~~~~~~~
      |                           KERNFS_NS
/var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.c:1666:27: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/broadcom-sta/6.30.223.271/build/src/wl/sys/wl_linux.o] Error 1
make[1]: *** [Makefile:1813: /var/lib/dkms/broadcom-sta/6.30.223.271/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-15.2-liquorix-amd64'
make: *** [Makefile:181: all] Error 2

请注意,我使用内核 5.9* 和主流内核的普通版本得到了相同的结果。我甚至尝试了 5.11 版本,但仍然失败。现在,如果我需要使用 wifi,我必须启动到 5.8.18 内核。

编辑:忘记提及操作系统的详细信息

OS: Kubuntu 20.10 x86_64
Kernel: 5.10.0-15.2-liquorix-amd64 

答案1

在终端做

wget http://mirrors.kernel.org/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb
sudo dpkg -i bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb
重启

此版本应该支持 5.10

然后sudo apt remove bcmwl-kernel-source

wget http://mirrors.kernel.org/ubuntu/pool/multiverse/b/broadcom-sta/broadcom-sta-dkms_6.30.223.271-15_all.deb
sudo dpkg -i broadcom-sta-dkms_6.30.223.271-15_all.deb

重启

相关内容