海思HOSTAP,DHCPC
1.libnl-3.2.25.tar.gz
./configure --prefix=/home/anyone/wifi/libnl --host=arm-linux
#make
#make install
2.HOSTAP
git clone git://w1.fi/srv/git/hostap.git
tar xzvf hostapd-x.y.z.tar.gz
复制一份默认的配置文件
cp defconfig .config
此时在libnl的文件夹下就可以看见include的头文件以及lib目录下的库文件。libnl编译完成。
接下来编译hostapd工具
进入hostapd的.config文件进行配置
CONFIG_DRIVER_NL80211=y
#driver_nl80211.c requires a rather new libnl (version 1.1) which may not be
#shipped with your distribution yet. If that is the case, you need to build
#newer libnl version and point the hostapd build to use it.
LIBNL=/your libnl path
CFLAGS += -I
(
L
I
B
N
L
)
/
i
n
c
l
u
d
e
L
I
B
S
+
=
−
L
(LIBNL)/include LIBS += -L
(LIBNL)/includeLIBS+=−L(LIBNL)/lib
最后编译:
sudo make
3.DHCPC
tar zxvf dhcp-4.2.5-P1.tar.gz
./configure CC=aarch64-himix100-linux-gcc --host=aarch64-himix100-linux --prefix=/home/ema/Desktop/hisi/dhcp-4.2.5/install/ ac_cv_file__dev_random=yes
2: cd bind
修改Makefile
注释掉 gunzip -c bind.tar.gz | tar xf -;
在cd ${bindsrcdir} && ./configure 后边加上 BUILD_CC=gcc ac_cv_file_dev_random=yes --host=aarch64-himix100-linux 即可
tar zxvf bind.tar.gz
进入bind.tar.gz解压后的文件 ,修改vi lib/export/dns/Makefile.in
gen: ${srcdir}/gen.c
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
改为
gen: ${srcdir}/gen.c
${BUILD_CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
- 完成,然后退回dhcp , make DESTDIR=$PWD/tmp install
4
把文件复制到NFS
sudo cp bin/* 开发板的bin/
sudo cp sbin/* 开发板sbin/
sudo cp etc/dhclient.conf.example 开发板etc/dhclient.conf
sudo cp etc/dhcpd.conf.example 开发板etc/dhcpd.conf
sudo cp client/scripts/linux 开发板etc/dhclient-script
chmod +x 开发板上的etc/dhclient-script
并修改
#!/bin/bash
改为
#!/bin/sh
查看状态:netstat -nutap | grep dhcpd
执行: dhcpd wlan0 &
wlan 是MT7601
dhcpd.conf 内容:
#dhcpd.conf
Sample configuration file for ISC dhcpd
option definitions common to all supported networks…
option domain-name “example.org”;
option domain-name-servers ns1.example.org, 114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
If this DHCP server is the official DHCP server for the local
network, the authoritative directive should be uncommented.
#authoritative;
Use this to send dhcp log messages to a different log file (you also
have to hack syslog.conf to complete the redirection).
log-facility local7;
No service will be given on this subnet, but declaring it helps the
DHCP server to understand the network topology.
This is a very basic subnet declaration.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.40 192.168.0.50;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name “local”;
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
此时需要将 wlan0 设置192.168.0.1 netmask 255.255.255.0