无法为 Linux 驱动程序 Asus PCE-N53(Ralink RT5592 芯片组)编译无线驱动程序

无法为 Linux 驱动程序 Asus PCE-N53(Ralink RT5592 芯片组)编译无线驱动程序

我之前曾在我认为是较旧的内核上编译过此驱动程序。但是我现在使用的是 15.10,无法弄清楚。

dylan@xaelah:~$ uname -r
4.2.0-18-generic

这里是输出sudo lshw

我已经从这里

然后我使用 CD 转到该目录并发出sudo make
以下输出:

make -C tools
make[1]: Entering directory '/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory '/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/tools'
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/tools/bin2h
cp -f os/linux/Makefile.6 /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/Makefile
make -C /lib/modules/4.2.0-18-generic/build SUBDIRS=/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux modules
make[1]: Entering directory '/usr/src/linux-headers-4.2.0-18-generic'
  CC [M]  /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.o
In file included from /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/include/rtmp_os.h:44:0,
                 from /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/include/rtmp_comm.h:69,
                 from /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/include/rt_config.h:33,
                 from /home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c:28:
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c: In function ‘RTMPQueryInformation’:
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c:3953:30: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
    DBGPRINT(RT_DEBUG_TRACE, ("sizeof UCHAR=%d, channel=%d \n", sizeof(UCHAR), p
                              ^
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/include/os/rt_linux.h:665:16: note: in definition of macro ‘DBGPRINT_RAW’
         printk Fmt;               \
                ^
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c:3953:4: note: in expansion of macro ‘DBGPRINT’
    DBGPRINT(RT_DEBUG_TRACE, ("sizeof UCHAR=%d, channel=%d \n", sizeof(UCHAR), p
    ^
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c: In function ‘RTMPIoctlShow’:
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c:4896:85: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
 intf(extra, size, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION, __DATE__, _
                                                                     ^
/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.c:4896:95: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
 , size, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION, __DATE__, __TIME__ );
                                                                     ^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.o' failed
make[2]: *** [/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux/../../sta/sta_cfg.o] Error 1
Makefile:1398: recipe for target '_module_/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux' failed
make[1]: *** [_module_/home/dylan/Downloads/patched-Asus-PCE-N53-linux-driver-master/os/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-18-generic'
Makefile:384: recipe for target 'LINUX' failed
make: *** [LINUX] Error 2

显然我不能sudo make install

我也不担心类型不匹配和其他警告,因为它们出现在之前的版本中,而且它仍然有效。我也试过,sudo make -i但没有成功

我已经下载了构建必需品、内核源代码和头文件...

如果你们还有什么需要,请告诉我。我在谷歌上搜索过,发现类似的问题,但没有解决方案。甚至没有在这个网站上,但没有答案,其他替代方案也不起作用。

任何帮助,将不胜感激!

编辑:

我也尝试运行如下 make -

sudo make RT_CFLAGS="-Wno-error=date-time"

同样的错误....

然后我做了sudo make clean然后跑了sudo make RT_CFLAGS="-Wno-error=date-time" -i 这是 pastbin

答案1

我可以帮她编译:

$ lsb_release -dc
Description:    Ubuntu 15.10
Codename:   wily

$ uname -r
4.2.0-18-generic

建议不要用于sudo编译。如果以下说明失败,也许你应该重新开始。

  1. 克隆了 git 存储库。

    git clone https://github.com/unused/patched-Asus-PCE-N53-linux-driver.git
    
    cd patched-Asus-PCE-N53-linux-driver/
    
  2. 添加-Wno-error=date-time到编译标志

    vim os/linux/config.mk +178
    

    寻找WFLAGS:=

    WFLAGS := -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT  -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs -Wno-error=date-time
    
  3. 编译

    make
    

    至此模块编译成功:

    ls -l os/linux/rt5592sta.ko

    -rw-rw-r-- 1 user user 1767056 Nov 21 10:29 /home/user/Desktop/sand_box/patched-Asus-PCE-N53-linux-driver/os/linux/rt5592sta.ko
    

    modinfo /home/user/Desktop/sand_box/patched-Asus-PCE-N53-linux-driver/os/linux/rt5592sta.ko

    filename:       /home/user/Desktop/sand_box/patched-Asus-PCE-N53-linux-driver/os/linux/rt5592sta.ko
    version:        2.6.0.0_20120326
    srcversion:     150B71061DC1EBE4DE31E22
    alias:          pci:v00001814d00005592sv*sd*bc*sc*i*
    depends:        
    vermagic:       4.2.0-18-generic SMP mod_unload modversions 
    parm:           mac:rt28xx: wireless mac addr (charp)
    

make但我发现脚本试图将其复制到文件夹,这很奇怪/tftpboot。可能是开发人员正在寻找在另一台机器上更新/测试它的快速方法。

LD [M]  /home/user/Desktop/sand_box/patched-Asus-PCE-N53-linux-driver/os/linux/rt5592sta.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-18-generic'
cp -f /home/user/Desktop/sand_box/patched-Asus-PCE-N53-linux-driver/os/linux/rt5592sta.ko /tftpboot
cp: cannot create regular file ‘/tftpboot’: Permission denied
Makefile:384: recipe for target 'LINUX' failed
make: *** [LINUX] Error 1

无论如何,请尝试完成剩余的安装步骤。如果您遇到任何相关问题,请告诉我。

相关内容