It's been a long time since I thought of a mini2440 development Board, so I wanted to port a Linux system based on linux3.10, but there were some problems with porting the YAFFS2 file system, and I recorded it to help other students solve the same problem.
1. First download the YAFFS2 code via git. Then go to the YAFFS2 folder to execute patch-ker.sh and patch the Linux source code.
$ git clone git://www.aleph1.co.uk/yaffs2$ cd yaffs2/$./patch-ker.sh c M.. /linux3.10-mini2440
2. Then a YAFFS2 folder is added to the Linux source code FS, and the YAFFS2 file system is already in the linux3.10. Run in the Linux kernel source root directory: Make Menuconfig, move the up and down buttons to configure:
File Systems---> Miscellaneous filesystems---> [*]YAFFS2 file System support
and press the space to select it, so we add the YAFFS2 file system support in the kernel, press "exit" to exit the kernel configuration.
3. Compile the Linux source code.
$ make zimagescripts/kconfig/conf--silentoldconfig kconfig chk include/generated/uapi/linux/version.h chk inclu DE/GENERATED/UTSRELEASE.HMAKE[1]: ' Include/generated/mach-types.h ' is up to date. Call scripts/checksyscalls.sh CC scripts/mod/devicetable-offsets.s GEN scripts/mod/devicetable-offsets.h HO STCC scripts/mod/file2alias.o hostld scripts/mod/modpost CHK include/generated/compile.h CC fs/yaffs2/yaffs_ ECC.O CC fs/yaffs2/yaffs_vfs.ofs/yaffs2/yaffs_vfs.c:in function ' yaffs_proc_debug_write ': fs/yaffs2/yaffs_vfs.c:330 4:warning:comparison of distinct pointer types lacks a castfs/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 castfs/yaffs2/yaffs_vfs.c:3402:error:dereferencing pointer to incomplete Typefs/yaffs2/yaffs_vfs.c:3403:error:dereferencing Pointer to IncomplEte typefs/yaffs2/yaffs_vfs.c:3404:error:dereferencing pointer to incomplete TYPEMAKE[2]: * * * [FS/YAFFS2/YAFFS_VFS.O] Error 1MAKE[1]: * * * [FS/YAFFS2] Error 2make: * * * [FS] Error 2
Error occurred while compiling fs/yaffs2/yaffs_vfs.c, function ' Create_proc_entry ' is not stated. Google only then know that the original interface was deleted in linux-3.10, should use Proc_create instead.
Reference: What ' s coming in 3.10, part 2
4. Modify FS/YAFFS2/YAFFS_VFS.C
@@ -3384,12 +3384,6 @@ -3384,12 struct File_system_to_install fs_to_install[] = {{NULL, 0}}; +static const struct File_operations yaffs_fops = {+. Owner = this_module,+. Read = yaffs_proc_read,+ . write = yaffs_proc_write,+};+ static int __init init_yaffs_fs (void) {int error = 0;@@ -3401,9 +3395,9 @@ Static int __init init_yaffs_fs (void) mutex_init (&yaffs_context_lock); /* Install the PROC_FS entries */+ my_proc_entry = proc_create ("yaffs", + s_i Rugo | S_ifreg, Yproc_root, &yaffs_fops); + #if 0-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;@@ -3411,7 +3405,7 @@ static int __init init_yaffs_fs (void) } else {return-enomem; }+ #endiF/* Now add the file system entries */fsinst = Fs_to_install;
5. Save after modification and then compile to succeed.
$ make zimage chk include/generated/uapi/linux/version.h chk include/generated/utsrelease.hmake[1]: ' Include/gen Erated/mach-types.h ' is up to date. Call scripts/checksyscalls.sh CC scripts/mod/devicetable-offsets.s GEN scripts/mod/devicetable-offsets.h HO STCC scripts/mod/file2alias.o hostld scripts/mod/modpost CHK include/generated/compile.h CC fs/yaffs2/yaffs_ vfs.ofs/yaffs2/yaffs_vfs.c:in function ' yaffs_proc_debug_write ': Fs/yaffs2/yaffs_vfs.c:3304:warning:comparison of Distinct pointer types lacks a castfs/yaffs2/yaffs_vfs.c:at top level:fs/yaffs2/yaffs_vfs.c:3389:warning: Initialization from incompatible pointer typefs/yaffs2/yaffs_vfs.c:3390:warning:initialization from incompatible Pointer type cc FS/YAFFS2/YAFFS_GUTS.O CC fs/yaffs2/yaffs_checkptrw.o cc FS/YAFFS2/YAFFS_PACKEDTAGS1.O CC FS/YAFFS2/YAFFS_PACKEDTAGS2.O cc fs/yaffs2/yaffs_nand.o cc FS/YAFFS2/YAFFS_TAGSCOMPAT.O cc Fs/ya Ffs2/yaffs_tagSMARSHALL.O cc FS/YAFFS2/YAFFS_MTDIF.O cc FS/YAFFS2/YAFFS_NAMEVAL.O cc FS/YAFFS2/YAFFS_ATTRIBS.O cc FS/YAFFS2/YAFFS_ALLOCATOR.O cc fs/yaffs2/yaffs_yaffs1.o cc fs/yaffs2/yaffs_yaffs2.o cc fs/yaffs2/yaffs _BITMAP.O cc fs/yaffs2/yaffs_summary.o cc fs/yaffs2/yaffs_verify.o LD FS/YAFFS2/YAFFS.O LD Fs/yaff S2/BUILT-IN.O ld fs/built-in.o LINK vmlinux ld vmlinux.o modpost vmlinux.o GEN. Version CHK Inc Lude/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o KSYM. t MP_KALLSYMS1.O ksym. tmp_kallsyms2.o LD vmlinux SORTEX vmlinux sysmap system.map objcopy arch/arm/boot/imag E kernel:arch/arm/boot/image are ready GZIP Arch/arm/boot/compressed/piggy.gzip as Arch/arm/boot/compressed/pig GY.GZIP.O LD arch/arm/boot/compressed/vmlinux objcopy arch/arm/boot/zimage kernel:arch/arm/boot/zimage are ready
Linux 3.10-based YAFFS2 porting (RPM)