AT91SAM9261EK Linux 3.10.12 yaffs2 移植成功
2016-05-24 00:14
609 查看
经过测试,发现最新版本的yaffs2很容易移植到Linux 2.xx与Linux 3.xx的版本上。
我使用Linux 3.10.12之前的版本,打上yaffs2最新版本补丁后,直接编译通过。但Linux 3.10.12却提示错误:
经过查找并搜索相应的代码,发现内核改了。
create_proc_entry()/create_proc_read_entry() are killed off; use proc_create().
因此需要用:proc_create来代替原来的:
# gedit ./fs/yaffs2/yaffs_vfs.c
因此,只要打开编译开关 YAFFS_NEW_PROCFS 即可!经过进一步搜索:YAFFS_NEW_PROCFS,发现有版本宏控制,因此修改如下:
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) /* edit here use NEW PROCFS */
#define YAFFS_NEW_PROCFS
#include <linux/seq_file.h>
#endif
把:KERNEL_VERSION(3,12,0)->KERNEL_VERSION(3,10,0))这里因为在3.10版本里,已经使用 YAFFS_NEW_PROCFS了。
修改后,就可以正常编译并下载成功了。
我使用Linux 3.10.12之前的版本,打上yaffs2最新版本补丁后,直接编译通过。但Linux 3.10.12却提示错误:
fs/yaffs2/yaffs_vfs.c: In function 'init_yaffs_fs': fs/yaffs2/yaffs_vfs.c:3398: error: implicit declaration of function 'create_proc_entry' fs/yaffs2/yaffs_vfs.c:3399: warning: assignment makes pointer from integer without a cast fs/yaffs2/yaffs_vfs.c:3402: error: dereferencing pointer to incomplete type fs/yaffs2/yaffs_vfs.c:3403: error: dereferencing pointer to incomplete type fs/yaffs2/yaffs_vfs.c:3404: 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
经过查找并搜索相应的代码,发现内核改了。
create_proc_entry()/create_proc_read_entry() are killed off; use proc_create().
因此需要用:proc_create来代替原来的:
# gedit ./fs/yaffs2/yaffs_vfs.c
#ifdef YAFFS_NEW_PROCFS static int yaffs_proc_show(struct seq_file *m, void *v) { /* FIXME: Unify in a better way? */ char buffer[512]; char *start; int len; len = yaffs_proc_read(buffer, &start, 0, sizeof(buffer), NULL, NULL); seq_puts(m, buffer); return 0; } static int yaffs_proc_open(struct inode *inode, struct file *file) { return single_open(file, yaffs_proc_show, NULL); } static struct file_operations procfs_ops = { .owner = THIS_MODULE, .open = yaffs_proc_open, .read = seq_read, .write = yaffs_proc_write, }; static int yaffs_procfs_init(void) { /* Install the proc_fs entries */ my_proc_entry = proc_create("yaffs", S_IRUGO | S_IFREG, YPROC_ROOT, &procfs_ops); if (my_proc_entry) { return 0; } else { return -ENOMEM; } } #else static int yaffs_procfs_init(void) { /* 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; return 0; } else { return -ENOMEM; } } #endif
因此,只要打开编译开关 YAFFS_NEW_PROCFS 即可!经过进一步搜索:YAFFS_NEW_PROCFS,发现有版本宏控制,因此修改如下:
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) /* edit here use NEW PROCFS */
#define YAFFS_NEW_PROCFS
#include <linux/seq_file.h>
#endif
把:KERNEL_VERSION(3,12,0)->KERNEL_VERSION(3,10,0))这里因为在3.10版本里,已经使用 YAFFS_NEW_PROCFS了。
修改后,就可以正常编译并下载成功了。
相关文章推荐
- Linux学习笔记一
- Linux学习笔记二
- centos7.2 ftp连接问题
- centos7 FIREWALLS取代iptables
- centos7安装php
- linuxc
- linux 批量删除
- linux 常用命令
- Linux Enlarge the LV
- centOS6.5下安装xampp
- centos下mysql5.6主从复制配置
- 解决克隆centos虚拟机后ip配置失败的问题
- CentOS下LNMP环境搭建Zabbix监控系统
- linux下ftp服务器 proftpd 推荐 限制用户目录
- Linux环境C程序设计---学习笔记01
- centos security & tuning
- linux查找大于15M少于20M并且此含有字符串"aaa"的文件
- 创建和使用一个新的系统调用
- windows,linux,mac生成ssh public key 和 private key
- 一只Linux小白,啊哈哈。。。以后就将自己的学习心得与大家分享啦!希望大家可以指出我的错误与不足之处