[Yaffs] Writing a YAFFS image to a simulated MTD

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kenneth Ingham
Date:  
To: yaffs
Subject: [Yaffs] Writing a YAFFS image to a simulated MTD
I am using the kernel modules mtd, mtdblock, and nandsim to create a
simulated YAFFS setup for experimenting.

I can mount an empty YAFFS2 filesystem, mount it, copy files to it, etc.

What I cannot do is to create a YAFFS2 image and write it to the
simulator. flash.img is my YAFFS2 image; I have tried both mkyaffs2
from yaffs2utils and mkyaffs2image.bin from Google code. I can
unyaffs2 the image and extract the files.

Here is what I have tried:
dd if=/tmp/flash.img of=/dev/mtdblock0
nandwrite --pad /dev/mtd0 flash.img
flashcp flash.img /dev/mtd0

After any of these, all I have is an empty filesystem. What am I missing?

Environment: OpenSUSE 12.1, kernel 3.1.10-1.16, relevant packages:
yaffs2multi-kmp-desktop-0.0.848_k3.1.10_1.16-3.5.x86_64
yaffs2utils-0.2.8.0.svn33-3.1.x86_64
mtd-utils-1.2.0-3.1.x86_64

Thanks for any advice!

Kenneth Ingham