使用的开发板:OK6410
时间:2018.7.4
环境:
Ubuntu 16.04.4 LTS (内核: Linux version 4.4.0-130-generic)
arm-linux-gnueabi-gcc 4.7.4(使用apt-get install)
busybox-1.28.2
yaffs2使用的飞凌linux-3.0.1中的源码编译生成
1、mkyaffs2image运行提示找不到文件或目录
原因:具体原因没有深究,可能是官网给的程序是32位,而我的Ubuntu是64位导致的。
解决方案:下载yaff2源码,进入源码目录下的util目录进行make生成mkyaff2image程序。注意与mkyaffimage程序进行区分。
yaff2源码下载地址:https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/fatplus/yaffs2-source.tar
2、挂载文件系统出错:
VFS: Mounted root (yaffs2 filesystem) on device 31:2.devtmpfs: error mounting -2
Freeing init memory: 176K
原因:我自己用的是飞凌提供的linux镜像,但是mkyaffs2image工具是我自己下载编译生成的,导致工具生成的yaffs2文件系统和原来的镜像不兼容使用
解决方案:在飞凌提供的linux内核源码中有yaffs的源码,简单修改后利用生成的mkyaffs2image工具生成根文件系统即可。
3、文件系统烧写完成后启动开发板提示“Kernel panic - not syncing: Attempted to kill init!”。
待解决
总结:这几天一直在尝试在OK6410上移植Ubuntu系统,尝试了多种方式后依然不能成功,尝试的方案有:
1)、使用飞凌提供的uboot,linux内核镜像,下载Ubuntu12.04、Ubuntu14.04,Ubuntu16.04-base-core的文件系统,使用mkyaffs2image工具生成yaffs2文件系统;(在解决mkyaffs2image的兼容问题后依然存在上面的问题3)
2)、使用飞凌提供的uboot镜像,下载linux4.4内核源码,根据内核源码生成镜像文件,利用mkyaffs2image工具生成yaffs2文件系统;(在解决mkyaffs2image的兼容问题后依然存在上面的问题3)
3)、使用飞凌提供的uboot,linux内核镜像,使用busybox生成简单版的根文件系统,然后利用mkyaffs2image工具生成yaffs2文件系统;(在解决mkyaffs2image的兼容问题后依然存在上面的问题3)
4)、使用飞凌提供的uboot,linux内核镜像,以及飞凌的文件系统中的bin文件夹、sbin文件夹、lib文件夹、linuxrc文件,然后利用mkyaffs2image工具生成yaffs2文件系统;(这种方式可以正常启动)
从明天开始需要换一种方式来解决这种方式:从uboot移植开始一步步学习。
-----------------------------分割线--------------------------------------
时间:2018.7.7
环境:
Ubuntu 12.04 LTS(内核:Linux version 3.2.0-23-generic-pae)
arm-linux-gcc 4.2.2(飞凌提供)
busybox-1.20.0
yaffs2(根据飞凌提供的源码编译生成mkyaffs2image)
今天在更换环境后生成的文件系统就能正常启动了。遇到了以下问题:
1、由于busybox中没有ubi-user.h文件,导致找不到变量的定义。
解决方案:将/usr/src/linux-headers-3.2.0-23/include/mtd/ubi-user.h拷贝到busybox文件夹下的include/mtd目录下。
2、开发板启动后提示“Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.”
解决方案:原来的启动参数是“root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200”,修改为“noinitrd root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200 init=/linuxrc”
3、开发板启动后提示“Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.”
解决方案:在生成yaffs2文件系统是没有拷贝相关的lib文件,开发板在启动时会运行linuxrc,使用arm-linux-readelf
查看linuxrc依赖libm.so.6等库,为了方便就将arm编译器下的lib全部拷贝至文件系统下的lib文件夹,然后重新生成yaffs2文件系统,重新烧写后便出现了:
VFS: Mounted root (yaffs2 filesystem) on device 31:2.devtmpfs: mountedFreeing init memory: 176Kcan't run '/etc/init.d/rcS': No such file or directoryPlease press Enter to activate this console. / # ls[1;34mbin[0m [1;34mhome[0m [1;34mlost+found[0m [1;34mroot[0m [1;34mtmp[0m[1;34mdev[0m [1;34mlib[0m [1;34mmnt[0m [1;34msbin[0m [1;34musr[0m
[1;34metc[0m [1;36mlinuxrc[0m [1;34mproc[0m [1;34msys[0m [1;34mvar[0m
至于dnw上出现的乱码问题,暂时先放着。