Version 8 (modified by matthijs, 3 years ago)

Remove weird "tl;dr"

Sources and toolchain to build fon-ng and applications

Needed packages:subversion g++ libdigest-crc-perl ncurses-dev zlib1g-dev gawk bison flex autoconf intltool-debian intltool
Subversion server: http://svn.fonosfera.org
Commands:$ svn co http://svn.fonosfera.org/fon-ng/trunk/
$ cd trunk
$ chmod +x install.sh
$ ./install.sh
$ cd openwrt
$ make menuconfig #save
$ make V=99


Introduction

A corner stone of the fonosfera is its  subversion server which feature reading writes for all enthusiasts willing to retrieve sources and toolchain to cross compile the blending edge fon-ng firmware or their own applications. If you have a development project for the fon-ng firmware, contact us we will open you a folder with witting rights.


Needed Packages

The set of packages needed to retrieve and compile fon-ng depends on the distribution you are using. Here is how to install them:

Ubuntu 8.10

$ sudo aptitude install subversion g++ libdigest-crc-perl ncurses-dev zlib1g-dev gawk bison flex autoconf intltool-debian intltool

Debian

# apt-get install binutils cpp gcc libc6-dev linux-kernel-headers make zlib1g-dev ncurses-dev g++ gawk bison flex unzip bzip2 autoconf libdigest-crc-perl python subversion


Retrieve Sources

To retrieve the sources from fonosfera's svn create a folder in a partition where you have at least 3GB of available space.

Download sources

$ svn co http://svn.fonosfera.org/fon-ng/trunk/

When download is completed subversion will echo the version downloaded: Checked out revision XXX. You may save that for future reference.

Update and install FON feeds

$ cd trunk
$ chmod +x install.sh
$ ./install.sh


$ cd openwrt
$ make menuconfig

No change are compulsory. Just make sure that you have the right target system selected (Fonera+, Fonera 2.0 or Fonera 2.0n), then you can just exit, save and build fon-ng.

menuconfig main screen


OpenWRT Applications

Some of the packages from  OpenWRT repository will run on fon-ng. Though kernel modules (kmod-... packages) won't work as fon-ng uses a different version of the linux kernel than OpenWRT Kamikaze 8.09 In addition you will get the most recent versions of the applications if you compile them yourself.

Update and install OpenWRT feeds

$ ./scripts/feeds update -a
$ ./scripts/feeds install -a
  • To get specific applications to be compiled each time you build fon-ng, mark them as <M> in menuconfig so they get built as packages.
  • Mark them as <*> if you want them directly integrated in the built image.
  • Mark Select all packages by default to get all applications to be compiled as packages. Build will take way longer and you are more likely to run into errors.

menuconfig buil as a package


Set kernel options

Though it should not be necessary, to change the options of the linux kernel run:

$ make kernel_menuconfig


Set image to developer mode

Before building fon-ng make sure that developer mode (SSH access) is set in ~/fon-ng/trunk/fon/fonbase/files/etc/config/registered: 'dev' option should be set to '1' as in:

config fonreg fonreg
	option	registered	0
 	option	dev		1


Build

Building an image is a long process, depending highly on your hardware and on what you selected to be compiled. As a really ruf estimation, just to give an idea, you should not count on less than an hour and up to five if you want to compile all OpenWRT packages. The first time you build several extra sources will be downloaded automatically, rendering the process longer that usual.

Build image

$ make V=99

V=99 option gives a verbose output. If the compilation fails with an error it allows you to get back a little and see what happened, or copy/paste the the end of the output to get help.

Build a specific application as a package

$ make package/name/{clean,compile,install} V=99 DEVELOPER=1

Replace name by the name of what you want to build i.e. amule. All decencies will be built along, in separated packages.

Built Binaries

  • Binary image are found in ~/fon-ng/trunk/openwrt/bin:
    • loader.bin is the second stage Meraki loader
    • openwrt-fonera2-vmlinux.image is the kernel image
    • openwrt-fonera2.image is the binary image of fon-ng. It contains the rootfs and the kernel for the Fonera 2.0 and can be directly written to the image partition.
    • Each file is as well available in  Executable and Linkable Format
  • Packages are found in ~/fon-ng/trunk/openwrt/bin/packages/mips. Note that both the ones included in the built image and the ones compiled as package are there.


References

  • For instruction on how to flash your Fonera with a new firmware image  checkout this page
  • fon-ng is based on the OpenWRT kamikaze linux distribution. Most of what apply to OpenWRT as well do to fon-ng. Do not hesitate to consult  OpenWRT docucmentation or any other OpenWRT related documentation.
  • Questions, problems, feedback regarding this page? Join our  mailing list

Attachments