Sonic Alert 2.8 Clock Radio User Manual


 
5.3 Linux Support 24
Linux boot command line parameters to the kernel also helps here. Typical
usage includes is of the following form, which supplies both the MTD partition
information and the root filesystem reference:
mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs
In English, this reads as something like:
MTD partitions are 1MB (named armboot), 256K(named params),
with the remainder of flash named rootfs1. The root filesystem
is in the third partition, and its’ type is cramfs.
Mounting a JFFS2 image is done in the same manner, except the rootfstype
parameter has a value of jffs2.
The U-Boot boot loader supports copying data from RAM to flash for
upgrades and such. Refer to the unprotect, erase, and cp commands for
details.
A third means of mounting one of these root filesystems is to use a loop
device. In Linux jargon, a loop device is a file that contains a filesystem
within it. Both the initrd and cramfs images may be used in this fashion as
shown in the following examples.
Mount a cramfs file (by far the simplest case).
~ $ sudo mount -o loop -t cramfs ~/cramfs.img /mnt/cramfs
Mount an ext2 image (Only slightly harder because mmcinitrd is actually
gzipped and needs to be gunzip’d first).
~ $ cp -f mmcinitrd mmc.img.gz
~ $ gunzip mmc.img.gz
~ $ sudo mount -o loop -t ext2 ~/mmc.img /mnt/ext2
To mount a JFFS2 image a bit more is needed. Your kernel needs to
have mtd and mtdblock support compiled in or installed as modules. Then,
a mtdram device can be created, you can copy the JFFS2 data to it and
mount the device.
The Handhelds site has more information on the topic.
~ $ sudo /sbin/insmod mtdram total_size=32768 erase_size=256
Using /lib/modules/2.4.23_pre8-gss-r2/kernel/drivers/mtd/devices/mtdram.o
~ $ sudo dd if=jffs2.img of=/dev/mtd0
10809+1 records in
10809+1 records out
~ $ sudo /sbin/insmod mtdblock
Using /lib/modules/2.4.23_pre8-gss-r2/kernel/drivers/mtd/mtdblock.o
~ $ sudo mount -r -t jffs2 /dev/mtdblock/0 /mnt/jffs2/
~ $ ls /mnt/jffs2/
bin etc lib linuxrc opt proc sbin sysfs tmp usr var
December 28, 2005 Revision 2.8