如同bcmwl-kernel-source 在内核上损坏:5.8.0-7630-generic除了我使用的是标准内核之外 - WiFi 在我的 MacBook Air (2013) 上一直没有问题,直到我安装最新的 20.04.2 更新(其中包含内核)5.8.0-34-generic
,之后重新启动也5.4.0-59-generic
无法解决问题。无论如何,详细信息如下;任何帮助都将不胜感激。
lspci -vnn | grep Network
03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter [106b:0117]
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
3: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
5: bnep0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 84:38:35:4a:43:4b brd ff:ff:ff:ff:ff:ff
可以看出,没有无线接口。
sudo lshw -class network
*-network
description: Network controller
product: BCM4360 802.11ac Wireless Network Adapter
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:03:00.0
version: 03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=bcma-pci-bridge latency=0
resources: irq:18 memory:b0600000-b0607fff memory:b0400000-b05fffff
*-network:0
description: Ethernet interface
physical id: 1
logical name: virbr0
serial: 52:54:00:49:bc:05
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.122.1 link=no multicast=yes
*-network:1
description: Ethernet interface
physical id: 2
logical name: bnep0
serial: 84:38:35:4a:43:4b
capabilities: ethernet physical
configuration: broadcast=yes ip=192.168.44.124 multicast=yes
*-network:2 DISABLED
description: Ethernet interface
physical id: 3
logical name: virbr0-nic
serial: 52:54:00:49:bc:05
size: 10Mbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
我为解决该问题所采取的步骤
我跟着安装 Broadcom 无线驱动程序并做了以下事情:
lspci -nn -d 14e4:
显示 PCI.ID 为 14e4:43a0 (rev 03),所以我应该(重新)安装bcmwl-kernel-source
sudo apt purge -y bcmwl-kernel-source
sudo apt autoremove
sudo apt update
sudo update-pciids
sudo apt-get install -y bcmwl-kernel-source
...然后重新启动。
5.8.0-34-generic
我使用和内核执行了所有步骤(第一步除外),5.4.0-59-generic
最后一个命令的输出如下:
5.8.0-34-generic
标准输出:
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
dkms
Suggested packages:
menu
The following NEW packages will be installed:
bcmwl-kernel-source dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,611 kB of archives.
After this operation, 8,364 kB of additional disk space will be used.
Selecting previously unselected package dkms.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 204877 files and directories currently installed.)
Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
Unpacking dkms (2.8.1-5ubuntu1) ...
Selecting previously unselected package bcmwl-kernel-source.
Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Setting up dkms (2.8.1-5ubuntu1) ...
Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.8.0-34-generic
Building for architecture x86_64
Building initial module for 5.8.0-34-generic
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
dpkg: error processing package bcmwl-kernel-source (--configure):
installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
bcmwl-kernel-source
标准错误:
E: Sub-process /usr/bin/dpkg returned an error code (1)
5.4.0-59-generic
标准输出:
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
dkms
Suggested packages:
menu
The following NEW packages will be installed:
bcmwl-kernel-source dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,611 kB of archives.
After this operation, 8,364 kB of additional disk space will be used.
Selecting previously unselected package dkms.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 204877 files and directories currently installed.)
Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
Unpacking dkms (2.8.1-5ubuntu1) ...
Selecting previously unselected package bcmwl-kernel-source.
Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Setting up dkms (2.8.1-5ubuntu1) ...
Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.4.0-59-generic 5.8.0-34-generic
Building for architecture x86_64
Building initial module for 5.4.0-59-generic
This system doesn't support Secure Boot
Secure Boot not enabled on this system.
Done.
wl.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.4.0-59-generic/updates/dkms/
depmod...
DKMS: install completed.
Building initial module for 5.8.0-34-generic
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
dpkg: error processing package bcmwl-kernel-source (--configure):
installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
bcmwl-kernel-source
标准错误:
E: Sub-process /usr/bin/dpkg returned an error code (1)
在这两种情况下,输出建议查看/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log
哪些内容:
DKMS make.log for bcmwl-6.30.223.271+bdcom for kernel 5.8.0-34-generic (x86_64)
Thursday, January 07, 2021 PM01:19:23 CST
make: Entering directory '/usr/src/linux-headers-5.8.0-34-generic'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
AR /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/built-in.a
CC [M] /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o
CC [M] /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o
CC [M] /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_iw.o
CC [M] /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.o
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_attach’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:20: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
593 | if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
| ^~~~~~~~~~~~~~~
| ioremap_cache
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:18: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
593 | if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
| ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_pci_probe’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:780:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
780 | if ((val & 0x0000ff00) != 0)
| ^~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:782:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
782 | bar1_size = pci_resource_len(pdev, 2);
| ^~~~~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:783:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
783 | bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
| ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_reg_proc_entry’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:3376:58: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
3376 | if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
| ^~~~~~~~
| |
| const struct file_operations *
In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:38:
./include/linux/proc_fs.h:102:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
102 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
| ^~~~~~~~~~~~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c: In function ‘osl_reg_map’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
949 | return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
| ^~~~~~~~~~~~~~~
| ioremap_cache
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: warning: returning ‘int’ from a function with return type ‘void *’ makes pointer from integer without a cast [-Wint-conversion]
949 | return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:40:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_set_auth_type’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.h:52:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
52 | if (wl_dbg_level & WL_DBG_DBG) { \
| ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:816:3: note: in expansion of macro ‘WL_DBG’
816 | WL_DBG(("network eap\n"));
| ^~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:817:2: note: here
817 | default:
| ^~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o] Error 1
make: *** [Makefile:1780: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.8.0-34-generic'
与此同时,我的蓝牙可以正常工作,因此我可以通过蓝牙网络共享将我的 Android 设备连接到互联网。但这只是一个临时解决方案,我不想长期依赖它。
答案1
原因很明显。几乎每次 Canonical 推出 HWE 内核时,他们都会忘记bcmwl-kernel-source
在 repos 中进行升级。
你有两个解决方案(使用其中一个,同时使用两个是没有意义的):
bcmwl-kernel-source
从repos安装groovy
。你可以在这里找到它。http://mirrors.kernel.org/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb它将与 5.8 内核一起编译。
下载 deb 并通过以下方式安装
sudo dpkg -i bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb
使用以下命令删除所有 5.8 内核包:
sudo apt remove linux-{image,modules,modules-extra,headers}-5.8.0-36-generic linux-hwe-5.8-headers-5.8.0-36 sudo apt install linux-generic
确保linux-generic
元包已安装。
建议在删除 5.8 内核之前先使用 5.4 内核进行启动。
第二种方案是保留5.4主内核版本,并进行正常的安全升级。
答案2
我设法用内核恢复 WiFi,5.4.0-59-generic
如下所示:
- 清除所有与内核相关的包
5.8.0-34-generic
:sudo apt purge linux-image-5.8.0-34-generic linux-image-unsigned-5.8.0-34-generic linux-modules-5.8.0-34-generic linux-headers-5.8.0-34-generic
- 清除 Broadcom WiFi 驱动程序:
sudo apt purge bcmwl-kernel-source
- 删除多余的包:
sudo apt autoremove
- 暂停内核
5.4.0-59-generic
:sudo apt-mark hold 5.4.0-59-generic
- 更新包元数据:
sudo apt update
- 重新安装驱动程序:
sudo apt install bcmwl-kernel-source
由于5.8.0-34-generic
内核已消失,驱动程序仅针对5.4.0-59-generic
内核进行编译,结果如预期般成功。重启后,WiFi 恢复。
希望一旦解决这个问题,我可以解除内核并像往常一样接收内核更新。
答案3
事实证明,你可以使用 ubuntu 20.10 版本的软件包,并且它运行良好,原始仓库
答案4
Ubuntu 20.04 LTS 内核更新 8.15.34 ~ 36 后 Broadcom Wifi 崩溃
如何知道内核版本?
uname -r
如何知道你的适配器是否崩溃了?
sudo lshw -C network
您将看到崩溃的适配器,其标题如下:
*-网络无人认领
怎么修:
解决方案 1
安装以下设备驱动程序:
选择
如果不起作用,请尝试以下操作:
sudo apt-get purge bcmwl-kernel-source
sudo apt-get install bcmwl-kernel-source
选择 重新安装内核
sudo apt install --reinstall linux-image-$(uname -r)
sudo apt install --reinstall linux-modules-$(uname -r)
sudo apt install --reinstall linux-modules-extra-$(uname -r)
之后再次尝试上述解决方案。