全部博文(198)
分类: LINUX
2015-07-08 15:33:24
1.1支持RT3070无线模块
支持rt3070 USB无线模内核配置,进入内核配置界面,内核配置中需要做的修改如下:
[*] Networking support --->
-*- Wireless --->
<*> cfg80211 - wireless configuration API
[*] cfg80211 wireless extensions compatibility
[*] Wireless extensions sysfs files
<*> Generic IEEE 802.11 Networking Stack (mac80211)
Device Drivers --->
[*] Network device support --->
[*] Wireless LAN --->
<*> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)
[*] Support downloading firmware images with Host AP driver
[*] Support for non-volatile firmware download
<*> Ralink driver support --->
<*> Ralink rt2800 (USB) support (EXPERIMENTAL)
[*] rt2800usb - Include support for rt30xx (USB) devices
1.2支持动态获取IP配置
支持动态获取IP配置,进入内核配置界面,内核配置中需要做的修改如下:
1.1、配置Linux内核使能DHCP相关选项:
[*] Networking support --->
--- Networking support
Networking options --->
[*]Packet socket
[*]IP:kernel level autoconfiguration
[*] IP:DHCP support
[*]Network packet filtering framework(Netfilter) --> //下层子选项可不作配置
二、wireless tools移植
wireless tools版本:wireless_tools.29.tar.gz
2.1解压解压
# tar –xzvf wireless_tools.29.tar.gz
# cd wireless_tools.29
2.2 修改Makefile
- 表示去掉的
+ 表示增加的
# vi Makefile
- CC=gcc
+ CC = /usr/local/arm/gnueabi-4.4.4/bin/arm-none-linux-gnueabi-gcc
- AR=ar
+ AR = /usr/local/arm/gnueabi-4.4.4/bin/arm-none-linux-gnueabi-ar
# make
2.3 拷贝文件到ARM板
拷贝libiw.so.29文件到/usr/lib/中。
拷贝iwconfig、iwlist到/usr/sbin中。
三、wpa_supplicant工具移植
3.1下载源码
下载wpa_supplicant-0.7.3.tar.gz (openssl用到0.7.3提供的补丁)
3.2 opensll库移植
# tar –xzvf openssl-0.9.8e.tar.gz
将wpa_supplicant中的补丁拷贝到openssl中。
# cp wpa_supplicant-0.7.3/patches/openssl-0.9.8e-tls-extensions.patch openssl-0.9.8e
# cd openssl-0.9.8e
# mkdir /usr/local/arm/ssl
# vim Makefile
INSTALLTOP=/usr/local/arm/ssl
OPENSSLDIR=/usr/local/arm/ssl
CC= arm-linux-cc
AR=arm-linux-ar $(ARFLAGS) r
RANLIB=arm-linux-ranlib
# make
# make install
在/usr/local/arm/ssl中安装ssl库。
# ls /usr/local/arm/ssl/
bin certs include lib man misc openssl.cnf private
后面编译wpa_supplicant要依赖openssl中的lib和include。
3.2 wpa_supplicant移植
# tar –xzvf wpz_supplicant-0.7.3/wpa_supplicant
# cd wpa_supplicant-0.7.3/wpa_supplicant
# cp defconfig .config
# vim .config
CC=arm-linux-gcc -L/usr/local/arm/ssl/lib/
CFLAGS += -I/usr/local/arm/ssl/include
LIBS += -L/usr/local/arm/ssl/lib –lssl
# make
经过编译后的wpa_supplicant源程序可以看到三个主要的可执行工具:
wpa_cli、wpa_passphrase和wpa_supplicant
wpa_supplicant是核心程序,它和wpa_cli的关系就是服务和客户端的关系:后台运行wpa_supplicant,使用wpa_cli来搜索、设置和链接网络。
将wpa_cli、wpa_passphrase和wpa_supplicant拷贝到板卡/usr/sbin目录中。
3.3 配置wpa supplicant
在板卡跟目录/etc中建立wpa_supplicant.conf文件,文件内容如下:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="Link_Test"
psk="123456789"
}
配置中的信息要跟链接的路由信息一致。
四、测试ifconfig eth0 down
wpa_supplicant –i wlan0 –c /etc/wpa_supplicant.conf &
udhcpc -i wlan0 &