Skip to content
Vil Coyote edited this page Apr 18, 2018 · 1 revision

wpa_supplicant

To cross compile wpa_supplicant for arm v5.1: (from here )

wpa_supplicant is a WPA Supplicant for linux offering support for WPA and WPA2.

install ToolChain:

apt-get install gcc-arm-linux-gnueabi
apt-get install libssl-devel
apt-get install build-essentials

Netlink Protocol Library Suite libnl-1.x

wpa_supplicant requires the Netlink Protocol Library Suite (libnl) version 1.x.

Download, build and install libnl-1.x:

wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.4.tar.gz
tar -xzf libnl-1.1.4.tar.gz
cd libnl-1.1.4
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi
make 
make install

OpenSSL

OpenSSL is a library for Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1).

Download, build and install OpenSSL:

wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
tar -xzf openssl-1.1.0h.tar.gz 
cd openssl-1.1.0h
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
./Configure linux-generic32 --prefix=/usr/arm-linux-gnueabi
make
make install

wpa_supplicant

With all the prerequisites installed, finally download, build and install the wpa_supplicant:

wget http://hostap.epitest.fi/releases/wpa_supplicant-2.6.tar.gz
tar -xzf wpa_supplicant-2.6.tar.gz
cd wpa_supplicant-2.6/wpa_supplicant
cp defconfig .config
make CC=arm-linux-gnueabi-gcc
make install DESTDIR=/home/export/rootfs

To be able to use wpa_supplicant on your target, it requires the following libraries to be installed:

cp /usr/arm-linux-gnueabi/lib/libnl.so.1.1.4 /home/export/rootfs/lib/
cp /usr/arm-linux-gnueabi/lib/libcrypto.so.1.0.0 /home/export/rootfs/lib/
cp /usr/arm-linux-gnueabi/lib/libssl.so.1.0.0 /home/export/rootfs/lib/

wpa_supplicant runs as a daemon and requires a configuration file. Create a file called /etc/wpa_supplicant.conf with the following contents:

network={ 
 ssid="MySSID" 
 key_mgmt=WPA-PSK 
 proto=RSN 
 pairwise=CCMP TKIP 
 psk="MyPassPhrase" 
}

The above file works with both WPA (TKIP) and WPA2 (CCMP/AES). Please insert your access point name at MySSID and your pass phrase at MyPassPhase.

Once configured, wpa_supplicant can be started using:

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf