我有 rtl8812au (v4.3.14) 和 rtl8814au (v4.3.21) USB 无线网络适配器的 github dkms 内核驱动程序,它们在 17.04 中运行良好,但在升级到 17.10 时无法构建。这两个驱动程序都基于类似的代码,并且无法以类似的方式构建。
我不知道是新的 gcc 编译器还是新的 4.13 内核导致了这个问题。可能只需要对它进行一些小的调整就可以Makefile
解决错误。
如果我使用标准make
命令而不是正常dkms add/build/install
序列,我可以很容易地看到错误。
以下是 rtl8812au 代码版本 4.3.14 的错误(比当前 Ubuntu 存储库中的版本更新)...
user@Satellite-E55:~/src/rtl8812AU$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.13.0-16-generic/build M=/home/user/src/rtl8812AU modules
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-16-generic'
CC [M] /home/user/src/rtl8812AU/core/rtw_cmd.o
In file included from /home/user/src/rtl8812AU/include/drv_types.h:32:0,
from /home/user/src/rtl8812AU/core/rtw_cmd.c:22:
/home/user/src/rtl8812AU/include/osdep_service.h: In function ‘thread_enter’:
/home/user/src/rtl8812AU/include/osdep_service.h:343:2: error: implicit declaration of function ‘allow_signal’; did you mean ‘do_signal’? [-Werror=implicit-function-declaration]
allow_signal(SIGTERM);
^~~~~~~~~~~~
do_signal
/home/user/src/rtl8812AU/include/osdep_service.h: In function ‘flush_signals_thread’:
/home/user/src/rtl8812AU/include/osdep_service.h:353:6: error: implicit declaration of function ‘signal_pending’; did you mean ‘timer_pending’? [-Werror=implicit-function-declaration]
if (signal_pending (current))
^~~~~~~~~~~~~~
timer_pending
/home/user/src/rtl8812AU/include/osdep_service.h:355:3: error: implicit declaration of function ‘flush_signals’; did you mean ‘do_signal’? [-Werror=implicit-function-declaration]
flush_signals(current);
^~~~~~~~~~~~~
do_signal
cc1: some warnings being treated as errors
scripts/Makefile.build:302: recipe for target '/home/user/src/rtl8812AU/core/rtw_cmd.o' failed
make[2]: *** [/home/user/src/rtl8812AU/core/rtw_cmd.o] Error 1
Makefile:1546: recipe for target '_module_/home/user/src/rtl8812AU' failed
make[1]: *** [_module_/home/user/src/rtl8812AU] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.13.0-16-generic'
Makefile:1576: recipe for target 'modules' failed
make: *** [modules] Error 2
user@Satellite-E55:~/src/rtl8812AU$
所引用的代码osdep_service.h
如下所示...
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
daemonize("%s", name);
#endif
allow_signal(SIGTERM);
#endif
#ifdef PLATFORM_FREEBSD
printf("%s", "RTKTHREAD_enter");
#endif
}
__inline static void flush_signals_thread(void)
{
#ifdef PLATFORM_LINUX
if (signal_pending (current))
{
flush_signals(current);
}
#endif
rtl8814au 的错误和代码看起来很相似,所以除非被请求/要求,否则我不会发布它们。
请帮忙。我想让我的无线网络恢复在线。
答案1
您可以尝试:
git clone https://github.com/zebulon2/rtl8814au.git
cd rtl8814au
make
sudo make install
sudo modprobe 8814au
它在我的 17.10 系统上完美运行。我不确定是否可以推荐 dkms 进程,因此内核更新需要重新编译。
答案2
感谢@chili555 为我指明了正确的方向。链接中提到的 rtl8814au 驱动程序git clone
适用于 17.10,而同一作者还有一个可以运行的 rtl8812au 驱动程序,也适用于 17.10。
从记忆里...
rtl8812au (Edimax EW-7822UAC)
sudo git clone https://github.com/zebulon2/rtl8812au-driver-5.2.9.git
note: dkms.conf file already included
sudo cp -r rtl8812au-driver-5.2.9 /usr/src/rtl8812au-5.2.9
sudo dkms add rtl8812au/5.2.9
sudo dkms build rtl8812au/5.2.9
sudo dkms install rtl8812au/5.2.9
dkms status
rtl8814au(Edimax EW-7833UAC 和 D-Link DWA-192)
sudo git clone https://github.com/zebulon2/rtl8814au.git
create dkms.conf and add these lines...
----
# rtl8814AU-4.3.21_17997.20160531
#
#
PACKAGE_NAME="rtl8814au"
PACKAGE_VERSION="4.3.21_17997.20160531"
MAKE[0]="'make' all KVER=${kernelver}"
BUILT_MODULE_NAME[0]="8814au"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="YES"
REMAKE_INITRD="NO"
----
sudo cp -r rtl8814au /usr/src/rtl8814au-4.3.21
sudo dkms add rtl8814au/4.3.21
sudo dkms build rtl8814au/4.3.21
sudo dkms install rtl8814au/4.3.21
dkms status