YAFFS2移植到linux3.6.7

從官方網站http://www.aleph1.co.uk/gitweb?p=yaffs2.git;a=summary下載yaffs2源碼,解壓後給linux3.6.7打補丁:./patch-ker.sh c m /kernel directory,完後看到fs目錄下的Kconfig和Makefile文件都有增加yaffs2相關內容;fs目錄下也多了yaffs2文件夾。基本上說明打補丁成功了,接下來在linux3.6.7主目錄下make menuconfig,找到File Systems--->Miscellaneous filesystem,卻沒有發現YAFFS2(用的是s3c6400_defconfig)。查看YAFFS2的Kconfig文件,需要先選擇MTD_BLOCK纔會有顯示YAFFS2.

#
# yaffs file system configurations
#

config YAFFS_FS
tristate "yaffs2 file system support"
default n
depends on MTD_BLOCK
select YAFFS_YAFFS1
select YAFFS_YAFFS2
help
yaffs2, or Yet Another Flash File System, is a file system
optimised for NAND Flash chips.

To compile the yaffs2 file system support as a module, choose M
here: the module will be called yaffs2.

If unsure, say N.

Further information on yaffs2 is available at
<http://www.aleph1.co.uk/yaffs/>.

於是去MTD目錄下找Kconfig的內容,看到:

config MTD_BLOCK
tristate "Caching block device access to MTD devices"
depends on BLOCK
select MTD_BLKDEVS
---help---
Although most flash chips have an erase size too large to be useful
as block devices, it is possible to use MTD devices which are based
on RAM chips in this manner. This block device is a user of MTD
devices performing that function.

At the moment, it is also required for the Journalling Flash File
System(s) to obtain a handle on the MTD device when it's mounted
(although JFFS and JFFS2 don't actually use any of the functionality
of the mtdblock device).

Later, it may be extended to perform read/erase/modify/write cycles
on flash chips to emulate a smaller block size. Needless to say,
this is very unsafe, but could be useful for file systems which are
almost never written to.

You do not need this option for use with the DiskOnChip devices. For
those, enable NFTL support (CONFIG_NFTL) instead.

也就說需要先選擇Device Drivers-->MTD-->Caching block device access to MTD devices,然後才能夠在File Systems--->Miscellaneous filesystem下面找到YAFFS2。

保存後make uImage.這時,錯誤來了:

1.struct super_block(include/fs.h) 缺少成員unsigned char        s_dirt;//需要添加

2.struct super_operations (include/fs.h)缺少成員void (*write_super) (struct super_block *);

//需要添加

3.找不到d_alloc_root()函數;//用d_make_root()函數替換

4.找不到end_writeback()函數;//用clear_node(   )函數替換

5.找不到struct mtd_info 下面的write,read,erase,sync等等成員;//全部在前面加下劃線_write,_read,_erase等等。

改完這些再編譯就可以了。





<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
閱讀(4) | 評論(0) | 轉發(0) |
給主人留下些什麼吧!~~
評論熱議
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章