Overview
========
  Ubiquiti Networks LiteStation devices support third-party firmware
upgrade files since version 1.5.
Currently, OpenWRT are known to work on LiteStation2 and Litstation5
and IkarusOS is known to work on LiteStation2 using appropriate firmware 
upgrade files. Here is the description of firmware making utilities.

MKFWIMAGE
=========
  'mkfwimage' is the utility that provides possibility to build Ubiquiti Networks LiteStation
device compatible firmware from any available thrid-party firmware. The two essential parts
are required for that:
  * kernel - LZMA or GZIP compressed kernel image
  * rootfs - root file system image. It can be cramfs, squashfs or jffs. Type of image
     	     depends on features supported by the kernel.
  These two parts are dependent that is why separate upgrade of these parts is not allowed by
Ubiquiti Networks LiteStation device firmware upgrade.
All other parts are optional (like 'RedBoot', 'cfg') and can be used by the situation.

Usage: mkfwimage [options]
        -v <version string>      - firmware version information, default: UNKNOWN
        -o <output file>         - firmware output file, default: firmware-image.bin
        -i <input file>          - firmware layout file, default: none
        -h                       - this help

Version restrictions:
        LiteStation2 firmware version MUST start with 'LS2.ar2316.' (no quotes)
        LiteStation5 firmware version MUST start with 'LS5.ar2313.' (no quotes)


Firmware layout file
====================
  Layout file is used to provide Ubiquiti Networks LiteStation device flash layout and some
additional information for the 'mkfwimage' utility. 
  Layout file entries sepatated by tabs are:
  
  * Partition name - as it is seen in RedBoot fis list.
  * Part No 	   - index (as represented by Linux MTD driver). Value is in network byte order.
  * Base Address   - flash device base address - meaning is the same as in RedBoot bootloader,
  		     used when repartitioning flash device. Repartitioning is performed only when
		     actual partition scheme is different from the one supplied in firmware upgrade
		     image. Value is in network byte order.
  * Memory Address - Memory address to load data to. Used by bootloader (RedBoot Mem Addr) - 
		     meaningful for executable segments only (e.g. kernel). 
		     May be zero to indicate that no memory address changes should be done.
		     Value is in network byte order.
  * Entry Address  - partition execution entry address - meaningful for kernel data only.
  		     Value is in network byte order.
  * Partition Size - Maximum size this partition should consume. Value is in network byte order.
  * File Name      - Path to part file to use.
  
  There is an example of firmware layout file used with OpenWRT distribution for Ubiquiti Networks LiteStation2: 
+--------------+-------+-----------+-----------+------------+-----------+----------------------------------+
|Partition Name|Part No|Base Addr  |Part Size  |Memory Addr |Entry Addr |File Name                         |
|--------------+-------+-----------+-----------+------------+-----------+----------------------------------|
|kernel        |0x01   |0xBFC30000 |0x000D0000 |0x80041000  |0x80041000 |openwrt-atheros-2.6-vmlinux.lzma  |
|--------------+-------+-----------+-----------+------------+-----------+----------------------------------|
|rootfs        |0x02   |0xBFD00000 |0x002C0000 |0x00000000  |0x00000000 |openwrt-atheros-2.6-root.jffs2-64k|
|--------------+-------+-----------+-----------+------------+-----------+----------------------------------|
  ls2-openwrt.txt and ls5-openwrt.txt contain OpenWRT image information for LiteStation2 and LiteStation5.

Examples of building firmware images (from current directory):
  LiteStation2: 
  	src/mkfwimage -i ls2-openwrt.txt -v LS2.ar2316.OpenWRT-kamikaze -o LS2.OpenWRT-kamikaze.bin
  LiteStation5:
  	src/mkfwimage -i ls5-openwrt.txt -v LS5.ar2313.OpenWRT-kamikaze -o LS5.OpenWRT-kamikaze.bin
  	

FWSPLIT
=======
  'fwsplit' is the utility that provides possibility to split any Ubiquiti Networks LiteStation
device compatible firmware into separate parts.

Usage: fwsplit [options] <firmware file> [<fw file2> ... <fw fileN>]
        -o <output file prefix>  - output file prefix, default: firmware version
        -d                       - turn debug output on
        -h                       - this help
