2440移植Linux Kernel笔记(四)------yaffs2打补丁
2017-05-25 18:29
393 查看
你好!这里是风筝的博客,欢迎和我一起交流。
如果本篇博客对您有帮助,或许可以在下方评论给我留个言。
cd /work/system/
获取yaffs2源码:
git clone git://www.aleph1.co.uk/yaffs2
记得要安装git才能获取源码(
安装git:sudo apt-get install git
这里我们下载的yaffs2官网上2017年5月(最新)的源码:
http://download.csdn.net/detail/guet_kite/9856481
)
cd yaffs2/
打补丁:
cd yaffs2/
./patch-ker.sh c m /work/system/linux-4.4.66
cd /work/system/linux-4.4.66/
make menuconfig
选中:File systems->Miscellaneous filesystems->yaffs2 file system support
make uImage
开始编译内核.
报错:
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':
fs/yaffs2/yaffs_vfs.c:299: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':
fs/yaffs2/yaffs_vfs.c:497: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In functio
4000
n 'yaffs_release_space':
fs/yaffs2/yaffs_vfs.c:515: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':
fs/yaffs2/yaffs_vfs.c:607: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c:619: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':
fs/yaffs2/yaffs_vfs.c:743: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: At top level:
fs/yaffs2/yaffs_vfs.c:794: error: 'new_sync_read' undeclared here (not in a function)
fs/yaffs2/yaffs_vfs.c:795: error: 'new_sync_write' undeclared here (not in a function)
fs/yaffs2/yaffs_vfs.c:1050: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_follow_link':
fs/yaffs2/yaffs_vfs.c:1106: error: implicit declaration of function 'nd_set_link'
fs/yaffs2/yaffs_vfs.c: At top level:
总的来说就是内核版本太新了,yaffs支持未跟上.
现在我们可以自己修改yaffs文件.
First error).error: 'struct file' has no member named 'f_dentry’:
由于新内核的file结构体发生了变化,把f_dentry这个成员放到了path结构体(include/linux/path.h)里.
在fs.h(include/linux/fs.h)加上:
#define f_dentry f_path.dentry
Second error).error: 'new_sync_read' undeclared here (not in a function):
新内核没有"new_sync_read"和"new_sync_write"这两个导出函数了.
修改yaffs_vfs.c的794、795行为:
.read = __vfs_read,
.write = __vfs_write,
Third error).error: implicit declaration of function 'nd_set_link':
由于我们Kernel太新,内核里已经不用nd_set_link这个函数了.在老内核中找到源码:
static inline void nd_set_link(struct nameidata *nd, char *path)
{
nd->saved_names[nd->depth] = path;
}
但是新的kernel没有这个函数了,而且nameidata结构体的定义也变了,因此要修改用到这个函数的地方.主要就是yaffs_follow_link这个函数.
yaffs_follow_link的定义主要参考include/Linux/fs.h里的struct inode_operations.follow_link来定义 .
以前的alias是保存在 nd->saved_names里,现在这个成员已经被删除了,现在我们直接通过函数返回值返回,并且保存在*cookie中
![](https://img-blog.csdn.net/20170525183413826?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvR3VldF9LaXRl/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
make uImage
发现,编译内核成功!
如果本篇博客对您有帮助,或许可以在下方评论给我留个言。
cd /work/system/
获取yaffs2源码:
git clone git://www.aleph1.co.uk/yaffs2
记得要安装git才能获取源码(
安装git:sudo apt-get install git
这里我们下载的yaffs2官网上2017年5月(最新)的源码:
http://download.csdn.net/detail/guet_kite/9856481
)
cd yaffs2/
打补丁:
cd yaffs2/
./patch-ker.sh c m /work/system/linux-4.4.66
cd /work/system/linux-4.4.66/
make menuconfig
选中:File systems->Miscellaneous filesystems->yaffs2 file system support
make uImage
开始编译内核.
报错:
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':
fs/yaffs2/yaffs_vfs.c:299: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':
fs/yaffs2/yaffs_vfs.c:497: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In functio
4000
n 'yaffs_release_space':
fs/yaffs2/yaffs_vfs.c:515: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':
fs/yaffs2/yaffs_vfs.c:607: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c:619: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':
fs/yaffs2/yaffs_vfs.c:743: error: 'struct file' has no member named 'f_dentry'
fs/yaffs2/yaffs_vfs.c: At top level:
fs/yaffs2/yaffs_vfs.c:794: error: 'new_sync_read' undeclared here (not in a function)
fs/yaffs2/yaffs_vfs.c:795: error: 'new_sync_write' undeclared here (not in a function)
fs/yaffs2/yaffs_vfs.c:1050: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_follow_link':
fs/yaffs2/yaffs_vfs.c:1106: error: implicit declaration of function 'nd_set_link'
fs/yaffs2/yaffs_vfs.c: At top level:
总的来说就是内核版本太新了,yaffs支持未跟上.
现在我们可以自己修改yaffs文件.
First error).error: 'struct file' has no member named 'f_dentry’:
由于新内核的file结构体发生了变化,把f_dentry这个成员放到了path结构体(include/linux/path.h)里.
在fs.h(include/linux/fs.h)加上:
#define f_dentry f_path.dentry
Second error).error: 'new_sync_read' undeclared here (not in a function):
新内核没有"new_sync_read"和"new_sync_write"这两个导出函数了.
修改yaffs_vfs.c的794、795行为:
.read = __vfs_read,
.write = __vfs_write,
Third error).error: implicit declaration of function 'nd_set_link':
由于我们Kernel太新,内核里已经不用nd_set_link这个函数了.在老内核中找到源码:
static inline void nd_set_link(struct nameidata *nd, char *path)
{
nd->saved_names[nd->depth] = path;
}
但是新的kernel没有这个函数了,而且nameidata结构体的定义也变了,因此要修改用到这个函数的地方.主要就是yaffs_follow_link这个函数.
yaffs_follow_link的定义主要参考include/Linux/fs.h里的struct inode_operations.follow_link来定义 .
以前的alias是保存在 nd->saved_names里,现在这个成员已经被删除了,现在我们直接通过函数返回值返回,并且保存在*cookie中
make uImage
发现,编译内核成功!
相关文章推荐
- 2440移植Linux Kernel笔记(五)------制作yaffs2映像文件
- 2440移植Linux Kernel笔记(三)------制作jffs2映像文件
- 2440移植Linux Kernel笔记(六)------剪裁Kernel
- 2440移植Linux Kernel笔记(一)------编译kernel
- 2440移植Linux Kernel笔记(七)------网卡驱动
- AT91RM9200Linux移植笔记(三)-移植Linux kernel 2.6.17
- u-boot-2016.01移植笔记之先让u-boot可以编译成功以及添加2440单板
- u-boot-2009.08移植笔记二,平台TQ2440
- linux-2.6.32内核移植至2440笔记
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###8. u-boot引导启动nand flash中内核和根文件系统cramfs和用户文件系统yaffs2支持
- 2440超详细uboot移植笔记(一)------分析源码
- JZ2440学习笔记,第二部分,移植uboot2015支持JZ2440的nor flash
- OK2440 uboot移植笔记【一】
- 2440超详细uboot移植笔记(十)------支持NOR FLASH
- smdk2440移植u-boot笔记
- smdk2440移植、修改、编译kernel笔记
- u-boot-2016.01移植笔记之让u-boot在2440中能正确的运行
- RTEMS 移植到 sbc2440 的笔记
- u-boot-2010.12移植到2440(yaffs2文件系统移植)
- TQ2440 学习笔记—— 27、移植U-Boot【Bootloader 作用、工作流程】