#嵌入式Linux最小系统移植# yaffs2根文件系统移植出错记录

2019-07-12 18:51发布

busybox官网地址:

https://busybox.net/

本次移植采用的busybox版本:

busybox-1.26.0.tar.bz2

交叉编译工具链版本:

$ arm-linux-gcc -v
gcc version 4.4.3 (ctng-1.6.1)

1、busybox目录下make menuconfig

2、给内核打上yaffs2补丁

# git clone git://www.aleph1.co.uk/yaffs2 # cd yaffs2/ # ./patch-ker.sh c /home/invoker/akernel4.0/linux-4.0.8(内核路径) # make menuconfig 将添加yaffs2至内核(内核的menuconfig)

3、在uboot下通过nand write.yaffs 命令烧录rootfs之后加载,出现以下问题,主要是yaffs2文件的错误,可参考以下链接修改即可:

http://blog.csdn.net/blazar/article/details/79247464 Unable to handle kernel paging request at virtual address 70616774 pgd = c0004000 [70616774] *pgd=00000000 Internal error: Oops: 5 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.0.0 #3 Hardware name: MINI2440 task: c3834000 ti: c3836000 task.ti: c3836000 PC is at yaffs_getxattr+0x20/0x90 LR is at get_vfs_caps_from_disk+0x5c/0x104 http://blog.csdn.net/blazar/article/details/79247464 yaffs: dev is 32505859 name is "mtdblock3" rw yaffs: passed flags "" VFS: Mounted root (yaffs filesystem) on device 31:3. Freeing unused kernel memory: 152K (c0510000 - c0536000) Unable to handle kernel paging request at virtual address 70616774 pgd = c0004000 [70616774] *pgd=00000000 Internal error: Oops: 5 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.0.0 #3 Hardware name: MINI2440 task: c3834000 ti: c3836000 task.ti: c3836000 PC is at yaffs_getxattr+0x20/0x90 LR is at get_vfs_caps_from_disk+0x5c/0x104 pc : [] lr : [] psr: 60000013 sp : c3837ed0 ip : c016e20c fp : c3b7e000 r10: c3927a30 r9 : 00000000 r8 : 00000014 r7 : 7061676c r6 : c3837eec r5 : c342d6f0 r4 : c0549818 r3 : 00000014 r2 : f0000010 r1 : c04a13a0 r0 : c342e220 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: c000717f Table: 30004000 DAC: 00000017 Process swapper (pid: 1, stack limit = 0xc3836190) Stack: (0xc3837ed0 to 0xc3838000) 7ec0: c3837f14 c342d6f0 c342e220 c3927a00 7ee0: c3809500 c0190134 c3809500 00000000 c3927a30 c3b7e000 000081ed c3837f10 7f00: c3912a00 c03dc8cc c3912a00 c0190314 00000000 00000000 00000000 00000000 7f20: 00000000 00000000 c0539fc0 c3912a00 c3b73000 c3912a00 c0539f30 c0539fc0 7f40: 00000000 00000002 c3b7e000 c00a34a0 c3b89000 c3b73000 c3b89000 c00a3e24 7f60: c048db78 c3b7e038 c38341e8 00000000 00000000 c0560c20 c03d771c 00000000 7f80: 00000000 00000000 00000000 00000000 00000000 c00a407c 00000000 c03d771c 7fa0: 00000000 c03d7780 00000000 c0009638 00000000 00000000 00000000 00000000 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 334c32ce 138a324c [] (yaffs_getxattr) from [] (get_vfs_caps_from_disk+0x5c/0x104) [] (get_vfs_caps_from_disk) from [] (cap_bprm_set_creds+0x138/0x340) [] (cap_bprm_set_creds) from [] (prepare_binprm+0x84/0x11c) [] (prepare_binprm) from [] (do_execveat_common+0x434/0x618) [] (do_execveat_common) from [] (do_execve+0x28/0x30) [] (do_execve) from [] (kernel_init+0x64/0xec) [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) Code: e1a08003 e3120002 e5917118 1a00000f (e5975008) ---[ end trace 81fbd058ed34ea04 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b random: nonblocking pool is initialized

4、出现下述错误的原因是,uboot烧根文件系统时,我没有用nand write.yaffs命令。

Kernel panic - not syncing: Requested init /linuxrc failed (error -2). CPU: 0 PID: 1 Comm: swapper Not tainted 4.0.0 #3 Hardware name: MINI2440 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (panic+0x7c/0x1fc) [] (panic) from [] (kernel_init+0x80/0xec) [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) ---[ end Kernel panic - not syncing: Requested init /linuxrc failed (error -2). random: nonblocking pool is initialized

5、出错:用makeyaffs2image-128M命令做出来的文件系统很大,差不多有500MB

解决:拷贝lib库到自制文件系统的lib文件夹时,是cp cross-compile-tools/lib*.so* rootfs/lib/ -d,改成cp cross-compile-tools/lib*.so* rootfs/lib -d,原因目前不知。

6、出错:busybox 编译错误 miscutils/nandwrite.c:

151:3: error: ‘MTD_FILE_MODE_RAW’ undeclared
解决:http://blog.csdn.net/fickyou/article/details/51274485

7、busybox分析和制作记录:

http://blog.csdn.net/sinat_26551021/article/details/79301700

其它参考链接:

一步一步制作yaffs/yaffs2根文件系统,写的很详细。
http://www.cnblogs.com/tureno/category/974464.html