一、下载yaffs2源码
$mkdir -p /XXX/yaffs2_git
$cd /XXX/yaffs2_git
$git clone git://www.aleph1.co.uk/yaffs2
二、给内核打yaffs2补丁
直接运行yaffs2根据目录下的patch-ker.sh,会得到如下帮助信息:
usage: ./patch-ker.sh c/l m/s kernelpath
if c/l is c, then copy. If l then link
if m/s is m, then use multi version code. If s then use single version code
c/l 给示拷贝代码文件还是创建链接
m/s表示支持的版本数量, s表示单一版本
kernelpath表示内核源码路径(代码根目录)
笔者的linux内核在/work/tiny210/linux-3.3.0-common,打patch的方法是:
1. 首先保证 /work/tiny210/linux-3.3.0-common/fs目录下没有yaffs2这个目录(旧版本请移走或改名)
2. ./patch-ker.sh c m /work/tiny210/linux-3.3.0-common
3. 确认fs目录下的Kconfig和Makefile分别有以下内容:
# Patched by YAFFS
source "fs/yaffs2/Kconfig"
# Patched by YAFFS
obj-$(CONFIG_YAFFS_FS) += yaffs2/
4. 运行make menuconfig就可以配置yaffs了。