----------------------------------------------------------------- DIFFUSE for OpenWRT: Building Packages (released 13th April 2012) ----------------------------------------------------------------- This document is part of DIFFUSE for OpenWRT: http://caia.swin.edu.au/urp/diffuse/ http://caia.swin.edu.au/urp/diffuse/openwrt/ It provides instructions for building OpenWRT firmware and installing DIFFUSE packages see also: http://http://caia.swin.edu.au/urp/diffuse/downloads/DIFFUSE-VirtualBox-howto.txt http://http://caia.swin.edu.au/urp/diffuse/downloads/DIFFUSE-Build-Firmware-howto.txt http://wiki.openwrt.org/doc/howto/buildroot.exigence http://wiki.openwrt.org/doc/howto/build (less helpful but some good info) http://wiki.openwrt.org/doc/devel/packages INTRODUCTION ------------ If you already have the OpenWRT source and buildroot set up, then you might want to simply obtain and build the DIFFUSE packages to install on you router. If you do not yet have the tools to build a firmware image, we recommend using our VirtualBox image (it has a build environment and sources pre-configured, all you need to do is build). See: http://http://caia.swin.edu.au/urp/diffuse/downloads/DIFFUSE-Build-Firmware-howto.txt OpenWRT also has more extensive documentation about packages: http://wiki.openwrt.org/doc/howto/build#building.single.packages REQUIREMENTS ------------ We will assume that you have already fetched and built the OpenWRT source. DIFFUSE has been tested on OpenWRT Attitude Adjustment (bleeding edge) r29537. If you wish to install the DIFFUSE Collector (ipfwcol) then you will also need to install libsctp (instructions below). In this guide we build packages that must be copied onto the router and installed using opkg. The packages are built for the TP-Link WR-1043ND -- the package names will be slightly different if you are using a different architecture. ADDING/BUILDING PACKAGES ------------------------ See the OpenWRT documentation on packages for more in-depth info. After running make, packages are found in bin//packages You can get the source files for DIFFUSE from the DIFFUSE website: http://caia.swin.edu.au/urp/diffuse/openwrt extract these into trunk/package/ ipfwcol requires libsctp to install on OpenWRT. If you do not wish to install ipfwcol, then skip this step. get sctp from svn: ~: svn export svn://svn.openwrt.org/openwrt/packages/libs/sctp package/sctp run make menuconfig and set sctp to (in Network) ~: make package/sctp/compile V=99 unpack the ipfwcol source to package/ipfwcol/ run make menuconfig and set ipfwcol to make sure that the /usr path in /src/Makefile is set to the /usr path in the toolchain. E.g: - trunk/staging_dir/target-mips_r2_uClibc-0.9.32/usr/ make package/ipfwcol/compile V=99 unpack the ipfw source to package/ipfw/ run make menuconfig and set Utilities -> ipfw to make package/ipfwcol/compile V=99 unpack the dummynet2 source to package/dummynet2/ run make menuconfig and set Kernel Modules -> Other -> dummynet2 to make package/dummynet2/compile V=99 this will generate the ipkg files and place them in the packages folder (bin//packages). - sctp_1.0.11-1_.ipk - ipfwcol_1_.ipk - ipfw_1_.ipk - dummynet2_1_.ipk now when you install the firmware you can scp the ipkg files onto the router and install them using: - opkg install sctp_1.0.11-1_ar71xx.ipk - opkg install ipfwcol_1_ar71xx.ipk COMMON COMPILING PROBLEMS ------------------------- There could be a number of issues that occur when trying to build packages. This is not an exhaustive problem solving guide but may be helpful in some cases. If you have problems compiling (such as with paths), try the following: replace -I/usr/include with -I/home//trunk/openwrt/staging_dir_mipsel/usr/include in the Makefile of the package you are trying to build. Cross compiling kernel modules: set the path PATH=$PATH:/home//openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32/bin/ CONTRIBUTIONS ------------- We welcome your feedback and contributions! If you have discovered a bug, have a request for a new feature, have produced a code patch or a new classifier model, please contact Nigel Williams (njwilliams@swin.edu.au). CONTACT ------- The DIFFUSE website is: http://www.caia.swin.edu.au/urp/diffuse If you have any questions or want to report any bugs please contact Nigel Williams (njwilliams@swin.edu.au). Centre for Advanced Internet Architectures Swinburne University of Technology Melbourne, Australia CRICOS number 00111D http://www.caia.swin.edu.au