Changeset 490:2577514b2546 in freeDiameter for contrib
- Timestamp:
- Aug 12, 2010, 3:57:52 PM (14 years ago)
- Branch:
- default
- Children:
- 491:6edd14e5f132, 494:6e9c1ea44262
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/OpenWRT/HOWTO
r327 r490 1 This HOWTO describes how to generate a set of ipkg modules for 2 providing support of freeDiameter in an OpenWRT system. 3 4 This HOWTO is written for OpenWRT 10.03 (BackFire) and no guarantee is provided 5 that it will work for you. Be prepared to eventually brick your routeur... 6 7 Table of contents: 8 1) Prerequisites: get the OpenWRT development environment ready. 9 2) Supplied packages: use the existing packages when possible (gnutls, ...) 10 3) Other dependencies: provide for additional missing dependencies (sctp ...) 11 4) freediameter package: now create the freeDiameter package 12 5) Configuration: how to set the configuration on the router. 13 14 This HOWTO will NOT cover how to install OpenWRT on your access device, nor 15 its basic configuration. Please refer to OpenWRT website for this type of HOWTOs. 16 17 18 19 ============================================== 20 1) Prerequisites: 21 ============================================== 22 23 We will first need a working OpenWRT toolchain environment. You can retrieve 24 pre-compiled binaries of such toolchains ("Image builder") on the OpenWRT website. Anyway, 25 in case the architecture you are interested in is not listed, you can build 26 the full toolchain from source. This is the path we are following in this HOWTO. 27 28 a) Retrieve the latest OpenWRT source, using subversion or git. 29 Since I have to go through a proxy, I use the later here, svn being quite annoying with proxies. 30 Note, 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 36 b) If you are using git, you have to edit the feeds.conf file to use git as well for packages. 37 Do the following modifications in this case: 38 $ vi feeds.conf 39 Comment out this line: 40 src-svn packages https://svn.openwrt.org/openwrt/packages 41 Add this line instead: 42 src-git packages git://nbd.name/packages.git 43 44 You can leave uncommented the luci (for GNUTLS) and Xwrt (webif) repositories. Since these repositories 45 use svn over http, you can use subversion even if you are behind a proxy. 46 47 c) Then issue the following command to update the package list: 48 $ scripts/feeds update 49 50 d) Now, let's already create the toolchain and basic image. 51 $ make menuconfig 52 53 This will open a menu for you. You must select the target you are building for. 54 See http://wiki.openwrt.org/toh/start for the table of hardware and associated information. 55 In 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 61 For many routeurs, the recommended kernel is a 2.4x version. I have NOT tried with such kernel, 62 and the SCTP support is likely to be different in this generation of kernels. I strongly recommend 63 to go with a 2.6x kernel, whenever possible. 64 65 e) Once configured, create the toolchain and default image (this takes a while): 66 $ make 67 68 After this command completes successfully, your build environment is ready. 69 The resulting image and packages are stored in the "bin/" subdirectory. 70 It is very convenient if you make this repository available in http to your routeur. 71 72 You should probably try at this early stage to flash your device with the image you have generated. 73 If the default basic image does not work, it is probably not worth adding new problems on top of it. 74 75 For troubleshooting, please consult OpenWRT documentation directly. 76 "make prereq" may help you building the initial image also. 77 See http://downloads.openwrt.org/docs/buildroot-documentation.html for additional information 78 concerning this step. 79 80 You should now be able to login on your routeur with telnet (first time) or ssh (after setting a password). 81 82 ============================================== 83 2) Supplied packages: 84 ============================================== 85 86 There are some dependencies of freeDiameter already available in the OpenWRT packages repository. 87 You can check for the available packages with the script: 88 $ ./scripts/feeds search <package> 89 90 We will now describe how to install these dependencies. At the time this HOWTO is written, 91 the OpenWRT repositories contain ipv6, gnutls, pthreads and hostapd. Follow these instruction to 92 build them: 93 94 a) GNU TLS packages 95 $ scripts/feeds install libgnutls 96 97 b) 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 114 Quit and save the new config, then: 115 $ make world 116 117 This will add a bunch of modules in your bin directory that will be required for freeDiameter. 118 Since we are removing the wpad-mini daemon from the base image, this image (trx or bin file) is also recompiled. 119 120 Note 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 124 You should now reflash your routeur with the new firmware image. The simplest way to achieve if your routeur has enough 125 flash 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 130 WARNING: this will erase your existing configuration on the routeur. 131 In case you need to save it, you may try the sysupgrade command instead. 132 133 This will reboot the device after writing the new image file. 134 Afterwards, 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) 136 you 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 140 Install the newly compiled packages with: 141 root@OpenWrt:~# opkg install kmod-ipv6 hostapd libpthread 142 143 ============================================== 144 3) Missing packages: 145 ============================================== 146 147 There are other dependencies for freeDiameter that are not provided by OpenWRT packages. 148 For convenience, we include these meta-packages in the freeDiameter distribution -- but they 149 might not be up-to-date. 150 151 a) Adding the contributed directory to the feeds 152 Add the following line in your feeds.conf file: 153 src-link freediameter /path/to/freediameter/contrib/OpenWRT/packages/ 154 155 Then run: 156 $ scripts/feeds update 157 158 This should allow you to install the missing dependencies as follow: 159 160 161 b) SCTP library (note: you might alternatively compile freeDiameter without SCTP support). 162 $ scripts/feeds install sctp 163 164 165 c) Select these components in the menu: 166 $ make menuconfig 167 - Libraries ---> 168 sctp (M) 169 170 Quit and save the new config, then: 171 $ make world 172 173 174 d) Install this on the router as well: 175 root@OpenWrt:~# opkg update 176 root@OpenWrt:~# opkg install sctp 177 178 179 ============================================== 180 4) freediameter package: 181 ============================================== 182 183 Now, your environment should be ready to compile the freeDiameter ipkg package. 184 $ ./scripts/feeds install freediameter 185 186 Note 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 192 Quit and save the new config, then: 193 $ make world 194 195 196 197
Note: See TracChangeset
for help on using the changeset viewer.