Changes between Version 2 and Version 3 of OpenvpnDevelPackageForOpenWRT
- Timestamp:
- 08/03/10 17:16:22 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OpenvpnDevelPackageForOpenWRT
v2 v3 6 6 7 7 If you want IPv6 support or any of the other features in the development tree, you have to build your own package, based on the openvpn-devel sources. Given that OpenWRT packages are not for standard i386/amd64 CPUs but usually some sort of MIPS system, you need a cross-compilation environment and special tools - but that's all already provided by the OpenWRT folks, so you just need to add a few bits to add your own package. 8 9 Update: 2010/08/03: there is an openvpn-devel package in the official OpenWRT package tree. So far it's not available as binary, so this document explains how to checkout the source tree and build from there. 8 10 9 11 = how to build = … … 22 24 }}} 23 25 24 3. now add a directory for "openvpn-devel" (the package tree has "openvpn" already), and copy a few files from the existing openvpn package (we're lazy): 26 3. check that the openvpn-devel version that is included is the one that you want to build 27 25 28 {{{ 26 backfire$ cd package 27 backfire/package$ mkdir openvpn_devel 28 backfire/package$ cd openvpn_devel 29 backfire/package/openvpn_devel$ cp -r ../feeds/packages/openvpn/files . 30 backfire/package/openvpn_devel$ 29 backfire$ cd package/feeds/packages/openvpn-devel 30 backfire/package/feeds/packages/openvpn-devel$ grep ^PKG_VERSION Makefile 31 PKG_VERSION:=201026 31 32 }}} 32 33 33 (you could pick any name you want for the package directory, but it's useful to be consistent with the definitions in the Makefile itself) 34 35 4. copy-paste the following text to a file named "Makefile" in this directory: 36 {{{ 37 # 38 # Makefile for openvpn-devel package for OpenWRT 39 # 40 41 include $(TOPDIR)/rules.mk 42 43 PKG_NAME:=openvpn_devel 44 # this is "2010, week 26" 45 PKG_VERSION:=201026 46 # BUILD_DIR has to accomodate path naming of source tarball 47 PKG_BUILD_DIR:=$(BUILD_DIR)/openvpn-devel 48 PKG_RELEASE:=1 49 50 PKG_SOURCE:=openvpn-$(PKG_VERSION).tar.gz 51 PKG_SOURCE_URL:=ftp://ftp.secure-computing.net/pub/FreeBSD/ports/openvpRCE") 52 # MD5 check disabled for now - but if you want to be sure that you have the right 53 # package, calculate MD5 sum with "md5sum openvpn-201026.tar.gz" and add here 54 # PKG_MD5SUM:=424e7ae5de6430374e97c9e458ee45d5 55 56 PKG_INSTALL:=1 57 58 include $(INCLUDE_DIR)/package.mk 59 60 define Package/openvpn_devel 61 SECTION:=net 62 CATEGORY:=Network 63 DEPENDS:=+kmod-tun +kmod-ipv6 +libopenssl +liblzo +ip 64 TITLE:=Open source VPN solution using SSL - DEVEL VERSION 65 URL:=http://openvpn.net 66 SUBMENU:=VPN 67 endef 68 69 define Package/openvpn_devel/conffiles 70 /etc/config/openvpn 71 endef 72 73 define Package/openvpn_devel/description 74 Open source VPN solution using SSL - DEVEL VERSION, Week $(PKG_VERSION) 75 endef 76 77 define Build/Configure 78 $(call Build/Configure/Default, \ 79 --disable-pthread \ 80 --disable-debug \ 81 --disable-plugins \ 82 --enable-management \ 83 --disable-socks \ 84 --enable-password-save \ 85 --enable-iproute2 \ 86 --with-iproute-path=/usr/sbin/ip \ 87 ,\ 88 ac_cv_func_epoll_create=no \ 89 ) 90 endef 91 92 define Package/openvpn_devel/install 93 $(INSTALL_DIR) $(1)/usr/sbin 94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/ 95 $(INSTALL_DIR) $(1)/etc/init.d/ 96 $(INSTALL_BIN) files/openvpn.init $(1)/etc/init.d/openvpn 97 $(INSTALL_DIR) $(1)/etc/config 98 $(INSTALL_CONF) files/openvpn.config $(1)/etc/config/openvpn 99 $(INSTALL_DIR) $(1)/etc/openvpn 100 endef 101 102 $(eval $(call BuildPackage,openvpn_devel)) 34 this number is the "week 26 of the year 2010", which is the tarball that we're building from. If you change that, do not forget to update the PKG_MD5SUM line in the Makefile, otherwise building will fail (checksum error). If you're lazy, just remove the PKG_MD5SUM line (this will disable checksumming the downloaded tar archive). 103 35 104 36 105 }}} 106 107 5. go back to the top level directory and run the config scripts: 37 4. go back to the top level directory and run the config scripts: 108 38 {{{ 109 backfire/package/ openvpn_devel$ cd../..39 backfire/package/feeds/packages/openvpn-devel$ cd ../../../.. 110 40 backfire$ make defconfig 111 41 backfire$ make menuconfig … … 117 47 118 48 119 6. run "make" and wait... - this will take a long time, building the C compiler (for cross-building to MIPS cpu) and the target system's C library etc. first.49 5. run "make" and wait... - this will take a long time, building the C compiler (for cross-building to MIPS cpu) and the target system's C library etc. first. 120 50 121 51 {{{ … … 125 55 make[3] -C target/linux compile 126 56 ... 127 make[3] -C package/zlib compile 128 make[3] -C package/openssl compile 129 make[3] -C package/iproute2 compile 57 make[3] -C feeds/packages/libs/lzo compile 130 58 make[3] -C package/iptables compile 59 make[3] -C package/opkg compile 131 60 make[3] -C package/firewall compile 61 make[3] -C package/crda compile 132 62 make[3] -C package/hostapd compile 133 make[3] -C package/kernel compile 134 make[3] -C package/mtd compile 135 make[3] -C package/openvpn_devel compile <<<<< :-) 136 make[3] -C package/opkg compile 63 make[3] -C feeds/packages/net/openvpn-devel compile <<<<< :-) 137 64 ... 138 65 make[3] package/preconfig … … 143 70 }}} 144 71 145 7. now you have an openvpn_devel package in ./bin/ar71xx/packages/72 6. now you have an openvpn-devel package in ./bin/ar71xx/packages/ 146 73 147 74 {{{ 148 75 backfire$ ls -l bin/ar71xx/packages/ 149 76 ... 150 -rw-r--r-- 1 gert users 182075 27. Jun 16:03 openvpn _devel_201026-1_ar71xx.ipk77 -rw-r--r-- 1 gert users 182075 27. Jun 16:03 openvpn-devel_201026-1_ar71xx.ipk 151 78 ... 152 79 }}} … … 162 89 Inflating http://downloads.openwrt.org/backfire/10.03/ar71xx/packages/Packages.gz. 163 90 Updated list of available packages in /var/opkg-lists/packages. 164 root@openwrt:/tmp# wget http:<myserver>/openvpn _devel_201026-1_ar71xx.ipk91 root@openwrt:/tmp# wget http:<myserver>/openvpn-devel_201026-1_ar71xx.ipk 165 92 ... 166 93 root@openwrt:/tmp$ opkg install openvpn*ipk … … 184 111 Configuring libopenssl. 185 112 Configuring liblzo. 186 Configuring openvpn _devel.113 Configuring openvpn-devel. 187 114 root@OpenWrt:/tmp# openvpn |head -2 188 115 OpenVPN testing-f0b02a9dfab6 mips-openwrt-linux [SSL] [LZO2] [MH] [PF_INET6] [IPv6 payload 20100307-1] built on Jun 27 2010