Navigation


Changeset 490:2577514b2546 in freeDiameter for contrib


Ignore:
Timestamp:
Aug 12, 2010, 3:57:52 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Children:
491:6edd14e5f132, 494:6e9c1ea44262
Phase:
public
Message:

Updated documentation (still incomplete)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/OpenWRT/HOWTO

    r327 r490  
     1This HOWTO describes how to generate a set of ipkg modules for
     2providing support of freeDiameter in an OpenWRT system.
     3
     4This HOWTO is written for OpenWRT 10.03 (BackFire) and no guarantee is provided
     5that it will work for you. Be prepared to eventually brick your routeur...
     6
     7Table of contents:
     81) Prerequisites: get the OpenWRT development environment ready.
     92) Supplied packages: use the existing packages when possible (gnutls, ...)
     103) Other dependencies: provide for additional missing dependencies (sctp ...)
     114) freediameter package: now create the freeDiameter package
     125) Configuration: how to set the configuration on the router.
     13
     14This HOWTO will NOT cover how to install OpenWRT on your access device, nor
     15its basic configuration. Please refer to OpenWRT website for this type of HOWTOs.
     16
     17
     18
     19==============================================
     201) Prerequisites:
     21==============================================
     22
     23We will first need a working OpenWRT toolchain environment. You can retrieve
     24pre-compiled binaries of such toolchains ("Image builder") on the OpenWRT website. Anyway,
     25in case the architecture you are interested in is not listed, you can build
     26the full toolchain from source. This is the path we are following in this HOWTO.
     27
     28a) Retrieve the latest OpenWRT source, using subversion or git.
     29Since I have to go through a proxy, I use the later here, svn being quite annoying with proxies.
     30Note, the following commands must not be run as root.
     31$ git clone git://nbd.name/openwrt.git
     32 (Note: you might instead use "backfire.git" if you want to stick with an OpenWRT release.)
     33$ cd openwrt
     34$ cp feeds.conf.default feeds.conf
     35
     36b) If you are using git, you have to edit the feeds.conf file to use git as well for packages.
     37Do the following modifications in this case:
     38$ vi feeds.conf
     39 Comment out this line:
     40src-svn packages https://svn.openwrt.org/openwrt/packages
     41 Add this line instead:
     42src-git packages git://nbd.name/packages.git
     43
     44 You can leave uncommented the luci (for GNUTLS) and Xwrt (webif) repositories. Since these repositories
     45use svn over http, you can use subversion even if you are behind a proxy.
     46
     47c) Then issue the following command to update the package list:
     48$ scripts/feeds update
     49
     50d) Now, let's already create the toolchain and basic image.
     51$ make menuconfig
     52
     53This will open a menu for you. You must select the target you are building for.
     54See http://wiki.openwrt.org/toh/start for the table of hardware and associated information.
     55In my case, I am using a Buffalo WZR-HP-G300NH router. I therefore select these options:
     56- Target System --->
     57   Atheros AR71xx/AR7240/AR913x
     58- Target Profile --->
     59   Buffalo WZR-HP-G300NH
     60   
     61For many routeurs, the recommended kernel is a 2.4x version. I have NOT tried with such kernel,
     62and the SCTP support is likely to be different in this generation of kernels. I strongly recommend
     63to go with a 2.6x kernel, whenever possible.
     64   
     65e) Once configured, create the toolchain and default image (this takes a while):
     66$ make
     67
     68After this command completes successfully, your build environment is ready.
     69The resulting image and packages are stored in the "bin/" subdirectory.
     70It is very convenient if you make this repository available in http to your routeur.
     71
     72You should probably try at this early stage to flash your device with the image you have generated.
     73If the default basic image does not work, it is probably not worth adding new problems on top of it.
     74
     75For troubleshooting, please consult OpenWRT documentation directly.
     76"make prereq" may help you building the initial image also.
     77See http://downloads.openwrt.org/docs/buildroot-documentation.html for additional information
     78concerning this step.
     79
     80You should now be able to login on your routeur with telnet (first time) or ssh (after setting a password).
     81
     82==============================================
     832) Supplied packages:
     84==============================================
     85
     86There are some dependencies of freeDiameter already available in the OpenWRT packages repository.
     87You can check for the available packages with the script:
     88$ ./scripts/feeds search <package>
     89
     90We will now describe how to install these dependencies. At the time this HOWTO is written,
     91the OpenWRT repositories contain ipv6, gnutls, pthreads and hostapd. Follow these instruction to
     92build them:
     93
     94a) GNU TLS packages
     95$ scripts/feeds install libgnutls
     96
     97b) Select the following components in the menu:
     98$ make menuconfig
     99- Base system --->
     100   libpthread (M)
     101   
     102- Network --->
     103   hostapd (M)
     104   wpad-mini ( )
     105
     106- Libraries --->
     107   SSL --->
     108     libgnutls (M)
     109   
     110- Kernel modules --->
     111   Network Support --->
     112     kmod-ipv6 (M)
     113     
     114Quit and save the new config, then:
     115$ make world
     116
     117This will add a bunch of modules in your bin directory that will be required for freeDiameter.
     118Since we are removing the wpad-mini daemon from the base image, this image (trx or bin file) is also recompiled.
     119
     120Note that if you are setting your device as WPA supplicant also (wireless client), you can select wpad instead of hostapd.
     121(in any case, the -mini version is not suitable since we will use the RADIUS authentication).
     122
     123
     124You should now reflash your routeur with the new firmware image. The simplest way to achieve if your routeur has enough
     125flash memory is to:
     126- copy the new trx image to your routeur's /tmp (using wget or scp)
     127- run this command (on the device) -- replace <newfile.trx> with your actual filename:
     128 root@OpenWrt:~# mtd -r write <newfile.trx> linux
     129
     130WARNING: this will erase your existing configuration on the routeur.
     131In case you need to save it, you may try the sysupgrade command instead.
     132
     133This will reboot the device after writing the new image file.
     134Afterwards, if you have set up the http server on your development machine properly
     135(let's assume it has IP address 192.168.1.25)
     136you can run the following command on your router:
     137 root@OpenWrt:~# echo "src/gz mydev http://192.168.1.25/packages" >> /etc/opkg.conf
     138 root@OpenWrt:~# opkg update
     139
     140Install the newly compiled packages with:
     141 root@OpenWrt:~# opkg install kmod-ipv6 hostapd libpthread
     142
     143==============================================
     1443) Missing packages:
     145==============================================
     146
     147There are other dependencies for freeDiameter that are not provided by OpenWRT packages.
     148For convenience, we include these meta-packages in the freeDiameter distribution -- but they
     149might not be up-to-date.
     150
     151a) Adding the contributed directory to the feeds
     152  Add the following line in your feeds.conf file:
     153src-link freediameter /path/to/freediameter/contrib/OpenWRT/packages/
     154
     155Then run:
     156$ scripts/feeds update
     157
     158This should allow you to install the missing dependencies as follow:
     159
     160
     161b) SCTP library (note: you might alternatively compile freeDiameter without SCTP support).
     162$ scripts/feeds install sctp
     163
     164
     165c) Select these components in the menu:
     166$ make menuconfig
     167- Libraries --->
     168   sctp (M)
     169
     170Quit and save the new config, then:
     171$ make world
     172
     173
     174d) Install this on the router as well:
     175 root@OpenWrt:~# opkg update
     176 root@OpenWrt:~# opkg install sctp
     177
     178
     179==============================================
     1804) freediameter package:
     181==============================================
     182
     183Now, your environment should be ready to compile the freeDiameter ipkg package.
     184$ ./scripts/feeds install freediameter
     185
     186Note that in order to build this package, you need to have cmake on your compilation machine.
     187
     188$ make menuconfig
     189- Network --->
     190   freeDiameter (M)
     191   
     192Quit and save the new config, then:
     193$ make world
     194
     195
     196
     197
Note: See TracChangeset for help on using the changeset viewer.