PLEASE NOTE: This article is obsolete or related to a discontinued product.

Using FPKG

by John Crispin

!!! The FPKG tool is only available if you use a fimage that was generated using a SDK that has the phrozen patch applied !!!

What is FPKG

FPKG is the FOXBOARD package management tool. It is very similar to tools such as apt and ipkg. It allows you to install procompiled binaries to the FOX directly from a webserver that has a fpkg hive installed. It is furthermore possible to download STP files (firmware for the FPGA) and flash your FOX with a precompiled fimage. The acmesystem webserver has one of these hives installed.

Using FPKG

There are several tasks that can be achieved using FPKG

Listing files in the hive

In order to find out, what you can install type the following command
$ fpkg -l
Found hive : http://www.phrozen.biz/fox_hive/ in config file
Using lib : glibc
downloading http://www.phrozen.biz/fox_hive/files.list to /var/tmp/files.list
Tetris - Play tetris on nano-X
Chess - Play chess on nano-X
release-RC4 - Upgrade your system with FPGA RC1 (fimage & vhdl)
release-RC4-vhdl - Upgrade your system with FPGA RC1 (vhdl)

Downloading and installing an application

If you now want to install Tetris for example, simply execute the following command
$ fpkg -g Teris
Getting app : Tetris
Found hive : http://www.phrozen.biz/fox_hive/ in config file
Using lib : glibc
downloading http://www.phrozen.biz/fox_hive/files.list to /var/tmp/files.list
downloading http://www.phrozen.biz/fox_hive/glibc/ntetris to /mnt/flash/ntetris
The file you just downloaded has the correct size
The Tetris game is now install under /mnt/flash and can be started from there. If you have for example a USB stick or a MMC card attached and want to download the tool there rather than in /mnt/flash you will have to use the -t option
$ fpkg -g Teris -t /mnt/0/
Getting app : Tetris
Found hive : http://www.phrozen.biz/fox_hive/ in config file
Using lib : glibc
downloading http://www.phrozen.biz/fox_hive/files.list to /var/tmp/files.list
downloading http://www.phrozen.biz/fox_hive/glibc/ntetris to /mnt/0/ntetris
The file you just downloaded has the correct size
It is as simple as that.

Downloading a firmware upgrade for the FPGA

With FPKG it is possible to do a complete FPGA flash, including the download in one single command. Note that this will only work if the FOXBOARD as a fimage with FOXBONE support installed.
$ fpkg -g release-RC4-vhdl -f
Getting app : release-RC4-vhdl
Found hive : http://www.phrozen.biz/fox_hive/ in config file
Using lib : glibc
downloading http://www.phrozen.biz/fox_hive/files.list to /var/tmp/files.list
downloading http://www.phrozen.biz/fox_hive/misc/FoxConference4PA0.stp to /var/FoxConference4PA0.stp
The file you just downloaded has the correct size
/var/FoxConference4PA0.stp has a size of 195848 bytes
Starting the action program....
Please be patiant. This can take some time !
Everything went well !!
Please note the additional -f option. This tells FPKG to flash the downloaded file into the FPGA The flashing will take about 40 secs. During this time the FOX will not responde. If you want to check if everything went well, you can execute dmesg.

Downloading an fimage and flashing the FOXBOARD

With FPKG it is possible to do a fimage update. Due to the nature of the axis flash tool, this upgrade methode is only possible, when using the serial console. Also it takes some time, so after issuing the command just be patient and wait for a minute or 2 before issuing any further commands to the FOXBOARD
$ fpkg -g release-RC4 -u
fpkg -g release-RC4 -u
Getting app : release-RC4
Found hive : http://www.phrozen.biz/fox_hive/ in config file
Using lib : glibc
downloading http://www.phrozen.biz/fox_hive/files.list to /var/tmp/files.list
downloading http://www.phrozen.biz/fox_hive/misc/FoxConference4PA0.stp to /var/FoxConference4PA0.stp
The file you just downloaded has the correct size
Doing a fimage upgrade : /usr/bin/wget http://www.phrozen.biz/fox_hive/fimage -q -O - | /bin/flash -t flash_all -m FTP
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
Jan  1 00:01:53 axis exiting on signal 15
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
write [9] Bad file descriptor
Receiving new firmware ...
Warning: Parameter HWID not found.
No HWID in bootblock, continuing anyway.
Erasing old file system ...
   1%
   3%
   5%
   7%
   .
   .
   .
  98%
 100%

Loading new file system ...
   1%
   3%
   5%
   7%
   .
   .
   .
  98%
 100%

Erasing old file system ...
   1%
   3%
   5%
   7%
   .
   .
   .
  98%
 100%

Loading new file system ...
   1%
   3%
   5%
   7%
   .
   .
   .
  98%
 100%

The system upgrade completed successfully.
The unit will now reboot.
To continue, please connect to the unit again.
There may be a short delay before the new connection is accepted.
This connection will now close.
You will now have to reset the FOXBOARD by removing and reattaching the power. After that the FOX will boot with the new fimage.