首页 > 其他分享 >启动文件系统时出现错误:Warning: unable to open an initial console.

启动文件系统时出现错误:Warning: unable to open an initial console.

时间:2022-09-30 22:31:58浏览次数:41  
标签:console unable initial 文件系统 dev Warning yaffs rootfs


————————————————————————————————

(一)启动文件系统时出现错误:Warning: unable to open an initial console.

————————————————————————————————

具体错误:

yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
s3c-nand: ECC uncorrectable error detected
block 109 is bad
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 140K
Warning: unable to open an initial console.

原因查找:

 1)删掉下载的文件系统中的/dev/console和/dev/null

重新建立

mknod –m 660 console c 5 1

mknod –m 660 null c 1 3

2)你的根文件系统上需要建/dev/console

3)你的rootfs真的是cramfs吗? 如果是jffs2, 那么command line里设置一下 rootfstype=jffs2看看

4)现在我加了支持devfs选项编译核,启动中是没了: 
warning:unable to open an initial console 
且多了: 
Mounted devfs on /dev 
可就仅此而已,后面什么也没有了!敲键盘反映全是乱七八糟的字符!

************

最终原因:

************

在建立根文件系统的目录时,跳过了一些步骤。

进入opt/mini2440/fs,创建一个shell的脚本用于构建根文件系统的各个目录。create_rootfs_bash,平且改变执行的权限。

#chmod +x create_rootfs_bash

在kernel目录下,运行./create_rootfs_bash,其脚本的内容如下:

#!/bin/sh
echo "------Create rootfs directons start...--------"
mkdir rootfs
cd rootfs
echo "--------Create root,dev....----------"
mkdir root dev etc boot tmp var sys proc lib mnt home usr
mkdir etc/init.d etc/rc.d etc/sysconfig
mkdir usr/sbin usr/bin usr/lib usr/modules
echo "make node in dev/console dev/null" //这几行的作用是创建console控制台,而我在制作根目录时刚好没有做这个工作。
mknod -m 600 dev/console c 5 1
mknod -m 600 dev/null c 1 3

具体如下图所示:

 经过以上改变后,根文件系统制作成功,启动界面如下图:


标签:console,unable,initial,文件系统,dev,Warning,yaffs,rootfs
From: https://blog.51cto.com/u_15812463/5727467

相关文章