unpack yaffs2

fatbrain
Hi All,
how to unpack a yaffs2 image file created with mkyaffs2image-128M.
I tried unyaffs from 
http://code.google.com/p/unyaffs/downloads/list
but it does not work.
The image file is a valid file and is working ...

regards
--fatbrain

PJvG
Maybe it's possible to mount it?
I'm not sure though, I think you've got to look into it yourself..

I know for sure it's possible to mount an ext2 image file, since I did that
yesterday.

Good luck!

Dmitry
Hello,

Still not clear how to unpack a yaffs2 image file created with
mkyaffs2image-128M
not only mkyaffs2image-128M but also mkyaffs2image-mlc2 too...
I have MLC2  NAND Samsung K9GAG08U0F

I have study a lot of manuals such as following
http://tjworld.net/wiki/Linux/Kernel/SimulateNandMtdDevice#SimulateNANDM...
but result still negative. 

I was not able to mount correctly images from FriendlyARM FTP

Please somebody can explain me what is wrong here?  

#!/bin/sh

git clone git://www.aleph1.co.uk/yaffs2
cd /yaffs2

ln -s yportenv_multi.h yportenv.h
#   ln: creating symbolic link `yportenv.h': File exists

#above line not work  because #yportenv.h already present in work folder
#ignore this....
     
make

#make -C /lib/modules/2.6.32-27-generic/build M=/yaffs2 modules
#make[1]: Entering directory `/usr/src/linux-headers-2.6.32-27-generic'
#  CC [M]  /yaffs2/yaffs_mtdif_multi.o
#  CC [M]  /yaffs2/yaffs_packedtags1.o
#  CC [M]  /yaffs2/yaffs_ecc.o
#  CC [M]  /yaffs2/yaffs_vfs_multi.o
#  CC [M]  /yaffs2/yaffs_guts.o
#  CC [M]  /yaffs2/yaffs_packedtags2.o
#  CC [M]  /yaffs2/yaffs_tagscompat.o
#  CC [M]  /yaffs2/yaffs_tagsmarshall.o
#  CC [M]  /yaffs2/yaffs_checkptrw.o
#  CC [M]  /yaffs2/yaffs_nand.o
#  CC [M]  /yaffs2/yaffs_nameval.o
#  CC [M]  /yaffs2/yaffs_allocator.o
#  CC [M]  /yaffs2/yaffs_bitmap.o
#  CC [M]  /yaffs2/yaffs_attribs.o
#  CC [M]  /yaffs2/yaffs_yaffs1.o
#  CC [M]  /yaffs2/yaffs_yaffs2.o
#  CC [M]  /yaffs2/yaffs_verify.o
#  CC [M]  /yaffs2/yaffs_summary.o
#  LD [M]  /yaffs2/yaffs2multi.o
#  Building modules, stage 2.
#  MODPOST 1 modules
#  CC      /yaffs2/yaffs2multi.mod.o
#  LD [M]  /yaffs2/yaffs2multi.ko
#make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-27-generic'

make mi

#make -C /lib/modules/2.6.32-27-generic/build M=/yaffs2 modules_install
#make[1]: Entering directory `/usr/src/linux-headers-2.6.32-27-generic'
#  INSTALL /yaffs2/yaffs2multi.ko
#  DEPMOD  2.6.32-27-generic
#make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-27-generic'

modinfo yaffs2multi
#ERROR: modinfo: could not find module yaffs2multi
   
#above line does not work 
#I need use  modinfo /yaffs2/yaffs2multi.ko  (not the same as was in
manual) 

modinfo /yaffs2/yaffs2multi.ko

#filename:       /yaffs2/yaffs2multi.ko
#license:        GPL
#author:         Charles Manning, Aleph One Ltd., 2002-2011
#description:    YAFFS2 - a NAND specific flash file system
#srcversion:     ABF238376DBCD4A5DAA00FB
#depends:        mtd
#vermagic:       2.6.32-27-generic SMP mod_unload modversions 586 
#parm:           yaffs_trace_mask:uint
#parm:           yaffs_wr_attempts:uint
#parm:           yaffs_auto_checkpoint:uint
#parm:           yaffs_gc_control:uint
#parm:           yaffs_bg_enable:uint


modprobe nandsim first_id_byte=0x20 second_id_byte=0x71
cache_file=/tmp/nandsim.bin

modprobe yaffs2multi
#FATAL: Module yaffs2multi not found.
#above line not work

modprobe /yaffs2/yaffs2multi.ko
FATAL: Module /yaffs2/yaffs2multi.ko not found.
ls /yaffs2/yaffs2multi.ko
#/yaffs2/yaffs2multi.ko      
# we can see that module on place
# Does modprone seek module by something other path? (maybe)
# May be instalation was incomplete...

#I was able to load module only with 
insmod /yaffs2/yaffs2multi.ko

#At this point all modules are loaded. Continue
#let's try mount with loop system

mkdir -p mnt/tmp
mount -t yaffs2 -o loop /tmp/rootfs_android-mlc2.img /mnt/tmp  

#Mount process sucessfully completed.... 
#but in /mnt/tmp I saw only lost+found folder and nothing more.

df
#Filesystem           1K-blocks      Used Available Use% Mounted on
#...
#/dev/loop0              262144        96    262048   1% /mnt/tmp

mount
#...
#/dev/loop0 on /mnt/tmp type yaffs2 (rw)
# but /mnt/tmp at some reason  read only... 

#this line definitely not normal work....
#Continue our researches

umount /mnt/tmp

cat /proc/mtd
#dev:    size   erasesize  name
#mtd0: 10000000 00004000 "NAND simulator partition 0"

dd if=/tmp/rootfs_android-mlc2.img of=/dev/mtdblock0 

#390015+1 records in
#390015+1 records out
#199687872 bytes (200 MB) copied, 19,3608 s, 10,3 MB/s

mount -t yaffs2 /dev/mtdblock0 /mnt/tmp

ls -l /mnt/tmp
#total 1
#drwx------ 1 root root 512 2013-04-14 03:31 lost+found

#we got the same result...
mount
#dev/mtdblock0 on /mnt/tmp type yaffs2 (rw)
#but /mnt/tmp read only

So the question is still actual!!!
How we can operate with rootfs-XXX.img files?
What is geometry parameters which are used in mktools
mkext3image
mkubimage-mlc1
mkubimage-mlc2
mkubimage-slc
mkyaffs2image
mkyaffs2image-128M
mkyaffs2image-mlc2
how to adjust mtd to achieve compatibility of created wit this utilities
images...

May be this was already described in some FAQ or Manual???
Need support.

Reggie
you need a program called unyaffs2, there are a few versions around:
https://code.google.com/p/yaffs2utils/