his3531内核启动完到文件系统启动时失败问题
2 E币
成为会员,免费下载资料
文件大小:4.71 KB
上传者:luipingwei
时间:2015-11-30 13:41:35
下载量:9
附件1所示为制作yaffs文件系统烧录启动的log,.bootarts设置如下:
setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=yaffs2 mtdparts=hinand:1M(boot),4M(kernel),42M(rootfs),16M(test)'
setenv bootcmd 'nand read 0x82000000 0x100000 0x500000;bootm 0x82000000'
sa
启动失败的打印如下图:
[attach]3095[/attach][attach]3096[/attach]
自己分析的原因: 是内核启动后 寻找flash的bolck2 指针出错,查找不到block2,海思的内核里没有建init的分区,此分区在bootargs里配置,
出错的代码在内核里init的部分:
static void run_init_process(const char *init_filename)
{
...
run_init_process("/sbin/init");
run_init_process("/etc/init");
run_init_process("/bin/init");
run_init_process("/bin/sh");
...
}
查文件系统里/bin/sh的文件存在:
root@desktop:$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc# ls
bin dev hitoe init linuxrc mkimg.rootfs mnt opt opt_2 root sbin sys usr
boot etc home lib lost+found mknod_console nfsroot opt? proc rootfs share tmp var
root@desktop$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc# ls /bin/sh -l
lrwxrwxrwx 1 root root 4 2015-09-23 14:52 /bin/sh -> bash
root@desktop:$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc#
开发板上的这个文件系统启动正常.
setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=yaffs2 mtdparts=hinand:1M(boot),4M(kernel),42M(rootfs),16M(test)'
setenv bootcmd 'nand read 0x82000000 0x100000 0x500000;bootm 0x82000000'
sa
启动失败的打印如下图:
[attach]3095[/attach][attach]3096[/attach]
自己分析的原因: 是内核启动后 寻找flash的bolck2 指针出错,查找不到block2,海思的内核里没有建init的分区,此分区在bootargs里配置,
出错的代码在内核里init的部分:
static void run_init_process(const char *init_filename)
{
...
run_init_process("/sbin/init");
run_init_process("/etc/init");
run_init_process("/bin/init");
run_init_process("/bin/sh");
...
}
查文件系统里/bin/sh的文件存在:
root@desktop:$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc# ls
bin dev hitoe init linuxrc mkimg.rootfs mnt opt opt_2 root sbin sys usr
boot etc home lib lost+found mknod_console nfsroot opt? proc rootfs share tmp var
root@desktop$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc# ls /bin/sh -l
lrwxrwxrwx 1 root root 4 2015-09-23 14:52 /bin/sh -> bash
root@desktop:$Hi3531_SDK_V2.0.A.0/osdrv/pub/rootfs_glibc#
开发板上的这个文件系统启动正常.
展开》
折叠》