1. 程式人生 > >kali 3.14 安裝RT3070 無線網絡卡驅動

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

編譯

編譯直接報錯

[email protected]:~/Desktop/LINUX/2011#

[email protected]:~/Desktop/LINUX/2011#
[email protected]:~/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

[email protected]:~/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 *)&current_fsuid();  就是這個強轉一下就可以編譯過了
        pOSFSInfo->fsgid = *(int *)&current_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

[email protected]:~/Desktop/LINUX/2011#
[email protected]:~/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) ...
[email protected]:~/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
[email protected]:~/Desktop/LINUX/2011#
[email protected]:~/Desktop/LINUX/2011#
[email protected]:~/Desktop/LINUX/2011#

pass

make install