1)工具下载:
http://code.google.com/p/yafuse/downloads/list
可以分别下载unyaffs和mkyaffs2imag。为使用方便,可将unyaffs和mkyaffs2imag拷贝至/usr/bin/。
注意:请为下载好的工具设置可执行属性。
2)unyaffs的用法
rzzhang@rzzhang-HOME:~/Android/Image$ unyaffs
Usage: unyaffs image_file_name
3)mkyaffs2image的用法
rzzhang@rzzhang-HOME:~/Android/Image$ mkyaffs2image
mkyaffs2image: image building tool for YAFFS2 built Jan 13 2011
usage: mkyaffs2image [-f] [-c <size>] [-s <size>] dir image_file [convert]
-f fix file stat (mods, user, group) for device
-c <size> set the chunk (NAND page) size. default: 2048
-s <size> set the spare (NAND OOB) size. default: 64
dir the directory tree to be converted
image_file the output file to hold the image
'convert' produce a big-endian image from a little-endian machine
4)解压system.img
system.img放置于~/Android/Image
rzzhang@rzzhang-HOME:~/Android/Image$ mkdir System
rzzhang@rzzhang-HOME:~/Android/Image$ cd System/
rzzhang@rzzhang-HOME:~/Android/Image/System$ unyaffs ../system.img
end of image
rzzhang@rzzhang-HOME:~/Android/Image/System$ ls
app bin build.prop etc fonts framework lib media tts usr vendor xbin
说明:unyaffs只能解压到当前目录,因此需要先进入需要解压到的目录。
5)重新生成system.img
rzzhang@rzzhang-HOME:~/Android/Image$ mkyaffs2image System system_new.img
rzzhang@rzzhang-HOME:~/Android/Image$ ls
System system.img system_new.img