<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rdf:RDF [
<!ENTITY % HTMLlat1 PUBLIC
 "-//W3C//ENTITIES Latin 1 for XHTML//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
]>
<rdf:RDF
 xmlns="http://purl.org/rss/1.0/"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:admin="http://webns.net/mvcb/"
>
<channel rdf:about="http://www.tuxx-home.at">
<title>Fon</title>
<link>http://www.tuxx-home.at/archives/cat_18/</link>
<description>News from the front</description>
<dc:language>en-us</dc:language>
<dc:creator>Alexander Griesser</dc:creator>
<dc:date>2007-11-11T10:32:32+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.tuxx-home.at/archives/2007/10/10/T09_17_17/" />
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://www.tuxx-home.at/archives/2007/10/10/T09_17_17/">
<link>http://www.tuxx-home.at/archives/2007/10/10/T09_17_17/</link>
<title>HOWTO extract FON firmware archives (.fon)</title>
<dc:date>2007-10-10T09:17:17+01:00</dc:date>
<dc:creator>Alexander Griesser</dc:creator>
<dc:subject>Fon</dc:subject>
<description><![CDATA[Since yesterday I'm trying to extract <a class="external" href="http://www.fon.com">FON</a> firmware files (ending with .fon) to have a look at the internals
of these routers.<br />
Doing this isn't that easy, because it isn't documented anywhere (at least
I haven't found useful information about this), so I started at <a class="external" href="http://stefans.datenbruch.de/lafonera">Stefan's Fonera Hacking website</a> and found a script called <a class="file" href="http://stefans.datenbruch.de/lafonera/scripts/defon.sh">defon.sh</a> which does basically extract the embedded tar.gz archive out of the fon image file:<br />
<pre>
tuxx@vi-edv003:~/fonfw$ ./defon.sh fonera_0.7.1.5.fon &gt;fonera.tar.gz
Upgrade contains a new firmware
tuxx@vi-edv003:~/fonfw$
</pre>
After "defoning" the .fon file, you'll get a file called "fonera.tar.gz" which
can now easily be extracted:<br />
<pre>
tuxx@vi-edv003:~/fonfw$ tar xzf fonera.tar.gz
tuxx@vi-edv003:~/fonfw$ ls
defon.sh  fonera.tar.gz  fonera_0.7.1.5.fon  hotfix  rootfs.squashfs  upgrade
tuxx@vi-edv003:~/fonfw$
</pre>
As you can see, a file called <strong>"rootfs.squashfs"</strong> got extracted.
All my attempts to either `mount` it or `unsquashfs` it failed, but after a
lot of googling, I found <a class="external" href="http://www.neufbox4.org/wiki/index.php?title=Extraction_du_firmware">this site</a> which talks about different
ways of extracting specific squashfs files and the last mentioned method with the help of the <a class="external" href="http://www.bitsum.com/firmware_mod_kit.htm">Firmware Modification Kit</a> finally worked!<br />
At first, you'll have to download the firmware modkit archive and extract it:<br />
<pre>
tuxx@vi-edv003:~/fonfw$ wget -q http://download.berlios.de/firmwaremodkit/firmware_mod_tools_prebuilt.tar.gz
tuxx@vi-edv003:~/fonfw$ mkdir firmware_mod_tools
tuxx@vi-edv003:~/fonfw$ tar -x -C firmware_mod_tools -f firmware_mod_tools_prebuilt.tar.gz
tuxx@vi-edv003:~/fonfw$
</pre>
Now you can use the script "unsquashfs-lzma" for SquashFS v3.0 filesystems to
finally extract the archive:<br />
<pre>
tuxx@vi-edv003:~/fonfw$ firmware_mod_tools/src/squashfs-3.0/unsquashfs-lzma rootfs.squashfs
Reading a different endian SQUASHFS filesystem on rootfs.squashfs

created 330 files
created 53 directories
created 145 symlinks
created 0 devices
created 0 fifos
tuxx@vi-edv003:~/fonfw$
</pre>
The generated directory <strong>"squashfs-root"</strong> now contains the contents 
of the FON firmware:<br />
<pre>
tuxx@vi-edv003:~/fonfw$ ls squashfs-root/
bin  dev  etc  jffs  lib  mnt  proc  rom  sbin  sys  tmp  usr  var  www
tuxx@vi-edv003:~/fonfw$
</pre>
<br />
Happy hacking  <img src="http://www.tuxx-home.at/moods/smilies/wink.gif" alt=";)" />]]></description>
</item>
</rdf:RDF>
