How-to create your own Zarus Rom Image

NOTE: This document is plagurized form a web site I lost the URL to. Please help be reference the source. Mark Grennan.

The SL-5k allows new software to be installed and to a limited extent programs which are in ROM to be updated. However executables in /bin and /sbin cannot be updated.

Sharp provide a tar copy of the root filesystem here but it does not include any of the Qt/Embedded applications. Fortunately it is fairly easy to update the 1.02 ROM image for the root filesystem. To do this requires a copy of the 1.02 ROM update from Sharp and a Linux desktop PC with support for loopback devices and cramfs filesystems.

The steps are

  1. Update the SL-5k to the 1.02 ROM image. The image and update instructions can be found on Sharp's download page. Do not forget to backup any data as it will be lost during the upgrade.
  2. Copy the romimage file to a Linux desktop PC
  3. Mount the root filesystem in the image. To do this enter the following commands as root
  4. mkdir /mnt/sl5k-root

    losetup -o 1835008 /dev/loop0 <path-to-romimage>

    mount -t cramfs /dev/loop0 /mnt/sl5k-root

  5. Make a writeable copy of the filesystem

cp -a /mnt/sl5k-root /tmp/sl5k-root

 
At this point make any desired changes to the filesystem. The default contents of files in /home are found in the file /tmp/sl5k-root/root/.home_default.tar. To change these files (which include files in /etc) unpack the tarfile, edit the files as necessary, then update the tar file. When unpacking the tar file do not do so in /tmp/sl5k-root as you will overwrite some of the startup files.
 

Finally create a new cramfs image with the command

mkcramfs /tmp/sl5k-root initrd.bin

Note that not all of the space in the flash ROM is available for the root fs - some is taken up by the boot code and compressed kernel. This means that there is a limit to the size of the image. This limit is just over 14MB (in fact it is 14811136 bytes).

All that remains is to update the flash ROM with the new image. The procedure is the same as for the original update. Copy initrd.bin to the root directory of a compact flash card (if it is the card that you used for the original update remember to remove the romimage file), then follow the flash rom update instructions starting at step 5.