Markdown source

#OpenWRT 15.05

<img src="./fox_openwrt.jpg">

This article illustrate how to compile and install OpenWRT on the FOX Board G20

##About OpenWRT

"<i>OpenWrt ​is a highly extensible ​GNU/​Linux ​distribution for embedded devices ​(typically wireless routers). 
Unlike many other distributions for these routers, OpenWrt ​is built from the ground up to be a 
full-featured, easily modifiable operating system for your router. In practice, this means that 
you can have all the features you need with none of the bloat, powered by a Linux kernel ​that's more 
recent than most other distributions</i>" [Read more...](

## Requirements

* This procedure was tested on a Linux PC with <b>Ubuntu 15.10</b>
* It is advisable to have a [Debug Port Interface](/DPI) or similar during the kernel bootstrap

##Requested packages:

Install these packages on your Linux PC 

<pre class="terminal">
~$ <b>sudo apt-get update</b>
~$ <b>sudo apt-get -y install git openssl unzip</b>
~$ <b>sudo apt-get -y install binutils flex bison autoconf gettext texinfo</b>
~$ <b>sudo apt-get -y install sharutils subversion libncurses5-dev ncurses-term zlib1g-dev gawk</b>
~$ <b>sudo apt-get -y install build-essential</b>
~$ <b>sudo apt-get -y install libssl-dev</b>

##Step-by-step procedure

Clone the OpenWRT git repository:

<pre class="terminal">
~$ <b>git clone git://</b>
~$ <b>cd openwrt</b>

Update the software packages (feed)

<pre class="terminal">
~/openwrt$ <b>./scripts/feeds update –a</b>
~/openwrt$ <b>./scripts/feeds install -a</b>

Save this file in the openwrt directory and rename it <b>.config</b>:

* [acme-foxg20_defconfig](./acme-foxg20_defconfig)

Select your configuration

<pre class="terminal">
~/openwrt$ <b>make menuconfig</b>
~/openwrt$ <b>make defconfig</b>
~/openwrt$ <b>make prereq</b>

Configure the Linux Kernel

<pre class="terminal">
~/openwrt$ <b>make kernel_menuconfig</b>

Launch the compilation

<pre class="terminal">
~/openwrt$ <b>make V=s</b>

Copy the kernel image and the device tree blob

<pre class="terminal">
~/openwrt$ <b>cd bin/at91</b>
~/openwrt/bin/at91$ <b>cat openwrt-at91-legacy-zImage openwrt-at91-legacy-9g20ek-oftree.dtb > /media/$USER/boot/uImage</b>

Copy the rootfs contents

<pre class="terminal">
~/openwrt/bin/at91$ <b>sudo tar -xvzpSf openwrt-at91-legacy-AT91SAM9G20EK-rootfs.tar.gz -C /media/$USER/rootfs</b>

Unmount the microSD, insert the [debug port](/DPI) and try. Press a key on your serial terminal to
get the access to the system prompt:

<pre class="terminal">
BusyBox v1.23.2 (2016-03-31 20:47:06 CEST) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 CHAOS CALMER (Chaos Calmer, r49097)
  * 1 1/2 oz Gin            Shake with a glassful
  * 1/4 oz Triple Sec       of broken ice and pour
  * 3/4 oz Lime Juice  [   45.000000] random: nonblocking pool is initialized
     unstrained into a goblet.
  * 1 1/2 oz Orange Juice
  * 1 tsp. Grenadine Syrup

##Procedura rapida partendo dai file compilati

Tempo richiesto: <b>Circa 10 minuti</b>

Per seguire questa pocedura occorre:

* Una microSD da almeno 1GB
* Una macchina Linux Ubuntu con Gparted installato

Formattare la microSD con due partizzioni fat32 e ext4 come descritto in questo articolo:

* [Formattazione microSD](

Creare una directory nella vostra home directory e copiarci detro i seguenti files:

* [boot.tar.bz2](./boot.tar.bz2) Contenuto della prima partizione
* [rootfs.tar.bz2](./rootfs.tar.bz2) Contenuto della seconda partizione

Montare la microSD quindi dare i i seguenti comandi all'interno della directory appena creata:

<pre class="terminal">
tar -xvjpSf boot.tar.bz2 -C /media/$USER/boot 
sudo tar -xvjpSf rootfs.tar.bz2 -C /media/$USER/rootfs 

Smontare la microSD e provare a fare il boot sulla FOX


* [OpenWrt web page](
* [OpenWrt doc](
* [OpenWrt build system – Installation](
* [Network configuration](
* [Installing LuCI on uHTTPd](


Many thanks to <b>Leo Guainella</b> for his effort to find and provide this info