更新后 Xubuntu Wifi 驱动程序无法正常工作

更新后 Xubuntu Wifi 驱动程序无法正常工作

我正在运行 Xubuntu 14.04 LTS。我有一个 TP Link T4U USB wifi 适配器,它基于 Realtek RTL8812AU 芯片组。它已经运行了好几个月,直到 Linux 内核 3.13.0-77。从更新到内核 3.13.0-79 开始,此后每次更新,wifi 适配器驱动程序都无法运行。从表面上看,它根本不存在。我可以重新启动并选择内核 3.13.0-77,一切又恢复正常。我修改了我的 grub 菜单,将内核 3.13.0-77 作为我的第一个和默认选项,但我真的很想解决这个问题。

在内核 3.13.0-77 中,以下是输出

    sudo lshw -C network

      *-network
       description: Ethernet interface
       product: 82567LM-3 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: eth1
       version: 02
       serial: b8:ac:6f:1d:64:14
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=2.3.2-k duplex=full firmware=0.4-3 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:48 memory:fdfe0000-fdffffff memory:fdfd9000-fdfd9fff ioport:ece0(size=32)
  *-network
       description: Wireless interface
       physical id: 1
       bus info: usb@1:2
       logical name: wlan1
       serial: c4:e9:84:09:4d:fd
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8812au driverversion=3.13.0-77-generic firmware=N/A ip=192.168.0.46 link=yes multicast=yes wireless=IEEE 802.11AC

有线连接连接到我在桥接模式下运行的旧 802.11G 路由器。如您所见,wifi router=rtl8812au 已列出并且运行正常。

当我重新启动到内核 3.13.0-86(当前更新)时,我得到以下输出

sudo lshw -C 网络

  *-network
   description: Ethernet interface
   product: 82567LM-3 Gigabit Network Connection
   vendor: Intel Corporation
   physical id: 19
   bus info: pci@0000:00:19.0
   logical name: eth1
   version: 02
   serial: b8:ac:6f:1d:64:14
   size: 100Mbit/s
   capacity: 1Gbit/s
   width: 32 bits
   clock: 33MHz
   capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=2.3.2-k duplex=full firmware=0.4-3 ip=192.168.0.40 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
   resources: irq:48 memory:fdfe0000-fdffffff memory:fdfd9000-fdfd9fff ioport:ece0(size=32)

如您所见,wifi 设备甚至没有列出,因为没有可操作的驱动程序。同样,如果我运行 iwconfig,wifi 设备甚至没有列出,也没有在我的 NetworkManager 中列出。但我回到内核 3.13.0-77,一切又正常了。我没有尝试重新安装驱动程序,因为它在较早的内核上运行良好。

在内核 3.13.0-86 中,输出如下

系统盘

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    
Bus 006 Device 002: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for Bluetooth    
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    
Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. Storage device (SD card reader)    
Bus 001 Device 003: ID 2357:0101    
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    
Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply    
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

在内核 3.13.0-77 中看起来是一样的。wifi 适配器连接到总线 001 设备 003(ID 2357:0101)。感谢您的帮助。

答案1

司机rtl8812au在内核版本 3.13.0-xx 中不存在。我确信,为了使其在 -77 中运行,您下载了它并从源代码编译了它。但是,当更新管理器安装更高版本的内核时,在您的例子中是 -79,则需要重新编译。

您可以使用 DKMS 程序自动完成此操作。在互联网连接正常并启动到 -86 的情况下,请执行以下操作:

sudo apt-get update
sudo apt-get install git dkms
git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
sudo dkms add ./rtl8812AU_8821AU_linux
sudo dkms install -m 8812au -v 1.0

你的无线网络应该就可以正常工作了。

答案2

谢谢你的帮助,Chili555,但这并没有解决问题。在 -86 内核中运行时,我一次运行你列出的命令,所有命令都运行正常,直到最后一个命令。命令的输出

sudo dkms install -m 8812au -v 1.0

是:

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
'make'...................
cleaning build area....

DKMS: build completed.

8812au.ko:
Running module version sanity check.
Error! Module version v4.2.2_7502.20130517 for 8812au.ko
is not newer than what is already found in kernel 3.13.0-86-generic (v4.2.2_7502.20130517).
You may override by specifying --force.

depmod....

DKMS: install completed.

因此我重新运行了命令并添加了--force”

sudo dkms install --force -m 8812au -v 1.0

输出为:

Module 8812au/1.0 already installed on kernel 3.13.0-86-generic/i686

因此,对于拥有一个正常运行的驱动程序来说,仍然没有区别。

我查看了你给我的倒数第二条命令。以下是输出:

sudo dkms add ./rtl8812AU_8821AU_linux

Creating symlink /var/lib/dkms/8812au/1.0/source ->
                 /usr/src/8812au-1.0

DKMS: add completed.

接下来我想看看 /var/lib/dkms 里有什么

cd /var/lib/dkms

[/var/lib/dkms]
[home4-randy]:ll
total 16
drwxr-xr-x 3 root root 4096 26.05.2016 23:57 8812au
drwxr-xr-x 3 root root 4096 10.05.2016 10:15 nvidia-304
drwxr-xr-x 3 root root 4096 10.05.2016 10:15 rtl8812AU_8821AU_linux
-rw-r--r-- 1 root root    6 08.07.2008 08:19 dkms_dbversion

[/var/lib/dkms]
[home4-randy]:ll 8812au
total 4
drwxr-xr-x 4 root root 4096 26.05.2016 23:57 1.0
lrwxrwxrwx 1 root root   26 26.05.2016 23:57 kernel-3.13.0-86-generic-i686 -> 1.0/3.13.0-86-generic/i686

[/var/lib/dkms]
[home4-randy]:ll rtl*
total 4
drwxr-xr-x 17 root root 4096 10.05.2016 10:15 1.0
lrwxrwxrwx  1 root root   26 20.09.2015 11:49 kernel-3.13.0-46-generic-i686 -> 1.0/3.13.0-46-generic/i686
lrwxrwxrwx  1 root root   26 10.09.2015 10:23 kernel-3.13.0-63-generic-i686 -> 1.0/3.13.0-63-generic/i686
lrwxrwxrwx  1 root root   26 28.09.2015 23:30 kernel-3.13.0-65-generic-i686 -> 1.0/3.13.0-65-generic/i686
lrwxrwxrwx  1 root root   26 21.10.2015 13:09 kernel-3.13.0-66-generic-i686 -> 1.0/3.13.0-66-generic/i686
lrwxrwxrwx  1 root root   26 05.11.2015 09:12 kernel-3.13.0-67-generic-i686 -> 1.0/3.13.0-67-generic/i686
lrwxrwxrwx  1 root root   26 18.11.2015 14:23 kernel-3.13.0-68-generic-i686 -> 1.0/3.13.0-68-generic/i686
lrwxrwxrwx  1 root root   26 02.12.2015 14:11 kernel-3.13.0-71-generic-i686 -> 1.0/3.13.0-71-generic/i686
lrwxrwxrwx  1 root root   26 31.12.2015 10:33 kernel-3.13.0-74-generic-i686 -> 1.0/3.13.0-74-generic/i686
lrwxrwxrwx  1 root root   26 21.01.2016 18:37 kernel-3.13.0-76-generic-i686 -> 1.0/3.13.0-76-generic/i686
lrwxrwxrwx  1 root root   26 03.02.2016 23:43 kernel-3.13.0-77-generic-i686 -> 1.0/3.13.0-77-generic/i686
lrwxrwxrwx  1 root root   26 04.03.2016 10:49 kernel-3.13.0-79-generic-i686 -> 1.0/3.13.0-79-generic/i686
lrwxrwxrwx  1 root root   26 15.03.2016 23:38 kernel-3.13.0-83-generic-i686 -> 1.0/3.13.0-83-generic/i686
lrwxrwxrwx  1 root root   26 06.04.2016 12:54 kernel-3.13.0-85-generic-i686 -> 1.0/3.13.0-85-generic/i686
lrwxrwxrwx  1 root root   26 10.05.2016 10:15 kernel-3.13.0-86-generic-i686 -> 1.0/3.13.0-86-generic/i686

因此,您让我重建的驱动程序似乎位于目录 /var/lib/dkms/8812au 中。此外,在目录 /var/lib/dkms/rtl8812AU_8821AU_linux 中,已经为我安装的每个内核升级构建了一个 wifi 驱动程序。那么,如果 wifi 驱动程序已经针对内核构建,为什么它不适用于较新的版本?我想知道这些较新的内核中是否存在未反映在驱动程序中的更改,从而导致驱动程序软件过时?

由于这些只是符号链接,我跟着它们往下走...对于您让我编译的版本,这是 make.log 文件:

DKMS make.log for 8812au-1.0 for kernel 3.13.0-86-generic (i686)
Thu May 26 23:57:04 MST 2016
make ARCH=i386 CROSS_COMPILE= -C /lib/modules/3.13.0-86-generic/build M=/var/lib/dkms/8812au/1.0/build  modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-86-generic'
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/os_intfs.o
/var/lib/dkms/8812au/1.0/build/os_dep/linux/os_intfs.c:1702:2: warning: initialization from incompatible pointer type [enabled by default]
  .ndo_select_queue = rtw_select_queue,
  ^
/var/lib/dkms/8812au/1.0/build/os_dep/linux/os_intfs.c:1702:2: warning: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’) [enabled by default]
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/usb_intf.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/usb_ops_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/ioctl_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/xmit_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/mlme_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/recv_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/ioctl_cfg80211.o
/var/lib/dkms/8812au/1.0/build/os_dep/linux/ioctl_cfg80211.c:5109:2: warning: initialization from incompatible pointer type [enabled by default]
  .get_station = cfg80211_rtw_get_station,
  ^
/var/lib/dkms/8812au/1.0/build/os_dep/linux/ioctl_cfg80211.c:5109:2: warning: (near initialization for ‘rtw_cfg80211_ops.get_station’) [enabled by default]
  CC [M]  /var/lib/dkms/8812au/1.0/build/os_dep/linux/rtw_android.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/hal_intf.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/hal_com.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/hal_com_phycfg.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/hal_phy.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/led/hal_usb_led.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/HalPwrSeqCmd.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/Hal8812PwrSeq.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/Hal8821APwrSeq.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_xmit.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_sreset.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_hal_init.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_phycfg.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_rf6052.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_dm.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_rxdesc.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_cmd.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/usb/usb_halinit.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/usb/rtl8812au_led.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/usb/rtl8812au_xmit.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/usb/rtl8812au_recv.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/usb/usb_ops_linux.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/rtl8812a/rtl8812a_mp.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/odm_debug.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/odm_interface.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/odm_HWConfig.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/odm.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/HalPhyRf.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_MAC.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_BB.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_RF.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.o
  CC [M] /var/lib/dkms/8812au/1.0/build/hal/OUTSRC/rtl8821a/odm_RegConfig8821A.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_mp.o
  CC [M]  /var/lib/dkms/8812au/1.0/build/core/rtw_mp_ioctl.o
  LD [M]  /var/lib/dkms/8812au/1.0/build/8812au.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /var/lib/dkms/8812au/1.0/build/8812au.mod.o
  LD [M]  /var/lib/dkms/8812au/1.0/build/8812au.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-86-generic'

然后,我查看了之前使用更新自动构建的 make.log 文件:

DKMS make.log for rtl8812AU_8821AU_linux-1.0 for kernel 3.13.0-86-generic (i686)
Tue May 10 10:15:03 MST 2016
make ARCH=i386 CROSS_COMPILE= -C /lib/modules/3.13.0-77-generic/build M=/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build  modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-77-generic'
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/os_intfs.o
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/os_intfs.c:1702:2: warning: initialization from incompatible pointer type [enabled by default]
  .ndo_select_queue = rtw_select_queue,
  ^
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/os_intfs.c:1702:2: warning: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’) [enabled by default]
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/usb_intf.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/usb_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/xmit_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/mlme_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/recv_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.o
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5099:2: warning: initialization from incompatible pointer type [enabled by default]
  .add_station = cfg80211_rtw_add_station,
  ^
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5099:2: warning: (near initialization for ‘rtw_cfg80211_ops.add_station’) [enabled by default]
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5100:2: warning: initialization from incompatible pointer type [enabled by default]
  .del_station = cfg80211_rtw_del_station,
  ^
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5100:2: warning: (near initialization for ‘rtw_cfg80211_ops.del_station’) [enabled by default]
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5101:2: warning: initialization from incompatible pointer type [enabled by default]
  .change_station = cfg80211_rtw_change_station,
  ^
/var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/ioctl_cfg80211.c:5101:2: warning: (near initialization for ‘rtw_cfg80211_ops.change_station’) [enabled by default]
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/os_dep/linux/rtw_android.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/hal_intf.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/hal_com.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/hal_com_phycfg.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/hal_phy.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/led/hal_usb_led.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/HalPwrSeqCmd.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/Hal8812PwrSeq.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/Hal8821APwrSeq.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_xmit.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_sreset.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_hal_init.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_phycfg.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_rf6052.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_dm.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_rxdesc.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_cmd.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/usb/usb_halinit.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/usb/rtl8812au_led.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/usb/rtl8812au_xmit.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/usb/rtl8812au_recv.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/usb/usb_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/rtl8812a/rtl8812a_mp.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/odm_debug.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/odm_interface.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/odm_HWConfig.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/odm.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/HalPhyRf.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_FW.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_MAC.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_BB.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_RF.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_FW.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_MAC.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_BB.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalHWImg8812A_TestChip_RF.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/HalPhyRf_8812A.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8812a/odm_RegConfig8812A.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_MAC.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_BB.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_RF.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/hal/OUTSRC/rtl8821a/odm_RegConfig8821A.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_mp.o
  CC [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/core/rtw_mp_ioctl.o
  LD [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/8812au.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/8812au.mod.o
  LD [M]  /var/lib/dkms/rtl8812AU_8821AU_linux/1.0/build/8812au.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-77-generic'

我在两次编译中都看到了警告,但不知道它们有多重要。如果您对此有任何进一步的想法,我很乐意听听。谢谢。

答案3

好的,我解决了这个问题。 Chili555 走在正确的轨道上,但它并没有为我解决问题。 我修改了我的 Grub2,以便它默认启动到内核 3.13.0.77,但随着升级到 LTS 16.04(内核 4.4.0.24),即使我启动到 3.13.0.77,我也不再有 wifi 连接。 再看看周围,我从以下位置下载了软件包:

https://github.com/abperiasamy/rtl8812AU_8821AU_linux

将 zip 文件下载到您选择的目录并在那里解压。向下导航一个目录

cd rtl8812AU_8821AU_linux-master

需要安装 dkms。如果没有,请运行:

sudo apt-get install dkms

以下 2 个命令仅需为驱动程序运行一次:

sudo cp -R . /usr/src/8812au-1.0
sudo dkms add -m 8812au -v 1.0

当您需要重建并重新安装驱动程序时(例如,在内核更新后无法与以前的驱动程序兼容),需要运行接下来的两个命令:

sudo dkms build -m 8812au -v 1.0
sudo dkms install -m 8812au -v 1.0

这对我在 Ubuntu 和 Xubuntu 中都有效。我会将此线程标记为已解决!!!

编辑:

好的,我正在编辑这个答案,因为又一次内核升级,我的 wifi 又停止工作了,我按照这里的步骤操作,但仍然不起作用。但我变得更聪明了。首先,我了解到 Windows 中所谓的驱动程序在 Linux 中称为模块,所以我将更改我的命名法。我运行了上面列出的后两个命令来构建和安装模块

sudo dkms build -m 8812au -v 1.0
sudo dkms install -m 8812au -v 1.0

但 Pengy 抱怨说它已经构建并安装好了。我发现实际的驱动程序文件名为 8812au.ko,存储在目录中

 /lib/modules/<kernel-version>/updates/dkms

当前内核版本可以从以下位置找到

 uname -r

删除该文件没有用,因为模块安装在内核中。我可以用 dmesg 检查启动问题:

 dmesg:
 ...
 [    7.849101] 8812au: disagrees about version of symbol filp_open
 [    7.849103] 8812au: Unknown symbol filp_open (err -22)
 [    7.849165] 8812au: disagrees about version of symbol wake_up_process
 [    7.849166] 8812au: Unknown symbol wake_up_process (err -22)
 [    7.849246] 8812au: disagrees about version of symbol filp_close
 [    7.849247] 8812au: Unknown symbol filp_close (err -22)
 ...

这告诉我它至少尝试安装模块,但失败了。我可以用 modinfo 检查模块的参数:

 modinfo 8812au

 filename:       /lib/modules/4.4.0-36-generic/updates/dkms/8812au.ko
 version:        v4.3.8_12175.20140902
 author:         Realtek Semiconductor Corp.
 description:    Realtek Wireless Lan Driver
 license:        GPL
 ......
 vermagic:       4.4.0-34-generic SMP mod_unload modversions 686 
 ......

vermagic 告诉我这是为内核 4.4.0.34 编译的,而我现在运行的是内核 4.4.0.36。Pengy 拿走了旧模块并重新使用了它。这就是它不起作用的原因。我尝试再次制作它,但他抱怨说它已经为这个内核构建了。我尝试再次安装它,他抱怨说它已经安装好了。我尝试使用选项 --force,但 Pengy 似乎认为我指的是 --threes 后面的内容。我可以多次尝试更改不同的参数和选项,但没有任何效果。

我进入 /usr/src/ 目录,发现有 3 个名称不同的目录,但内容相同,用于构建此模块。删除其中两个目录并重新运行第三个目录没有帮助。我采用了上面列出的 4 行,并在前面添加了另外两行,以从内核中删除模块,并删除 /usr/src/ 目录树(在删除模块之前不要删除目录)。我将这 6 行放入名为 rebuild_t4u.sh 的脚本文件中:

 sudo dkms remove -m 8812au -v 1.0 -k $(uname -r);
 sudo rm -rfd /usr/src/8812au-1.0
 sudo cp -R . /usr/src/8812au-1.0
 sudo dkms add -m 8812au -v 1.0
 echo "Rebuilding 8812au -v 1.0....";
 sudo dkms build --force -m 8812au -v 1.0
 echo "Installing 8812au -v 1.0....";
 sudo dkms install --force -m 8812au -v 1.0;

第一行专门用于从当前内核中删除模块,因此如果我需要恢复到以前的内核,它仍然会在那里。

我还修改了文件 dkms.conf,添加了以下行

 MODULES_CONF_ALIAS_TYPE="wlan"

这会将该模块标识为 wlan,并且如果存在其他 wlan(例如 wlan0),则会为其赋予下一个编号。

以下是此次运行的输出:

 sudo dkms build -m rtl8812au -v 1.0
 sudo dkms remove -m 8812au -v 1.0 -k 4.4.0-36-generic;
 sudo rm -rfd /usr/src/8812au-1.0
 sudo cp -R . /usr/src/8812au-1.0
 sudo dkms add -m 8812au -v 1.0

 echo "Rebuilding 8812au -v 1.0....";
 sudo dkms build --force -m 8812au -v 1.0

 echo "Installing 8812au -v 1.0....";
 sudo dkms install --force -m 8812au -v 1.0;

 ./rebuild-t4u-driver.sh

 -------- Uninstall Beginning --------
 Module:  8812au
 Version: 1.0
 Kernel:  4.4.0-36-generic (i686)
 -------------------------------------

 Status: Before uninstall, this module version was ACTIVE on this kernel.

 8812au.ko:
  - Uninstallation
    - Deleting from: /lib/modules/4.4.0-36-generic/
 rmdir: failed to remove '': No such file or directory
  - Original module
    - No original module was found for this module on this kernel.
    - Use the dkms install command to reinstall any previous module      version.

 depmod....

 DKMS: uninstall completed.
 Error! DKMS tree already contains: 8812au-1.0
 You cannot add the same module/version combo more than once.
 Rebuilding 8812au -v 1.0....

 Kernel preparation unnecessary for this kernel.  Skipping...

 Building module:
 cleaning build area....
 'make' KVER=4.4.0-36-generic..................
 cleaning build area....

 DKMS: build completed.
 Installing 8812au -v 1.0....

 8812au:
 Running module version sanity check.
  - Original module
    - No original module exists within this kernel
  - Installation
    - Installing to /lib/modules/4.4.0-36-generic/updates/dkms/

 /etc/modprobe.d/dkms.conf: added alias reference for '8812au'
 depmod....

 DKMS: install completed.

嗯,这看起来很有希望,但它仍然没有运行。尝试了不同的方法后,我输入了经过验证的命令:

 ifconfig wlan0 up

Bing。USB 适配器上的灯立即开始闪烁。所以现在它已打开。但我仍然无法访问 WIFI。我进入网络管理器 GUI,它仍然没有显示任何 WIFI 连接。我尝试了其他几种方法,但都没有奏效,但后来我遇到了以下建议:

 With the computer running, unplug the adapter and plug it in again.

Bing!Bing!Bing!终于成功了。我又能连上 wifi 了!如果我重启了,可能就能连上,但这样就不用重启了(但可能需要更长的时间来解决这个问题)。

因此,总结一下,下载模块包,安装 dkms,修改包中的 dkms.conf 文件以创建别名,获取上述 6 条命令并将它们放在包根目录中的脚本文件中,运行它,运行命令“ifconfig wlan? up”,然后拔下并重新插入适配器或重新启动计算机。此过程应该适用于除 Realtek 之外有类似问题的其他 wifi 适配器。

编辑2:

我重启了好几次,它仍然有效。唯一的问题是,当我发出 ifconfig 或 iwconfig 命令时,正常的设备名称已经改变。您需要创建一个文件

/etc/udev/rules.d/70-persistent-net.rules. 

在其中添加行

SUBSYSTEM=="net",  ACTION=="add",  DRIVERS=="?*",  ATTR{address}=="<MAC-ID>", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="<dev-name>"

其中 MAC-ID 是设备的名称,dev-name 是您想要称呼它的名称。请注意,此文件的旧版本还有一个字段

KERNEL=="wlan*"

新内核不喜欢这样,如果包含该字段,将会忽略整行,因此如果您正在使用此文件的旧版本,请删除此字段。

相关内容