移植YAFFS文件系统: (linux-3.4.2内核)
1.git clone git:// //用此获得yaffs2源码包
1.1 解压源码包
2. 打补丁
cd yaffs-dir
./patch-ker.sh c m linux-tree 比如 ./patch-ker.sh c m /work/system/linux-3.4.2
3. 配置内核支持YAFFS
-> File systems |
| -> Miscellaneous filesystems (MISC_FILESYSTEMS [=y]) |
| -> yaffs2 file system support (YAFFS_FS [=n]) |
| -> 512 byte / page devices (YAFFS_YAFFS1 [=n]) |
| -> Use older-style on-NAND data format with pageStatus byte
选上,使用默认值
4. 编译、使用uImage
编译出现错误:
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_mtd_put_super':
fs/yaffs2/yaffs_vfs.c:2514: error: 'struct mtd_info' has no member named 'sync'
fs/yaffs2/yaffs_vfs.c:2515: error: 'struct mtd_info' has no member named 'sync'
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_internal_read_super':
fs/yaffs2/yaffs_vfs.c:2702: error: 'struct mtd_info' has no member named 'erase'
在新版本中sync要加下划线即:_sync 等。
fs/yaffs2/yaffs_vfs.c:2967: error: implicit declaration of function 'd_alloc_root'
此处改为:d_make_root(inode);
5. 制作、烧写yaffs映象
mkyaffs2image fs_mini_mdev_new fs_mini_mdev_new.yaffs2
uboot:
nfs 30000000 172.17.28.159:/work/nfs_root/fs_mini_mdev_new.yaffs2
nand erase.part rootfs /* 注:1.1.6的Uboot 擦出命令不一样 .part 要去掉,即:
nand erase rootfs */
nand write.yaffs 30000000 260000 $(filesize)
6. 启动
set bootargs console=ttySAC0,115200 root=/dev/mtdblock3
nfs 32000000 172.17.28.159:/work/nfs_root/uImage_yaffs
bootm 32000000
阅读(1262) | 评论(0) | 转发(0) |