轉(zhuǎn)自:http://seanhuang./Cross-compile+wpa_supplicant+and+WPS+instruction Reference site:
http://www./simple/index.php?t20393.html Cross compile wpa_supplicant1.移植準(zhǔn)備a. 下載 openssl源代碼 (使用openssl-0.9.8e ) 官網(wǎng): http://www./source/ 源碼:http://www./source/openssl-0.9.8e.tar.gz b. 下載 wpa_supplicant源代碼 (使用wpa_supplicant-0.7.3 ) 官網(wǎng):http://hostap./wpa_supplicant/ 源碼:http://hostap./releases/wpa_supplicant-0.7.3.tar.gz c: 下載:libtommath源代碼(libtommath_0.39.orig.tar.gz) 源碼:ftp://220.165.12.10/debian/pool/main/libt/libtommath/libtommath_0.39.orig.tar.gz 2. 編譯openssl a.將openssl解到 wpa_supplicant/patches 目錄下 # tar zxvf openssl-0.9.8e.tar.gz -C ../ wpa_supplicant-0.7.3/patches/ b.將openssl-0.9.8-tls-extensions.patch拷貝到 wpa_supplicant/patches/openssl-0.9.8e 目錄下
c.patch openssl-0.9.8e # patch -p1 < openssl-0.9.8e-tls-extensions.patch d. 編譯openssl 方式1.
3.編譯libtommath-0.39 a.將libtommath-0.39解到/usr/src/ 目錄下 # tar zxvf libtommath_0.39.orig.tar.gz -C /usr/src b.編譯libtommath # make CC=arm-linux-gcc 產(chǎn)生libtommath.a (Add "CC=/home/fedora/.exdisk/FtenSVN/AU1330/13pf/rma1/arm/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc" into makefile) 4. 編譯wpa_supplicant(增加WPS功能) #cp defconfig .config CONFIG_DRIVER_WEXT=y CONFIG_IEEE8021X_EAPOL=y CONFIG_EAP_FAST=y CONFIG_TLS=openssl CONFIG_TLS=internal CONFIG_INTERNAL_LIBTOMMATH=y ifndef CONFIG_INTERNAL_LIBTOMMATH LTM_PATH=/usr/src/libtommath-0.39 CFLAGS += -I$(LTM_PATH) LIBS += -L$(LTM_PATH) LIBS_p += -L$(LTM_PATH) endif CONFIG_WPS=y CONFIG_EAP_WPS=y #vim makefile CC= gcc -L/usr/local/ssl/lib/ CFLAGS += -I/usr/local/ssl/include/ LIBS += -L/usr/local/ssl/lib/ #make CC=arm-linux-gcc install Start wpa_supplicant service in LinuxCopy "wpa_cli" "wpa_supplicant" "wpa_passphrase" into the device under /usr/bin Copy configuration files into /root/wifi (can be any dir)Before calling "wpa_cli", "wpa_supplicant" service need to be up Configuration file for wpa_supplicant service
"wpa_supplicant -B -Dwext -iwlan0 -c/root/wifi/wpa_supplicant.conf" to start the service ioctl[SIOCSIWESSID]: Input/output error ioctl[SIOCSIWENCODEEXT]: Input/output error Input/output error can be ignored. wpa_supplicant service is in process now Could not connect to wpa_supplicant - re-trying Connect AP using "wpa_cli"Input "wpa_cli" to access interactive mode: To press WPS button on the device >wps_pbc After issue above, press the button on the AP, authentication can be granted. To generate a PIN code on device side >wps_pin <MAC of the device> Input the generated PIN code in AP configuration console to authenticate the connection request To use the PIN code on the AP >wps_pin <MAC of the device> 12345670 Manualy input 12345670 into the configuration web console of the AP (As to authenticate the request) After that connection between AP and the device can be established. "udhcpc -i wlan0 -n" to retrieve the IP from AP |
|