你好,游客 登录 注册 搜索
背景:
阅读新闻

yaffs2的补丁文件patch-ker分析

[日期:2012-11-25] 来源:Linux社区  作者:yuesichiu [字体:大 中 小]

为内核打上yaffs2 补丁

(1)将yaffs2代码加入内核

这可以通过yaffs2目录下的脚本文件patch-ker.sh来给内核打补丁,用法如下:

usage: ./patch-ker.sh c/l kernelpath

if c/l is c, then copy. if l then link.

这表明,如果c/l是c,则yaffs2的代码会被复制到内核目录下,如果是l,则在内核的目录下创建一些链接文件。这里yaff2所在的目录/root/linux-test/,和linux-2.6.32.2在同一个目录下,执行如下命令打补丁:

[root@localhost yaffs2]# ./patch-ker.sh c /root/linux-test/linux-2.6.32.2
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
[root@localhost yaffs2]# ./patch-ker.sh c s /root/linux-test/linux-2.6.32.2

*** Warning ***
You have chosen to use the single kernel variant of the yaffs VFS glue code
that only works with the latest Linux kernel tree. If you are using an older
version of Linux then you probably wanted to use the multi-version variant by
re-running the patch-ker.sh script using m as a the second argument.
ie ./patch-ker.sh c m /root/linux-test/linux-2.6.32.2

Updating /root/linux-test/linux-2.6.32.2/fs/Kconfig
Updating /root/linux-test/linux-2.6.32.2/fs/Makefile
[root@localhost yaffs2]#

注意第二个参数m/s,如果不指定,有时会执行失败。

上述命令完成下面三件事:

<1>修改内核文件/fs/Kconfig,增加下面两行(在177行附近):

if MISC_FILESYSTEMS

source "fs/adfs/Kconfig"
source "fs/affs/Kconfig"
source "fs/ecryptfs/Kconfig"
source "fs/hfs/Kconfig"
source "fs/hfsplus/Kconfig"
source "fs/befs/Kconfig"
source "fs/bfs/Kconfig"
source "fs/efs/Kconfig"
source "fs/yaffs2/Kconfig"
source "fs/jffs2/Kconfig"
# UBIFS File system configuration

<2>修改内核文件/fs/Makefile,增加下面两行(在129行附近):

obj-$(CONFIG_GFS2_FS) += gfs2/
obj-$(CONFIG_EXOFS_FS) += exofs/
obj-$(CONFIG_YAFFS_FS) += yaffs2/

<3>在内核文件的fs目录下创建yaffs2子目录,然后复制如下文件:

将yaffs2源码目录下的Makefile.kernel文件复制为内核fs/yaffs2/Makefile文件。

将yaffs2源码目录下的Kconfig文件复制为内核fs/yaffs2/目录下。

将yaffs2源码目录下的*.c、*.h文件(不包括子目录下的文件)复制为内核fs/yaffs2/目录下。

linux
相关资讯       yaffs2 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款