Re: [Yaffs] Yaffs mount

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: kelvin
Date:  
To: yaffs
Subject: Re: [Yaffs] Yaffs mount
HuangAlex <by_pacific <at> hotmail.com> writes:

>
>
> Hi guys,
>  
> I just follow this command to mount yaffs img to a flash, but i just see

lost+found directory. Can anyone see whats wrong with it? Thank you,
>  
> Setup environment
> 1 . Install mtd tools
> sudo apt-get install mtd-utils
>  
> 2. Install “git” tool for download
> sudo apt-get install git-core
>  
> 3. Download newest yaffs2 filesystem code
> sudo git clone git://www.aleph1.co.uk/yaffs2
>  
> Config yaffs2 filesystem
> 1. Generate yaffs.ko
> cd xxx/yaffs2
> cp ./ yportenv_multi.h ./yportenv.h
> sudo make modules
> These commands will generate yaffs2multi.ko
>  
> 2. Insmod needed ko files
> sudo modprobe mtd
> sudo modprobe mtdchar
> sudo modprobe mtdblock
> cd xxx/yaffs2
> insmod ./yaffs2multi.ko
> Then, use “cat /proc/filesystem “, you will see that “yaffs2” file system

is listed in the supported filesystem.
>  
> 3. Use nandsim to generate a simulated nand flash device
> sudo modprobe nandsim first_id_byte=0x20 second_id_byte=0xa2

third_id_byte=0x00 fourth_id_byte=0x15
>  
>
> Generate a yaffs2image using mkyaffs2image
> 1. Create rootfs
> Create  “rootfs” dir anywhere, and add bin/, etc/, lib/, root/, tmp/ 

subdirectory,  “hello.txt” file.
> 2. Generate
> xxx/mkyaffs2image xxx/rootfs rootfs.image
> The rootfs.image is needed to write to nand flash.
>  
> Mount yaffs2 image to nand flash
> 1. Erase flash
> sudo flash_eraseall /dev/mtd0
>  
> 2. Write image to flash
> nandwrite -a -o /dev/mtd0 rootfs.image
>  
> 3. Mount
> Create xxx/yaffs2_mount
> mount -t yaffs2 /dev/mtdblock0 xxx/yaffs2
> cd xxx/yaffs2
> You will see bin/, etc/, lib/, root/, tmp, and hello.txt, which are

created when generating yaffs2 image file.
>  
>  
>                       
>
> _______________________________________________
> yaffs mailing list
> yaffs <at> lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>

I follow this step.
And my rootfs.image has 3 files.

But the third
"> Create xxx/yaffs2_mount
> mount -t yaffs2 /dev/mtdblock0 xxx/yaffs2
> cd xxx/yaffs2" maybe some mistake.

The last parameter of the commad mount is the mount-point,and it may be the
XXX/yaffs2_mount not the xxx/yaffs2..
After I mount my yaffs to a mount-point.And cd the mount-point to use "ls",
There are some error:
ls:reading directory .:Not a directory

When I execute the mount commad at the same mount-point
There are errors as follow:
mount: /dev/mtdblock0 already mounted or /mnt/yaffs busy
mount: according to mtab, /dev/mtdblock0 is already mounted on /mnt/yaffs

I think this mean I have mount the yaffs to the point,but I cannot see the
contents in my rootfs.image.
Can anyone help me?Thank you very much.