-
Notifications
You must be signed in to change notification settings - Fork 18
Install on OpenWRT X86_64
-
Install necessary packages for libnl
sudo apt install bison flex sudo apt install gcc make -
Create the working folder ~/OpenWRT
mkdir ~/OpenWRT cd ~/OpenWRT
-
The file is here :
-
Download it
wget https://downloads.openwrt.org/releases/19.07.8/targets/x86/64/openwrt-sdk-19.07.8-x86-64_gcc-7.5.0_musl.Linux-x86_64.tar.xz -
Uncompress and rename it to ~/OpenWRT/SDK
tar xvf openwrt-sdk-19.07.8-x86-64_gcc-7.5.0_musl.Linux-x86_64.tar.xz mv openwrt-sdk-19.07.8-x86-64_gcc-7.5.0_musl.Linux-x86_64 SDK
-
The file is here : https://github.com/thom311/libnl
-
Download it
wget https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz -
Uncompress and rename it to ~/OpenWRT/libnlsrc
tar xvf libnl-3.5.0.tar.gz mv libnl-3.5.0 libnlsrc
-
Go to the folder ~/OpenWRT/libnlsrc
cd ~/OpenWRT/libnlsrc -
Update PATH
PATH=$PATH:"~/OpenWRT/SDK/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/x86_64-openwrt-linux-musl/bin" export PATH STAGING_DIR="~/OpenWRT/SDK/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/x86_64-openwrt-linux-musl/" export STAGING_DIR -
Build
./configure --build=x86_64-unknown-linux-gnu --host=x86_64-openwrt-linux-musl LDFLAGS="-static" make -
Save necessary files in ~/OpenWRT/libnl
mkdir ~/OpenWRT/libnl cp -R ~/OpenWRT/libnlsrc/include ~/OpenWRT/libnl cp -R ~/OpenWRT/libnlsrc/lib/.libs ~/OpenWRT/libnl/libs
-
Get the folder ~/OpenWRT/libnl from the cross-compiler and save it in /root/libnl of OpenWRT
-
Get the sources of vwifi and save it in /root/vwifi of OpenWRT
-
Packages required to compile vwifi
opkg update opkg install gcc make -
For libpthread
ar -rc /usr/lib/libpthread.a
-
Go to the folder of vwifi : /root/vwifi
cd /root/vwifi -
Edit the file "Makefile" to modify the values of NETLINK_FLAGS and NETLINK_LIBS
sed -i 's#^NETLINK_FLAGS.*#NETLINK_FLAGS=-I/root/libnl/include#g' /root/vwifi/Makefile sed -i 's#^NETLINK_LIBS.*#NETLINK_LIBS=-L/root/libnl/libs -lnl-genl-3 -lnl-3#g' /root/vwifi/Makefile- NETLINK_FLAGS = -I/root/libnl/include
- NETLINK_LIBS = -L/root/libnl/libs -lnl-genl-3 -lnl-3
-
If you will not build vsock for OpenWRT, you can disable it in vwifi-client :
sed -i 's$^#define ENABLE_VHOST$//#define ENABLE_VHOST$g' /root/vwifi/src/config.h -
Build vwifi-client
make directories make vwifi-client
-
Package required to use : mac80211-hwsim
opkg install kmod-mac80211-hwsim -
Package required if vwifi has been compiled on other OpenWRT
opkg install libstdcpp6
-
vwifi-client 172.16.0.1with 172.16.0.1 the IP of vwifi-server
-
Copy vwifi-client into /usr/sbin
cp vwifi-client /usr/sbin/ -
Create the service file : /etc/init.d/vwifi-client
#!/bin/sh /etc/rc.common START=10 STOP=15 start() { echo start vwifi-client vwifi-client 172.16.0.1 &> /dev/null & } stop() { echo stop vwifi-client kill -9 $(pgrep vwifi-client) }- Modify 172.16.0.1 with the IP of vwifi-server
-
Make /etc/init.d/vwifi-client executable
chmod +x /etc/init.d/vwifi-client -
Configure to run the service when OpenWRT boots
service vwifi-client enable -
Run the service
service vwifi-client start
-
Don't forget to install "wpa-supplicant" and "hostapd"
opkg install hostapd opkg install wpa-supplicant