Re: [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: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Writing a YAFFS image to a simulated MTD
On Friday 20 July 2012 12:28:39 Kenneth Ingham wrote:
> 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



What you are doing would work if you were using yaffs2 with inband tags.

If you are not using yaffs inband tags then the tags are being stored in the
nand oob area and you need to use nandwrite including oob.

The current stuff is not very satisfactory and I am (slowly and in background)
building up a new set of yaffs nand tools to help get around these issues.

-- Charles