主题 : initramfs启动linux的问题,执行/init失败, 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 16283
精华: 0
发帖: 67
金钱: 335 两
威望: 67 点
贡献值: 0 点
综合积分: 134 分
注册时间: 2010-03-16
最后登录: 2021-07-28
楼主  发表于: 2011-12-26 15:51

 initramfs启动linux的问题,执行/init失败,

本人试图在自己的mips开发板上弄一个mips的initramfs启动linux的内核,我参考本站一篇有关initramfs成功启动linux的文章,我想问一下:initramfs启动linux需要向linux内核传递参数吗?怎么传?好像没有cmdline的东西,
是不是我的initramfs文件系统没有挂载成功啊?
谢谢!
[ 此帖被xiaolubk在2012-03-02 17:22重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2011-12-26 22:02
贴出完整的串口输出
"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: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2012-01-06 22:40

 回 4楼(xiaolubk) 的帖子

看起来你的initramfs已经mount成功了,而且内核也找到了/init可执行档,但它执行过程中异常退出了。把它换成静态链接的helloworld试试?
"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: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2012-01-08 21:56

 回 6楼(xiaolubk) 的帖子

在init处理到/etc/init.d/rcS之前还要经过很长的路。
"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: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2012-01-09 11:37

 回 8楼(xiaolubk) 的帖子

以ARM平台的Linux为例,在实际执行一个ELF格式的可执行档的代码之前,内核需要先解析这个执行档的ABI类型,加载所有需要的执行的代码(包括执行档本身和所依赖的共享库)到RAM中。busybox在输出控制台信息之前有很多初始化过程,如果这些过程中出了问题,你是看不到任何错误信息的。静态编译的helloworld是最简单的可执行档,可以测试你的系统对于可执行档的最基本的执行环境是否是正常的。在这基础之上,才能进一步分析别的可能的错误原因。
"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: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2012-01-09 18:19

 回 11楼(xiaolubk) 的帖子

你可以在配置busybox的时候去掉一些不必要的组件, 参考http://busybox.net/FAQ.html#configure
这不是这个帖子讨论的范围, 如果你感兴趣, 开一个新的帖子.
"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."