Skip to content

Instantly share code, notes, and snippets.

@pigscanflyyyy
Created December 3, 2020 15:35
Show Gist options
  • Save pigscanflyyyy/06762b611ce570315d8ea2a1d388d45a to your computer and use it in GitHub Desktop.
Save pigscanflyyyy/06762b611ce570315d8ea2a1d388d45a to your computer and use it in GitHub Desktop.
Compile OpenVPN for armv5
Debian
apt-get install build-essential gcc-arm-linux-gnueabi ca-certificates
mkdir /home/source /home/openvpn
LZO
cd /home/source
wget https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz
tar xvzf lzo-2.10.tar.gz
cd lzo-2.10
./configure --prefix=/home/openvpn --enable-static --target=arm-linux-gnueabi --host=arm-linux-gnueabi
make && make install
LZ4
cd /home/source
wget https://github.com/lz4/lz4/archive/v1.9.2.tar.gz
tar xvzf v1.9.2.tar.gz
cd lz4-1.9.2
make && PREFIX=/home/openvpn make install
Openssl
cd /home/source
wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
tar xvzf openssl-1.1.1h.tar.gz
cd openssl-1.1.1h
./Configure gcc -static -no-shared --prefix=/home/openvpn --cross-compile-prefix=arm-linux-gnueabi-
make && make install
OpenVPN
cd /home/source
wget https://swupdate.openvpn.org/community/releases/openvpn-2.4.9.tar.gz
tar xvzf openvpn-2.4.9.tar.gz
cd openvpn-2.4.9
./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --prefix=/home/openvpn --enable-static --disable-shared --disable-debug --disable-plugins OPENSSL_CFLAGS="-I/home/openvpn/include" OPENSSL_LIBS="-L/home/openvpn/lib -lssl -lcrypto" LZO_CFLAGS="-I/home/openvpn/include" LZO_LIBS="-L/home/openvpn/lib -llzo2" LZ4_CFLAGS="-I/home/openvpn/include" LZ4_LIBS="-L/home/openvpn/lib -llz4" IFCONFIG=/sbin/ifconfig ROUTE=/sbin/route NETSTAT=/bin/netstat IPROUTE=/sbin/ip --enable-iproute2
make LIBS="-all-static" && make install
Final
cd /home/openvpn/sbin/
openvpn (static) binary is here!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment