1、下载代码:
http://code.google.com/p/fatplus/downloads/list
下载 yaffs2-source.tar
2、解压缩后,编译:
tar xvf yaffs2-source.tar
cd yaffs2/utils
make
出现错误提示:
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline yaffs_ecc.c -o yaffs_ecc.o
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline mkyaffsimage.c -o mkyaffsimage.o
In file included from mkyaffsimage.c:31:
../yaffs_guts.h:831: warning: ‘struct iattr’ declared inside parameter list
../yaffs_guts.h:831: warning: its scope is only this definition or declaration, which is probably not what you want
../yaffs_guts.h:832: warning: ‘struct iattr’ declared inside parameter list
../yaffs_guts.h:835: error: expected declaration specifiers or ‘…’ before ‘loff_t’
../yaffs_guts.h:837: error: expected declaration specifiers or ‘…’ before ‘loff_t’
../yaffs_guts.h:839: error: expected declaration specifiers or ‘…’ before ‘loff_t’
修改错误:
vi devextras.h
添加如下代码:
#if defined(__APPLE__) || defined (__FreeBSD__) typedef long long loff_t; #endif