Ubiquiti Networks Forum  


Register UBNT Home Support Members List Search Today's Posts Mark Forums Read
Go Back   Ubiquiti Networks Forum > Ubiquiti Product Forum > Ubiquiti Embedded System and Mini-PCI based Products > Ubiquiti RouterStation Platform

Reply
 
Thread Tools Display Modes
Old 10-21-2009, 07:37 AM   #1
patcou
New User
 
Join Date: Oct 2009
Posts: 4
Default How to build firmware for RouterStation

I am posting these instructions in order to try and help people successfully compile working RouterStation firwmare. Enjoy

==================================
  • Get VMware Player (free) here: http://www.vmware.com/download/player/
  • Get "Ubuntu 8.10 Desktop" here (press the green down arrow): http://linhost.info/vmware/
    • Windows users: This WMware image requires NTFS filesystem to work.
    • Don't forget to save the password information too. The above image has username: user, password: user.
  • Get a 7zip decompressor here: http://www.7-zip.org/
  • Install VMware player and 7zip decompressor (Windows users: reboot)
  • Uncompress the Ubuntu 8.10 Desktop
  • Use VMware Player to open Ubuntu 8.10 Desktop. Select the option "I copied it".
    • username: user, password: user
  • I recommend changing the user password and root password to something you will remember.
    • To change the root password, use the command "sudo passwd root".
    • The password for the user account gives you the required access.
  • Use the Update manager to patch Ubuntu to the latest versions of software
    • click the red down arrow at the top of the screen. The user password gives the necessary credentials
  • Install the utilities needed to build
    • Issue the following command (all one line without the single quotes): 'apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev gawk quilt libuclib0 texinfo'
  • Make sure you are not logged in as root.
  • Download the small package files attached to this post (RSbuildSetup.zip and RSredbootROM.zip).
  • Create a directory in the users home folder for the build.
    • I recommend using the build number (e.g. bld16442)
  • Extract the downloaded file contents into the build folder. Included in the files are:
    • A Makefile that adds more help to the set of commands. This saves you a lot of researching of the OpenWRT build structure.
    • Patches to certain files for subversion tag 16442.
    • Both kernel and OpenWRT configuration files for subversion tag 16442. These files have my recommended selections.
    • The build target 16442 is pre-selected. It works properly with the RouterStation.
    • A folder with the speed fixed RouterStation RedBoot partition. The make will package the build result with the RedBoot partition file. The resulting file will be named FullFlash.bin.
  • Issue the command 'make' for verbose help on all make targets.
    • Start the build with the command 'make all'.
    • Answer 'y' to the prompt for ubnt-webinfo.
  • A successful build results in the flash file "(build folder)/openwrt/bin/FullFlash.bin"
  • Send this file to the RouterStation with tftp.
    • Set up your computer's Ethernet interface to the ip address 192.168.1.3
    • Cycle power on the RouterStation and hold in the SW4 pushbutton. The RF LED should light. Release SW4.
    • Try to ping 192.168.1.20. If it fails, try again. When successful, move to the next step.
    • Send the flash file to the RouterStation (e.g. 'tftp -i 192.168.1.20 PUT FullFlash.bin')
    • Wait about 5 minutes before cycling power or rebooting the RouterStation. If you have a serial port connection to the RouterStation, you will see the /jffs output when the flash is finished.


Notes:
=====
To add packages (or feeds), add the package name to the file AddedFeeds (space delimited). Then, either 'make clean' or delete "(build folder)/openwrt/.prepared" to add the packages after a previous build.

To add X-Wrt support, add these feeds: webif webif-applications. Then, 'make clean' and rename "(build folder)/packages-other/ubnt-webinfo" or choose 'n' to ubnt-webinfo when reconfiguring.

Other files are built to support this build version and others may be built depending on selected options (e.g. files in the Packages folder). These may need to be transferred to the RouterStation after the RouterStation is flashed. To do this:
  • Run the ftp daemon on the RouterStation (it is included in this build config) and transfer the files. See the help on how to run it.
  • Install the transferred file with the opkg command.

The typical file build target "(build folder)/openwrt/bin/openwrt-ar71xx-ubnt-rs-squashfs.bin" is also created. Use this file for future flash updates if you don't want to update RedBoot each successive time you flash.

To add ipsec support, add these feeds: ipsec-tools isakmpd libgmp openswan tcpdump. The component libgmp is required to build OpenSwan therefore, issue this command on the Ubuntu platform: 'apt-get libgmp3-dev'. During the make, answer 'm' to openswan, and kmod-openswan. OPENSWAN FAILS TO PRODUCE A VALID PACKAGE FOR BUILD 16442. To get the latest version (2.6.23dr1), edit the openswan Makefile as follows:
  • PKG_NAME:=openswan
  • PKG_VERSION:=2.6.23dr1
  • PKG_RELEASE:=1
  • PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  • PKG_SOURCE_URL:=http://www.openswan.org/download/development/
  • PKG_MD5SUM:=100f49503a0909f3e6cd14fcba663062

Useful command to search for an Ubuntu package: 'apt-cache search <package>' where <package> is the package name or name portion you are looking for.

Tips & tricks:
==========
Modify "(build folder)/patches/002-default-ubnt-configuration.patch" to change the defaults.
  • root password: Update the change at Index: openwrt-routerstation/openwrt/package/base-files/files/etc/passwd
  • initial network configuration: Update the change at Index: openwrt-routerstation/openwrt/target/linux/ar71xx/base-files/etc/defconfig/routerstation/network
  • hostname: Update the change at Index: openwrt-routerstation/openwrt/target/linux/ar71xx/base-files/etc/defconfig/routerstation/system

Copying between Windows host and Ubuntu VMware:
========================================
  • To transfer between systems, install a TFTP daemon on Ubuntu and use a Windows TFTP client to copy the files. XP comes with one installed. A free one is available here: http://www.tftp-server.com/tftp-download.html
  • Issue the following command on Ubuntu: 'apt-get install tftpd-hpa'.
  • Create a new directory on the Ubuntu system at /tftpfiles and 'chmod 777 /tftpfiles'.
  • Edit /etc/default/tftpd-hpa and change 'OPTIONS="-l -s /var/lib/tftpboot"' to 'OPTIONS="-c -s /tftpfiles"'. Also change RUN_DAEMON=no to RUN_DAEMON=yes.
  • Start the daemon with the command '/etc/init.d/tftpd-hpa start'.
  • Copy the file that you want to send to Windows into the /tftpfiles folder.
  • From Windows, transfer the file with tftp. When you tranfser a file, specify the destination (e.g. tftp -i 192.168.0.1 PUT x.tgz /tftpfiles/x.tgz) or you will get an error.
  • Note: other settings of interest in /etc/xinetd.d/tftp
Attached Files
File Type: zip RSbuildSetup.zip (25.4 KB, 66 views)
File Type: zip RSredbootROM.zip (86.4 KB, 48 views)
patcou is offline   Reply With Quote
Old 10-23-2009, 06:55 AM   #2
steinmb
Junior Member
 
Join Date: Sep 2009
Location: New Jersey and Norway
Posts: 13
Send a message via AIM to steinmb Send a message via MSN to steinmb Send a message via Yahoo to steinmb Send a message via Skype™ to steinmb
Default

Thank you for a great write up! Is there a special reason to stick with 8.10 instead of the current 9.04?
steinmb is offline   Reply With Quote
Old 10-23-2009, 12:32 PM   #3
JimWright
Junior Member
 
Join Date: Jul 2009
Location: Austin, Tx
Posts: 21
Default

I think this is the first writeup I've seen that includes the redboot ROM code, nice work.

Two questions... First, I'm assuming that these steps will work with trunk builds as well (16442 is a bit old, and lacks a number of RS fixes), specifically with regard to how the redboot code gets built? Second, will this version of the redboot ROM work on the RS Pro also? As far as I know Ubnt hasn't posted a separate ROM for the RS Pro, and even downloads for the original Routerstation are only available if you search the forums, neither product has a listing on the main Downloads page.
JimWright is offline   Reply With Quote
Old 11-04-2009, 09:39 AM   #4
patcou
New User
 
Join Date: Oct 2009
Posts: 4
Default

No reason other than it was available at the time I was doing the development.
I just stuck with the Ubuntu version that was working for me. A newer version should work - it may require some minor changes to the steps above.
patcou is offline   Reply With Quote
Old 11-04-2009, 09:49 AM   #5
patcou
New User
 
Join Date: Oct 2009
Posts: 4
Default

Quote:
Originally Posted by JimWright View Post
I think this is the first writeup I've seen that includes the redboot ROM code, nice work.

Two questions... First, I'm assuming that these steps will work with trunk builds as well (16442 is a bit old, and lacks a number of RS fixes), specifically with regard to how the redboot code gets built? Second, will this version of the redboot ROM work on the RS Pro also? As far as I know Ubnt hasn't posted a separate ROM for the RS Pro, and even downloads for the original Routerstation are only available if you search the forums, neither product has a listing on the main Downloads page.
Q1:
These steps will work with more recent snapshots with the exception that the patch files are not necessarily appropriate (changes since 16442 may break the patching of files).

The Redboot ROM code here is not built - it is simply the extraction of the appropriate binary code from Mike Ford's post to fix the RouterStation performance. I extracted the binary data, placed it in a ROM file, figured out the correct parameters to pass to make the firmware image, and then updated the Makefile.

Bottom line: If you change the snapshot number in the Makefile and try the build, you may have success without any changes.

Q2:
I do not have a RS Pro and I bet that the Redboot for it is different. I could extract the RS Pro Redboot ROM binary data out of a RSPro image. Then it could be built into the Makefile process just like I did here. I would have to get an RSPro to make sure my work is accurate - unless you want to test it.
patcou is offline   Reply With Quote
Old 11-12-2009, 10:34 AM   #6
helix247
Junior Member
 
Join Date: Oct 2009
Posts: 13
Default

This is Awesome! Nothing more to say!
helix247 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:21 PM.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Ubiquiti Networks, Inc. Copyright © 2009, All Rights Reserved.