marksalpeter / yaffs2utils

Automatically exported from code.google.com/p/yaffs2utils
GNU General Public License v2.0
0 stars 1 forks source link

unyaffs2 doesn't extract anything on images created with mkyaffs2image #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've created some example images (see attached) using the "official" yaffs2 
tool to create images (mkyaffs2image) as well as using the android fork. Code 
is from

git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
git clone https://android.googlesource.com/platform/external/yaffs2

Creating images using e.g.

$ mkyaffs2image /tmp/data/ /tmp/official_mkyaffs2.img

However, none of these images can be extracted using unyaffs2:

$ unyaffs2 official_mkyaffs2.img .
unyaffs2 0.2.9: image extracting tool for YAFFS2.
warning: non-root users.

scanning image '../official_mkyaffs2.img'... [done]
scanning complete, total objects: 1

building fs tree ... [done]
building complete, total objects: 1

extracting image into '.'
[======================================================================] 1/1 
100%

modify files attributes... [done]

operation complete,
files were extracted into '.'.

However, it has extracted nothing.

Original issue reported on code.google.com by ttk...@gmail.com on 4 Sep 2012 at 7:00

Attachments:

GoogleCodeExporter commented 8 years ago
Please reference README to use '--yaffs-ecclayout'?

Original comment by penguin.lin on 5 Sep 2012 at 10:48

GoogleCodeExporter commented 8 years ago
Indeed, thanks, sorry I should have read that...
However, it still fails to extract contents from the two images created with 
the android fork (files from above testimg.tar.bz2):

$ unyaffs2 --yaffs-ecclayout ../android_mkyaffs2_little.img .
$ unyaffs2 -e --yaffs-ecclayout ../android_mkyaffs2_big.img .

Furthermore, I'm trying to extract files from some of the android-sdk system 
images and it fails to extract the full content of userdata-qemu.img. It says 
it extracts 17 out of 43 objects:

$ cd ~/.android/avd/test.avd/
$ unyaffs2  --yaffs-ecclayout userdata-qemu.img tmp/
unyaffs2 0.2.9: image extracting tool for YAFFS2.
warning: non-root users.
warning: image size (31422300)is NOT a multiple of (2048 + 64).

scanning image '../userdata-qemu.img'... [done]
scanning complete, total objects: 43

building fs tree ... [done]
building complete, total objects: 17

extracting image into '.'
[==================================================================] 17/17 100%

modify files attributes... [done]

operation complete,
files were extracted into '.'

Original comment by ttk...@gmail.com on 6 Sep 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Dear:

Would you provide the test image to me, only for duplicating?
I will be glad to resolve your problem.

I also noticed that YAFFS1 image in your bz2 file cannot extracted successfully.
I will try resolving it in my free time.

Original comment by penguin.lin on 7 Sep 2012 at 1:54

GoogleCodeExporter commented 8 years ago
Dear 

The version "0.2.9" should be able to extract both the 
"android_mkyaffs2_little.img" and "android_mkyaffs2_big.img".

In the latest version, it will verify the ecc checksum while extracting the 
chunk/tag. If the ecc algorithm used were different, it is possible fail to 
extract the image.

About the image "userdata-qemu.img", it contained some object who have the 
invalid root/parent objects. During unyaffs2 extracting the image, it will try 
building the fs tree based on the objects' parent id. Only files in the fs tree 
will be extracted.

Original comment by penguin.lin on 17 Sep 2012 at 3:47