1.使用git工具下载yaffs2源码:git clone git://www.aleph1.co.uk/yaffs2
2.进入yaffs2目录,执行patch-ker.sh脚本,将文件复制到linux内核的fs目录下。
cd yaffs2/
./patch-ker.sh c m ~/work/linux-3.10.4/
输出如下信息,表明脚本执行成功。
Updating /home/yuntaohe/work/linux-3.10.4//fs/Kconfig
Updating /home/yuntaohe/work/linux-3.10.4//fs/Makefile
3.配置内核支持yaffs文件系统。
cd ~/work/linux-3.10.4/
make s5pv210_defconfig
make menuconfig
Device Drivers --->
<*> Memory Technology Device (MTD) support --->
<*> Caching block device access to MTD devices
File systems --->
Miscellaneous filesystems --->
<*> yaffs2 file system support
make编译,报错:
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_procfs_init':
fs/yaffs2/yaffs_vfs.c:3591: error: implicit declaration of function 'create_proc_entry'
fs/yaffs2/yaffs_vfs.c:3592: warning: assignment makes pointer from integer without a cast
fs/yaffs2/yaffs_vfs.c:3595: error: dereferencing pointer to incomplete type
fs/yaffs2/yaffs_vfs.c:3596: error: dereferencing pointer to incomplete type
fs/yaffs2/yaffs_vfs.c:3597: error: dereferencing pointer to incomplete type
修改fs/yaffs2/yaffs_vfs.c,在3544行加上#define YAFFS_NEW_PROCFS,在170行加上#include <linux/seq_file.h>,再次编译即可。