| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Custom Configuration OpenWrt = |
| 4 | |
| 5 | Gateworks uses OpenWrt and it boots up by default properly. |
| 6 | |
| 7 | However, the install can be tweaked however the user wants. |
| 8 | |
| 9 | This must be done at '''COMPILE''' time however. |
| 10 | |
| 11 | |
| 12 | == make menuconfig == |
| 13 | At the command prompt in the '''trunk''' directory where the Gateworks code was checked out, type the command: |
| 14 | |
| 15 | {{{ |
| 16 | /gateworks-openwrt-x/gateworks-openwrt/trunk$ make menuconfig |
| 17 | }}} |
| 18 | |
| 19 | You will be presented with a GUI that looks like so: |
| 20 | [[BR]] |
| 21 | [[Image(makemenuconfig.png,300px)]] |
| 22 | |
| 23 | You can now make any changes, using the space bar to select different items. Select the asterisk next to the line item you want.[[BR]][[BR]] |
| 24 | |
| 25 | '''NOTE:'''Once you make any changes, exit and save. |
| 26 | |
| 27 | |
| 28 | |
| 29 | '''There is a config file in the gateworks-openwrt directory as well as the trunk directory.''' If a 'make cns3xxx' (Laguna) is ran after doing a make menuconfig, it will '''wipe out''' the changes done in make menuconfig.[[BR]][[BR]] |
| 30 | |
| 31 | Therefore, run a make -j8 V=99 in the OpenWrt trunk directory, followed by a make images/laguna in the upper directory to get a fresh firmware. |
| 32 | {{{ |
| 33 | /gateworks-openwrt/trunk$ make -j8 V=99 |
| 34 | }}} |
| 35 | [[BR]][[BR]] |
| 36 | |
| 37 | The newly generated firmware will contain the packages selected. The individual IPK files should also be listed at (for Laguna boards) /trunk/bin/cns3xxx/packages [[BR]][[BR]] |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | Then, the make images/laguna command (Laguna) compiles the artifacts from trunk into a firmware binary (.bin) to be flashed to the board. |
| 43 | |
| 44 | {{{ |
| 45 | make images/laguna |
| 46 | }}} |
| 47 | |
| 48 | |
| 49 | == Specific Examples == |
| 50 | === Turning on GDB Server === |
| 51 | |
| 52 | If you desire to turn on GDBServer you can do that in the make menuconfig. Go to the main menu item titled 'Development' and you will see it in there. Use the space bar to select the line with an asterisk as seen below: |
| 53 | [[BR]] |
| 54 | [[Image(gdb.png,600px)]] |
| 55 | |
| 56 | === Configuring an IP Address === |
| 57 | |
| 58 | By default, Gateworks boards ship with 192.168.1.1 as the default IP address. Sometimes this conflicts with other IP addresses. If desired, a configuration can be created to have the board come up with a different IP address. |
| 59 | |
| 60 | Please note, the below is ONLY for building a image. It is VERY easy to change the IP address manually once the board is booted. Only use the below method if you have a specific reason as it is much more difficult than configuring the board via serial once it is up and booted. |
| 61 | |
| 62 | WARNING: There is a 'preinit' network configuration is for preinit/failsafe (ie hit 'f' during boot for a failsafe terminal). This most likely is not what people usually need. Rather, see below. |
| 63 | |
| 64 | |
| 65 | For customizing the IP address which is in the configuration file /etc/config/network (or any other files) the correct way is to put files in a 'files' directory in the build directory: |
| 66 | |
| 67 | |
| 68 | {{{ |
| 69 | cd trunk ; # openwrt trunk |
| 70 | mkdir -p files/etc/config |
| 71 | cat << EOF >> files/etc/config/network |
| 72 | config interface lan |
| 73 | option ifname eth0 |
| 74 | option type bridge |
| 75 | option proto static |
| 76 | option ipaddr 192.168.9.1 |
| 77 | option netmask 255.255.255.0 |
| 78 | |
| 79 | EOF |
| 80 | |
| 81 | }}} |
| 82 | |
| 83 | DHCP would be: |
| 84 | {{{ |
| 85 | option 'interface' 'lan' |
| 86 | option 'ifname' 'eth0' |
| 87 | option 'type' 'bridge' |
| 88 | option 'defaultroute' '0' |
| 89 | option 'peerdns' '0' |
| 90 | option 'proto' 'dhcp' |
| 91 | }}} |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | This will modify the rootfs that was created in the build directory (ie trunk/target-arm_v6k_uClibc-0.9.33.2_eabi/root-cns3xxx/etc/config/network) |