User manual
Linux Guide taskit GmbH
8. Creating a new user data partition
8.1. Overview
As you can see in chapter the appendix the biggest part of the flash disk is used for a
JFFS2 partition. The Journalling Flash File System version 2 or JFFS2 is a log-structured
file system for use in flash memory devices. Unlike the ext2 filesystem, used for the root
filesystem, with JFFS2 it is possible to create and modify files that are stored directly onto
the flash disk.
This partition is mounted as the directory /config during the boot process and is used to
store your applications as well as the file rc.local.
The file rc.local is executed by the linux kernel after the boot process to start services like
DHCP and telnet. Furthermore it is possible to modify rc.local in that way that your
application is started automatically after the boot process by inserting the following line:
/config/YourApplication
Because write / erase cycles on flash devices are limited, your application should not use
the flash disk to store data that is changed or deleted very often during application runtime
(i.e. temporary files, log files). Rather your application should use the ramdisk for such
operations and copy the needed files to the flash partition in large time intervals or when
the application has finished its work.
8.2. Creating a new JFFS2 image
The default contents of the original jffs2 partition con be found on the starterkit-cd. Simply
copy the folder /config. Then copy your own files to this folder.
After that you can create the image file:
mkfs.jffs2 -e 128 -d ./config -o jffs2.bin
Thean copy it to your /tftpboot folder and install it using U-Boot:
tftpboot 20000000 jffs2.bin
erase 10XXXXXX 10XXXXXX
cp.b 20000000 10XXXXXX $(filesize)
8.3. Archiving the JFFS2 partition
In case installing and configuring your application is very complex it may be useful to have
a backup of the whole partition so that it can be restored quickly when deleting it
accidental.
Making an exact copy of the JFFS2 partition is very simple. First you just have to create an
new directory on the development system to store the archives and export it:
mkdir /develop/backup
chmod 777 /develop/backup
insert the line '/develop/backup *(rw)' into /etc/exports
Then mount it on the taskit device and copy the whole JFFS2 partition (this is the 4
th
flash
partition: /dev/mtd/3) by directly accessing the mtd flash device. To save the archive on the
development system using the filename 'archive2007.jffs2' you have to enter the following
Page 26 of 65 Version 1.26 (2008-04-30)