S3C6410嵌入式应用平台构建(六)——linux-3.14.4移植到OK6410-(Yaffs2文件系统移植)...
我个人觉得nandflash上用yaffs2文件系统是很好的方案,但是最新的Linux并不支持yaffs2文件系统,需要你自己给内核打补丁,不过话说在前面,由于内核间差异及兼容问题,在编译时肯定会出现各种编译问题,需要你一一的去解决。
一、准备工作
1. 下载源码
使用git工具下载:$ git clone git://www.aleph1.co.uk/yaffs2
2. 给内核打补丁
下载完成后,在该执行目录下会有yaffs2文件夹,进入该文件夹。
$ ./patch-ker.sh c m ../../kernel/test/linux-3.14.4
Updating ../../kernel/test/linux-3.14.4/fs/Kconfig
Updating ../../kernel/test/linux-3.14.4/fs/Makefile
有以上两个信息,说明已经打好补丁,并且在fs/目录下,多了yaffs2文件夹,其实这是从yaffs2文件夹中复制过来的。
二、内核配置
下面配置内核,在linux目录下make menuconfig
我们发现在File system—>Miscellaneous filesystems—>下面并找不到yaffs2选项。原来是这样的
查看YAFFS2的Kconfig文件,需要先选择MTD_BLOCK才会有显示YAFFS2
# # yaffs file system configurations #config YAFFS_FS tristate "yaffs2 file system support" default nselect YAFFS_YAFFS1 select YAFFS_YAFFS2 help
也就说需要先选择Device Drivers-->MTD-->Caching block device access to MTD devices,然后才能够在File Systems--->Miscellaneous filesystem下面找到YAFFS2。
好的 ,配置完后,这下要执行make clean;make uImage了。剩下的工作就是解决一大堆编译错误了!!!!
下面看看编译的错误:
CC fs/yaffs2/yaffs_vfs.o fs/yaffs2/yaffs_vfs.c: In function 'yaffs_mknod': fs/yaffs2/yaffs_vfs.c:1228: error: incompatible types when initializing type 'uid_t' using type 'kuid_t' fs/yaffs2/yaffs_vfs.c:1230: error: incompatible types when initializing type 'gid_t' using type 'const struct <anonymous>' fs/yaffs2/yaffs_vfs.c: In function 'yaffs_symlink': fs/yaffs2/yaffs_vfs.c:1427: error: incompatible types when initializing type 'uid_t' using type 'kuid_t' fs/yaffs2/yaffs_vfs.c:1429: error: incompatible types when initializing type 'gid_t' using type 'const struct <anonymous>' fs/yaffs2/yaffs_vfs.c: At top level: fs/yaffs2/yaffs_vfs.c:1786: error: unknown field 'readdir' specified in initializer fs/yaffs2/yaffs_vfs.c:1786: warning: initialization from incompatible pointer type fs/yaffs2/yaffs_vfs.c: In function 'yaffs_fill_inode_from_obj': fs/yaffs2/yaffs_vfs.c:1832: error: incompatible types when assigning to type 'kuid_t' from type 'u32' fs/yaffs2/yaffs_vfs.c:1833: error: incompatible types when assigning to type 'kgid_t' from type 'u32' fs/yaffs2/yaffs_vfs.c:1857: warning: format '%d' expects type 'int', but argument 3 has type 'kuid_t' fs/yaffs2/yaffs_vfs.c:1857: warning: format '%d' expects type 'int', but argument 4 has type 'kgid_t' fs/yaffs2/yaffs_vfs.c: In function 'yaffs_proc_debug_write': fs/yaffs2/yaffs_vfs.c:3300: warning: comparison of distinct pointer types lacks a cast fs/yaffs2/yaffs_vfs.c: In function 'init_yaffs_fs': fs/yaffs2/yaffs_vfs.c:3394: error: implicit declaration of function 'create_proc_entry' fs/yaffs2/yaffs_vfs.c:3395: warning: assignment makes pointer from integer without a cast fs/yaffs2/yaffs_vfs.c:3398: error: dereferencing pointer to incomplete type fs/yaffs2/yaffs_vfs.c:3399: error: dereferencing pointer to incomplete type fs/yaffs2/yaffs_vfs.c:3400: error: dereferencing pointer to incomplete type make[2]: *** [fs/yaffs2/yaffs_vfs.o] Error 1 make[1]: *** [fs/yaffs2] Error 2 make: *** [fs] Error 2
1. 出现error: incompatible types when initializing type 'uid_t' using type 'kuid_t' ,应该是不兼容问题导致,修改:
uid_t改为kuid_t和gid_t 改为kgid_t
剩下的关于这个变量的问题很多,但是都是关于兼容性的,大家在修改时只需要知道只要不兼容,那我们就把所有用到的改到兼容的kuid_t为止。
这里修改的地方和文件有点多,我就不一一列出来了
2. error: implicit declaration of function 'create_proc_entry'
由于最新的内核不支持这个函数,需要注释掉并改为my_proc_entry = proc_create("yaffs",S_IRUGO | S_IFREG, YPROC_ROOT, &yaffs_fops);
最终修改如下:
mutex_init(&yaffs_context_lock);my_proc_entry = proc_create("yaffs",S_IRUGO | S_IFREG, YPROC_ROOT, &yaffs_fops); #if 0/* Install the proc_fs entries */my_proc_entry = create_proc_entry("yaffs",S_IRUGO | S_IFREG, YPROC_ROOT);if (my_proc_entry) {my_proc_entry->write_proc = yaffs_proc_write;my_proc_entry->read_proc = yaffs_proc_read;my_proc_entry->data = NULL;} else {return -ENOMEM;} #endif
3. error: unknown field 'readdir' specified in initializer
在init_yaffs_fs函数前添加以下代码
static int __init init_yaffs_fs(void)
修改了以上,我们就能编译通过了。目前,内核就支持yaffs2文件系统了。
下一篇文件我们来用busybox制作yaffs2文件系统。
转载于:https://www.cnblogs.com/lixiaoming90/p/3776292.html
S3C6410嵌入式应用平台构建(六)——linux-3.14.4移植到OK6410-(Yaffs2文件系统移植)...相关推荐
- buildroot:Linux平台构建嵌入式Linux系统的框架
buildroot是Linux平台上一个构建嵌入式Linux系统的框架.整个Buildroot是由Makefile脚本和Kconfig配置文件构成的.你可以和编译Linux内核一样,通过buildro ...
- 基于Yocto构建嵌入式Linux系统U-boot、kernel内核、rootfs文件系统
前言 Yocto 是一个很强大的构建工具,其功能不仅仅是用来获取BSP源码和简单地编译源码,开发者还可以使用Yocto对其 开发板添加各种第三方开发库,而不需要每次重新从零开始编译源码,解决第三方依赖 ...
- 2440 linux文件写,添加yaffs2文件系统 - Linux2.6.39在S3C2440上的移植_Linux编程_Linux公社-Linux系统门户网站...
1.主机环境:VMare下Ubuntu10.04 ,1G内存. 2.编译编译环境:arm-linux-gcc 3.开发板:Micro2440,2M nor flash,256M nand flash. ...
- step by step 构建嵌入式Linux系统平台
前些日子写的一些文章,大家可以看看... 为了适应目前嵌入式系统操作平台在性能.成本.可靠性等各方面的要求,论述了以Linux作为操作系统平台的优势,分析了以PC104卡和CompactFlash卡构 ...
- 构建基于Linux平台的开源×××服务器
实验名称:构建基于Linux平台的开源×××服务器 实验目标:一.基于Linux配置poptop ×××与管理 二.基于Linux配置Openswan ×××与管理 ×××的功能:加密数据 信息认证和 ...
- 嵌入式系统实验 构建嵌入式Linux系统,《嵌入式系统与开发》构建嵌入式Linux系统-实验报告.doc...
<嵌入式系统与开发>构建嵌入式Linux系统-实验报告 <嵌入式数据库sqlite移植及使用> 实验报告 学生姓名: 陈 彤 学 号: 1座机电话号码 专业班级: 130044 ...
- SharpGL学习笔记(一) 平台构建与Opengl的hello World
(一)平台构建与Opengl的hello World OpenGL就是3d绘图的API,微软针和它竞争推出D3D,也就是玩游戏时最常见的DirectorX组件中的3d功能. 所以不要指望windows ...
- 用QEMU构建嵌入式LINUX系统
Table of Contents Qemu –从源头建造 ARM工具链 Linux内核 构建文件系统 通过NFS使用根文件系统 配置QEMU Tap网络 创建运行脚本 推荐阅读:<在CentO ...
- SharpGL学习笔记(一) 平台构建与Opengl的hello World (转)
(一)平台构建与Opengl的hello World OpenGL就是3d绘图的API,微软针和它竞争推出D3D,也就是玩游戏时最常见的DirectorX组件中的3d功能. 所以不要指望windows ...
最新文章
- 程序员的月薪 | 每日趣闻
- redis学习(四)
- C#使用NPOI导出Excel文件
- ios realm 文件_关于ios:具有后台进程的Realm实例会丢失数据
- linux和GNU之间的关系
- 基于原版Hadoop的YDB部署(转)
- php cdata,PHPcdata处理(详细介绍)_PHP教程
- 春节档电影降价了 最低30元
- 惠普继续大裁员:未来3年计划裁撤7000-9000个岗位
- laravel将数据库对象转为数组的方法
- 渴望整成“卡戴珊” 澳大利亚年轻女性以整容为荣
- 三星手机怎么把html,三星手机怎么连接电脑 只要四步轻松搞定【图文】
- Apache Parquet 与Apache ORC简介
- 2013 前瞻 + 技术牛
- 土木专业应用计算机,计算机在土木中的应用
- Algorithm:数学建模大赛(CUMCM/NPMCM)之CUMCM之2006B之2006之B题《艾滋病疗法的评价及疗效的预测》
- 安装 centos8 设置基础软件仓库时出错
- html彩色条,html5 canvas彩色流动线条动画特效
- 关于unity 3d人物换装
- java学习第八天内容
热门文章
- 2673(2673)shǎ崽 OrOrOrOrz
- 使用Forms Authentication 身份验证 之 Basic Knowledge
- DSP调试报错:OMAPL138 Connect to PRSC failed
- 在redhat9上安装firefox
- 只适合小模型小训练集的交叉验证
- 微信tocken后台后台保存方法
- EF使用Fluent API配置映射关系
- SQLSERVER2014中的新功能
- Can't connect to local MySQL Server throught socket '/var/run/mysqld/mysqld.sock'(2)
- 零基础Java学习之super关键字