kali 3.14 安装RT3070 无线网卡驱动

最近对无线安全比较感兴趣,买了个无线网卡,RT3070的芯片,去官网下了个linux的驱动,编译安装

rar, bunzip2, tar解压,随便说一下,tar解压时需要自己重命名,改为.tar的后缀

修改os/linux/ 下的config 文件

# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y


# Support Native WpaSupplicant for Network Maganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y


编译

编译直接报错

root@localhost:~/Desktop/LINUX/2011#
root@localhost:~/Desktop/LINUX/2011#
root@localhost:~/Desktop/LINUX/2011# make
make -C tools
make[1]: Entering directory `/root/Desktop/LINUX/2011/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/root/Desktop/LINUX/2011/tools'
/root/Desktop/LINUX/2011/tools/bin2h

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

In file included from /root/Desktop/LINUX/2011/include/os/rt_linux.h:56:0,
                 from /root/Desktop/LINUX/2011/include/rtmp_os.h:44,
                 from /root/Desktop/LINUX/2011/include/rtmp_comm.h:60,
                 from /root/Desktop/LINUX/2011/os/linux/../../os/linux/sta_ioctl.c:30:
/root/Desktop/LINUX/2011/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_giwscan’:
/usr/src/linux-headers-3.14-kali1-common/include/net/iw_handler.h:542:3: warning: array subscript is below array bounds [-Warray-bounds]
  CC [M]  /root/Desktop/LINUX/2011/os/linux/../../os/linux/rt_linux.o
/root/Desktop/LINUX/2011/os/linux/../../os/linux/rt_linux.c: In function ‘__RtmpOSFSInfoChange’:
/root/Desktop/LINUX/2011/os/linux/../../os/linux/rt_linux.c:1126:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
/root/Desktop/LINUX/2011/os/linux/../../os/linux/rt_linux.c:1127:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
make[4]: *** [/root/Desktop/LINUX/2011/os/linux/../../os/linux/rt_linux.o] Error 1
make[3]: *** [_module_/root/Desktop/LINUX/2011/os/linux] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.14-kali1-686-pae'
make: *** [LINUX] Error 2
root@localhost:~/Desktop/LINUX/2011#


网上搜索了一把,百度现在的搜索体验真是烂到极点了,有意义的东西完全被淹没了,不知道百度的工程师是干啥的,当然我还是很羡慕百度的待遇的

谷歌也不好用了,只好用bing了,至少在技术搜索方面比国内的搜索引擎还是要强一些

把rt_linux.c下的__RtmpOSFSInfoChange改一下就可以了

static inline void __RtmpOSFSInfoChange(OS_FS_INFO * pOSFSInfo,
                    BOOLEAN bSet) {
    if (bSet) {
        /* Save uid and gid used for filesystem access. */
        /* Set user and group to 0 (root) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
        pOSFSInfo->fsuid = current->fsuid;
        pOSFSInfo->fsgid = current->fsgid;
        current->fsuid = current->fsgid = 0;
#else
        pOSFSInfo->fsuid = *(int *)¤t_fsuid();  就是这个强转一下就可以编译过了
        pOSFSInfo->fsgid = *(int *)¤t_fsgid();  就是这个强转一下就可以编译过了,当然网上也有说直接注掉这2行就ok,那是当然能编译过,但我担心功能会有影响

                                                                           于是就选择强换一把,编译应该就没问题了

#endif
        pOSFSInfo->fs = get_fs();
        set_fs(KERNEL_DS);
    } else {
        set_fs(pOSFSInfo->fs);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
        current->fsuid = pOSFSInfo->fsuid;
        current->fsgid = pOSFSInfo->fsgid;
#endif
    }
}


期间还参考了个rt28xx的问题,说是要apt-get install firmware-ralink,but it does not work

root@localhost:~/Desktop/LINUX/2011#
root@localhost:~/Desktop/LINUX/2011# apt-get install firmware-ralink
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  firmware-ralink
1 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.
Need to get 22.2 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/kali/ kali/non-free firmware-ralink all 0.43 [22.2 kB]
Fetched 22.2 kB in 0s (66.9 kB/s)    
Reading changelogs... Done
(Reading database ... 346123 files and directories currently installed.)
Preparing to replace firmware-ralink 0.40~bpo70+1 (using .../firmware-ralink_0.43_all.deb) ...
Unpacking replacement firmware-ralink ...
Setting up firmware-ralink (0.43) ...
root@localhost:~/Desktop/LINUX/2011#

再编译

root/Desktop/LINUX/2011/os/linux/../../common/rt_ate.c: In function ‘DO_RACFG_CMD_E2PROM_WRITE_ALL’:
/root/Desktop/LINUX/2011/os/linux/../../common/rt_ate.c:3061:1: warning: the frame size of 1028 bytes is larger than 1024 bytes [-Wframe-larger-than=]
/root/Desktop/LINUX/2011/os/linux/../../common/rt_ate.c: In function ‘Set_ATE_Load_E2P_Proc’:
/root/Desktop/LINUX/2011/os/linux/../../common/rt_ate.c:8563:1: warning: the frame size of 1036 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  LD [M]  /root/Desktop/LINUX/2011/os/linux/rt5370sta.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /root/Desktop/LINUX/2011/os/linux/rt5370sta.mod.o
  LD [M]  /root/Desktop/LINUX/2011/os/linux/rt5370sta.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.14-kali1-686-pae'
cp -f /root/Desktop/LINUX/2011/os/linux/rt5370sta.ko /tftpboot
root@localhost:~/Desktop/LINUX/2011#
root@localhost:~/Desktop/LINUX/2011#
root@localhost:~/Desktop/LINUX/2011#

pass

make install




你可能感兴趣的:(linux)