mounting jffs2 image on nand

rick adams rgadams at cox.net
Thu Dec 1 15:22:59 EST 2005


On Wed, 2005-11-30 at 12:00 -0500, linux-mtd-request at lists.infradead.org
wrote:
> Message: 2
> Date: Wed, 30 Nov 2005 10:06:20 +0100
> From: "David Huelves" <david.huelves at negone.com>
> Subject: mounting jffs2 image on nand.
>
>  we have create
> the image using mkfs.jffs2 on a i386 host computer (mkfs.jffs2 -d
> <root_dir> -e 16384 <image file>) our target is PXA255 and ST

When you run mkfs.jffs2 on an 1386 host it makes a file system for the
i386 architecture and kernel and jffs version on the host. This may not
be appropriate for your target system. If you run the utility on the
host the utility needs to be for your target and jffs version. Just like
the gcc compiler. You wouldn't expect an executable built to run on the
i386 host to run on the target. But you can run a gcc cross compiler on
the host to generate an executable that will run on the target. If you
don't have a host utility for your target see the two suggestions below.

>     If we do such with an ext3 everything works fine.

I assume from this statement that you can NFS mount a ext3 root file
system on the target. If this is true here are two ways to create your
jffs2 file system.
1) With the root file system NFS mounted, login to the target as root
and run the target version of mkfs.jffs2 on the target. Then use the
generated file to write to flash.
2) With the root file system NFS mounted and an erased JFFS2 file system
mounted (not as root file system). Login to the target as root and copy
the root file system from the NFS mount to the jffs2 mount. I'd use the
cp -a command. The copy command will use the MTD/jffs2 layer to compress
the files when it writes to a jffs2 partition.

Which one is "better" depends on several issues that are dependent on
your installation and personnel preference. I leave that up to you to
decide.

Rick Adams





More information about the linux-mtd mailing list