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

How to put extra files in fimage

This tutorial explains how to insert new files inside an fimage generated with the Phrozen SDK

If you need to product in volume some devices based on the FOX Board, could be very usefull to generate a customized fimage with all the executable and script files requested from your application. In that way you could clone your environment just flashing each board instead of transfer each file on a factory default board.

With a customized fimage it is possible also to put files in the read-only folders to change, for example, the default web page, to enable new users or to change the default root password, etc. etc.

Example 1 - Put a script to start at boottime

On the factory default FOX Boards exists a folder named /etc/init.d/boottime. If you write a script file inside this folder it will start at Linux start-up. This is read/write folder so you can add directly the boot-time script file just creating it but let we see how to embed this file in the fimage:

First of all install the Phrozen SDK and make a default standard image (see Create a working image using Phrozen SDK or Install the Phrozen SDK on Win XP).
Move to the Phrozen SDK root directory (usually /home/fox/devboard-R2_01) and then move to packages/initscript.
Create here a folder named myfiles and create inside it the script file to execute at boot-time. Use for example the file myscript.
echo "This is my script" > /var/myscriptoutput
This script, when started on the FOX Board, will create a file named myscriptoutput in the /var folder contains the line "This is my script". The /var folder is implemented in RAM so it will lost each time the FOX boot-up and creates again from our script.

Now we have to create a Makefile inside the myscript folder to use to add our file while the SDK generates the fimage. This is and example of Makefile to save in myscript.
include $(AXIS_TOP_DIR)/tools/build/Rules.axis

OWN = -o root -g root

	@echo "I'm installing my script file... "
	@echo $(INSTALL)
	@echo $(prefix)
	$(INSTALL) $(OWN) -m 0755 myscript "$(prefix)"/etc/init.d/boottime