主题 : 关于文件系统中的linuxrc文件的问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 9254
精华: 0
发帖: 44
金钱: 450 两
威望: 225 点
综合积分: 88 分
注册时间: 2009-09-23
最后登录: 2009-12-12
楼主  发表于: 2009-10-15 10:58

 关于文件系统中的linuxrc文件的问题

管理提醒: 本帖被 kasim 从 QQ2440资料下载中心 移动到本区(2009-10-30)
请教版主:我用的是原始的vivi,用busybox制作了一个cramfs,引导的过程中有问题出现,如果我不用busybox编译出来的linuxrc,用自己写的,系统能引导起来,但是出现Bummer, could not run '/etc/init.d/rcS': No such file or directory,如果我用busybox编译出来的linuxrc,系统就停止在Starting pid 787, console /dev/console: '/etc/init.d/rcS',不动了,不会出现Please press Enter to activate this console.,,不知道是怎么回事?请斑竹给些建议。。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-10-15 11:13
把你制作的cramfs文件系统里的/etc/inittab和你自己写的linuxrc贴出来看看吧。
关于文件系统的初始化分析,参考这个帖子 http://www.aiothome.com/bbs/read.php?tid-1702.html
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 9254
精华: 0
发帖: 44
金钱: 450 两
威望: 225 点
综合积分: 88 分
注册时间: 2009-09-23
最后登录: 2009-12-12
2楼  发表于: 2009-10-15 11:22
我现在使用busybox编译的linuxrc,
inittab文件内容:
::sysinit:/etc/init.d/rcS
刚刚我在修改了nittab文件,现在为
::sysinit:/etc/init.d/rcS
::askfirst:/bin/sh
目前系统能起来了,又出现了新的问题:
Please press Enter to activate this console.
Starting pid 788, console /dev/console: '/bin/sh'


BusyBox v1.1.3 (2009.10.14-08:48+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
# ls
bin      etc      lib      mnt      root     sys      usr
dev      home     linuxrc  proc     sbin     tmp      var
////问题:
/bin/sh: can't access tty; job control turned of
我在编译busybox时已经选上了;“Support running commands with a controlling-tty”
不知为什么还会出现这个问题?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-10-15 11:51
试试用
复制代码
  1. ::askfirst:-/bin/sh

另外,我想你需要在/dev目录下有tty设备的节点。最简单的方法是在制作cramfs镜像前用命令:
复制代码
  1. cd /path/to/dev/of/your/cramfs/directory; /dev/MAKEDEV -d  std console

在你的cramfs文件系统镜像的/dev目录下创建系统启动必须的设备节点。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 9254
精华: 0
发帖: 44
金钱: 450 两
威望: 225 点
综合积分: 88 分
注册时间: 2009-09-23
最后登录: 2009-12-12
4楼  发表于: 2009-10-15 14:41
版主:我按照你说的,修改inittab
::askfirst:-/bin/sh
现在用busybox编译出来的linuxrc,已经没什么问题了。
我现在又试着又试着用自己的linuxrc,还是出现Bummer, could not run '/etc/init.d/rcS': No such file or directory,这一问题,我贴出我的linuxrc,请斑竹帮忙看一下是哪里的问题
#!/bin/sh
/bin/mount  -f  -t  cramfs -o remount ,ro /dev/mtdblock/4 /
exec /sbin/init
另外我也修改了rcS的权限,为775,可还是不行。。