Specifications

a 10
b 11
c 12
d 13
e 14
f 15
__EOD__
chmod 0666 /tmpfs/dev/*
3.
We can now create a cramfs file system image using the mkcramfs tool:
$ ROOTFS_DIR=rootfs # directory with root file system content
$ ROOTFS_ENDIAN="-r" # target system has reversed (big) endianess
$ ROOTFS_IMAGE=cramfs.img # generated file system image
PATH=/opt/eldk/usr/bin:$PATH
mkcramfs ${ROOTFS_ENDIAN} ${DEVICES} ${ROOTFS_DIR} ${ROOTFS_IMAGE}
Swapping filesystem endian-ness
bin
dev
etc
...
-48.78% (-86348 bytes) in.ftpd
-46.02% (-16280 bytes) in.telnetd
-45.31% (-74444 bytes) xinetd
Everything: 1864 kilobytes
Super block: 76 bytes
CRC: c166be6d
warning: gids truncated to 8 bits. (This may be a security concern.)
4.
We can use the same setup as before for the JFFS2 filesystem, just changing the bootargument to
"rootfstype=cramfs"
5.
9.5.4. Root File System on a Read-Only ext2 File
System
When storing the root file system in on-board flash memory it seems only natural to look for special flash
filesystems like JFFS2, or for other file system types that are designed for such environments like cramfs. It
seems to be a bad idea to use a standard ext2 file system because it contains neither any type of wear
leveling which is needed for writable file systems in flash memory, nor is it robust against unorderly
shutdowns.
The situation changes if we use an ext2 file system which we mount read-only. Such a configuration can be
very useful in some situations.
Advantages:
very fast
low RAM memory footprint
Disadvantages:
high flash memory footprint because no compression
To create an ext2 image that can be used as a read-only root file system the following steps are necessary:
Create a directory tree with the content of the target root filesystem. We do this by unpacking our
master tarball:
1.
9.5.4. Root File System on a Read-Only ext2 File System 118