9.1. Get yaffs source code files
First, go to http://www.aleph1.co.uk/cgi-bin/viewcvs.cgi and download a ysffs patch for the kernel.
9.2. Add support for yaffs in the kernel
Unzip the patch and apply patch to the kernel:
#tar xvfz cvs-root.tar.gz (unzip to destination directory cvs)
#cd cvs/yaffs2/
#./patch-ker.sh c /opt/EmbedSky/linux-2.6.25.8/ (Apply the patch to the kernel)
For Linux-2.6.30.4, we only need to replace the version number.
Now go to “fs/” directory in the kernel, you will see a newly created “ysffs2/” directory. The config and compile condition are also added to “Makefile” and “Kconfig” in the “fs/”.
9.3 Add yaffs to the menuconfig
The next step is to type:
#make menuconfig
to pop up the config menu and do the configuration.
Note: The red one in the following can only be selected when using linux-2.6.30.4 and used with nand flash larger than 256MB.
The reason is that 2.6.30.4 adds support for nand flash larger than 2GB, and the machanism is different from lower than 2.6.30. We need to add hardware ECC for capacity larger than 256MB, otherwise, yaffs will not be able to boot.
Device Drivers —>
<*> Memory Technology Device (MTD) support —>
<*> NAND Device Support —>
<*> NAND Flash support for S3C2410/S3C2440 SoC
[*] S3C2410 NAND Hardware ECC
Nand Flash Capacity select (256MB~1GB Nand for EmbedSky Board) —>
File systems —>
< > Second extended fs support
< > Ext3 journalling file system support
< > Kernel automounter support
< > Kernel automounter version 4 support (also supports v3)
< > Filesystem in Userspace support
CD-ROM/DVD Filesystems —>
<*> ISO 9660 CDROM file system support
[ ] Microsoft Joliet CDROM extensions
[ ] Transparent decompression extension
< > UDF file system support
DOS/FAT/NT Filesystems —>
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(437) Default codepage for FAT
(iso8859-1) Default iocharset for FAT
< > NTFS file system support
Pseudo filesystems —>
[*] Virtual memory file system support (former shm fs)
[ ] Tmpfs POSIX Access Control Lists
<*> Userspace-driven configuration filesystem
Miscellaneous filesystems —>
<*> YAFFS2 file system support
-*- 512 byte / page devices
[ ] Use older-style on-NAND data format with pageStatus byte
[ ] Lets Yaffs do its own ECC
-*- 2048 byte (or larger) / page devices
[*] Autoselect yaffs2 format
[ ] Disable lazy loading
[ ] Turn off wide tnodes
[ ] Force chunk erase check
[ ] Cache short names in RAM
-*- Native language support —>
— Native language support
(iso8859-1) Default NLS Option
<*> Codepage 437 (United States, Canada)
<*> Simplified Chinese charset (CP936, GB2312)
<*> NLS ISO 8859-1 (Latin 1; Western European Languages)
<*> NLS UTF-8
After the config, we can save the config menu to “.config”, and compile the image.
Until now, we are done with the port of yaffs file system. Next step is to build the yaffs file system.
To build yaffs file system, first we need to use busybox to compile all the necessary files needs by file system, and then we can build the file system.
Leave a Reply
You must be logged in to post a comment.