现在的位置: 首页 > 综合 > 正文

Linux-2.6.32.2内核在mini2440上的移植—-移植yaffs2

2013年03月12日 ⁄ 综合 ⁄ 共 1647字 ⁄ 字号 评论关闭

1、获取yaffs2
源代码

安装git工具

clx@think:~$ sudo apt-get install git-core

然后运行

clx@think:/work/armlinux$  git clone git://www.aleph1.co.uk/yaffs2
Initialized empty Git repository in /work/armlinux/yaffs2/.git/
remote: Counting objects: 7556, done.
remote: Compressing objects: 100% (4654/4654), done.
remote: Total 7556 (delta 5977), reused 3624 (delta 2818)
Receiving objects: 100% (7556/7556), 3.56 MiB | 118 KiB/s, done.
Resolving deltas: 100% (5977/5977), done.
clx@think:/work/armlinux$ ls
linux-2.6.32.2  linux-2.6.32.2.tar.gz  yaffs2

2、为内核打上yaffs2补丁

clx@think:/work/armlinux$ cd yaffs2

clx@think:/work/armlinux/yaffs2$ ./patch-ker.sh c /work/armlinux/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
clx@think:/work/armlinux/yaffs2$ ./patch-ker.sh c m /work/armlinux/linux-2.6.32.2
Updating /work/armlinux/linux-2.6.32.2/fs/Kconfig
Updating /work/armlinux/linux-2.6.32.2/fs/Makefile

3、配置和编译带YAFFS2支持的内核

clx@thinclx@think:/work/armlinux/linux-2.6.32.2$ make menuconfig

*** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 *** 
 *** Install ncurses (ncurses-devel) and try again.
 *** 
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

google安装clx@think:~$ sudo apt-get install ncurses-dev问题解决

此时可以运行配置界面

移动上下按键找到File Systems;

按回车进入该子菜单,再找到“Miscellaneous filesystems”菜单项;

按回车进入该子菜单,找到“YAFFS2 file system support”;

按空格选中它,这样我们就在内核中添加了yaffs2文件系统的支持,按“Exit”退出内核配置,选中“Yes”保存。

4、编译测试

将编译好的zImage烧写入开发板,启动内核将能看到如下信息:

yaffs: dev is 32505859 name is "mtdblock3" rw
yaffs: passed flags ""
VFS: Mounted root (yaffs filesystem) on device 31:3.

此时烧写友善之臂提供的现成的yaffs2 文件系统映像rootfs_qtopia_qt4.img进行测试,就可以正常启动内核了。

抱歉!评论已关闭.