hostapdを入手
$ git clone git://w1.fi/hostap.git
$ cd hostap
$ git checkout hostap_2_6
パッチを入手 (Dirの場所は適宜読み替えて)
$ cd ..
$ git clone https://github.com/pritambaral/hostapd-rtl871xdrv.git
パッチを当てる (Dirの場所は適宜読み替えて)
$ cd hostap/hostapd
$ patch -Np1 ../../hostapd-rtl871xdrv/rtlxdrv.patch
$ echo CONFIG_DRIVER_RTW=y >> hostapd/.config
ビルド準備 (これをあらかじめしていないと、ビルドエラーがでる)
$ sudo apt-get install libnl-dev libssl-dev
ビルドエラーの例
../src/drivers/driver_nl80211.c:17:31: fatal error: netlink/genl/genl.h: No such file or directory
#include <netlink/genl/genl.h>
^
compilation terminated.
Makefile:1036: recipe for target '../src/drivers/driver_nl80211.o' failed
make: *** [../src/drivers/driver_nl80211.o] Error 1
../src/crypto/tls_openssl.c:19:25: fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>
^
compilation terminated.
Makefile:1036: recipe for target '../src/crypto/tls_openssl.o' failed
make: *** [../src/crypto/tls_openssl.o] Error 1
終了後、バイナリをsbinへコピー
$ sudo cp hostapd /usr/sbin
$ sudo cp hostapd_cli /usr/sbin