免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5465 | 回复: 8

[BootLoader] 请教如何把rootfs从挂载在flash上改成挂载到ram上? [复制链接]

论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:52:30
发表于 2014-10-29 14:39 |显示全部楼层
5可用积分
大侠好,

我目前用的是Qualcomm的MSM9x15平台,目前代码中使用的bootcmd为:
KERNEL_BOOT_OPTIONS ?= "root=/dev/mtdblock2 rw rootfstype=yaffs2 rootflags=tags-ecc-off console=ttyHSL0,115200 console=ttyHSL1,115200"

root是挂载在flash上的。
现在的需求要改成挂载到ram上,按照baidu的方法,我试着改了一下:
KERNEL_BOOT_OPTIONS ?= "root=/dev/ram0 rw console=ttyHSL0,115200 console=ttyHSL1,115200"
但是内核启动的时候报错说找不到rootfs,如下面的错误。

对这一块很陌生,请教如何改到挂载到ram上呢?
万谢!
  1. List of all partitions:
  2. 1f00            1024 mtdblock0  (driver?)
  3. 1f01           20736 mtdblock1  (driver?)
  4. 1f02           50688 mtdblock2  (driver?)
  5. 1f03           40704 mtdblock3  (driver?)
  6. 1f04          152576 mtdblock4  (driver?)
  7. 1f05            5376 mtdblock5  (driver?)
  8. 1f06            2304 mtdblock6  (driver?)
  9. No filesystem could mount root, tried:  ext3 ext2 ext4 squashfs vfat btrfs yaffs yaffs2
  10. VFS: Unable to mount root fs on unknown-block(1,0)
  11. User configuration error - no valid root filesystem found
  12. Kernel panic - not syncing: Invalid configuration from end user prevents continuing
  13. [<c0014a44>] (unwind_backtrace+0x0/0xfc) from [<c0666ad4>] (dump_stack+0x20/0x24)
  14. [<c0666ad4>] (dump_stack+0x20/0x24) from [<c06670dc>] (panic+0x94/0x1cc)
  15. [<c06670dc>] (panic+0x94/0x1cc) from [<c08fae70>] (mount_block_root+0x1ec/0x238)
  16. [<c08fae70>] (mount_block_root+0x1ec/0x238) from [<c08fb09c>] (mount_root+0xf8/0x11c)
  17. [<c08fb09c>] (mount_root+0xf8/0x11c) from [<c08fb228>] (prepare_namespace+0x168/0x1c8)
  18. [<c08fb228>] (prepare_namespace+0x168/0x1c8) from [<c08faa54>] (kernel_init+0x1ec/0x230)
  19. [<c08faa54>] (kernel_init+0x1ec/0x230) from [<c000ee30>] (kernel_thread_exit+0x0/0x8)
  20. Watchdog bite received from modem software!
  21. modem subsystem failure reason: err.c:537:Error detected on remote processor..
  22. subsys-restart: subsystem_restart(): Restart sequence requested for modem, restart_level = 1.
  23. Kernel panic - not syncing: subsys-restart: Resetting the SoC - modem crashed.
  24. [<c0014a44>] (unwind_backtrace+0x0/0xfc) from [<c0666ad4>] (dump_stack+0x20/0x24)
  25. [<c0666ad4>] (dump_stack+0x20/0x24) from [<c06670dc>] (panic+0x94/0x1cc)
  26. [<c06670dc>] (panic+0x94/0x1cc) from [<c0043e70>] (subsystem_restart+0x1e8/0x234)
  27. [<c0043e70>] (subsystem_restart+0x1e8/0x234) from [<c0044484>] (restart_modem+0xb4/0xd0)
  28. [<c0044484>] (restart_modem+0xb4/0xd0) from [<c0044734>] (modem_wdog_bite_irq+0x38/0x60)
  29. [<c0044734>] (modem_wdog_bite_irq+0x38/0x60) from [<c00b1c94>] (handle_irq_event_percpu+0x98/0x2a4)
  30. [<c00b1c94>] (handle_irq_event_percpu+0x98/0x2a4) from [<c00b1f04>] (handle_irq_event+0x64/0x84)
  31. [<c00b1f04>] (handle_irq_event+0x64/0x84) from [<c00b4a3c>] (handle_fasteoi_irq+0xbc/0x120)
  32. [<c00b4a3c>] (handle_fasteoi_irq+0xbc/0x120) from [<c00b1590>] (generic_handle_irq+0x30/0x40)
  33. [<c00b1590>] (generic_handle_irq+0x30/0x40) from [<c000ed4c>] (handle_IRQ+0x70/0x94)
  34. [<c000ed4c>] (handle_IRQ+0x70/0x94) from [<c00084b4>] (gic_handle_irq+0x48/0x60)
  35. [<c00084b4>] (gic_handle_irq+0x48/0x60) from [<c0671300>] (__irq_svc+0x40/0x70)
  36. Exception stack(0xcf02de48 to 0xcf02de90)
  37. de40:                   0001f03a ffffffff 000006fc c0055848 00000000 0000012c
  38. de60: 00000190 0000000a c0a31068 ceab515d c0925c68 cf02debc cf02de90 cf02de90
  39. de80: c06671e8 c03521b0 20000013 ffffffff
  40. [<c0671300>] (__irq_svc+0x40/0x70) from [<c03521b0>] (__delay+0x0/0xc)
复制代码

最佳答案

查看完整内容

回复 6# fire_vr 设置CONFIG_INITRAMFS_SOURCE路径不要使用打包好之后的,而是要使用源文件路径不需要制作ram0 image,也不要在cmdline中设置"root=",另外cmdline中需要添加"rdinit=/sbin/init"

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
发表于 2014-10-29 14:39 |显示全部楼层
本帖最后由 arm-linux-gcc 于 2014-11-05 15:04 编辑

回复 6# fire_vr


    设置CONFIG_INITRAMFS_SOURCE路径不要使用打包好之后的,而是要使用源文件路径
不需要制作ram0 image,也不要在cmdline中设置"root=",另外cmdline中需要添加"rdinit=/sbin/init"

论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:52:30
发表于 2014-10-30 09:05 |显示全部楼层
先自己顶一下

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
发表于 2014-10-30 09:43 |显示全部楼层
你的rootfs image有多大?

论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:52:30
发表于 2014-10-30 09:49 |显示全部楼层
有大概36M。。。

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
发表于 2014-10-30 10:32 |显示全部楼层
[ 本帖最后由 arm-linux-gcc 于 2014-10-30 10:48 编辑 ]

我记得initramfs的size是有限制的,具体多少记不得了,36M的size应该是超了,如果不行就再裁剪一下(只保留必要的,把不必要的放到flash里去)


make menuconfig,配置如下
General setup
  [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
  ()    Initramfs source file(s)             填入你的rootfs源文件的目录地址
Device Drivers
  [*] Block devices  --->
    < >   RAM block device support    去掉这个选项



cmdline设置
"console=ttyHSL0,115200 console=ttyHSL1,115200 rdinit=/sbin/init"







论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:52:30
发表于 2014-11-03 14:20 |显示全部楼层
本帖最后由 fire_vr 于 2014-11-03 14:22 编辑

谢谢!

我现在裁剪到2M左右了,现在的文件系统打包到Kernel里面,即改CONFIG_INITRAMFS_SOURCE:
CONFIG_INITRAMFS_SOURCE="/devdata/ykong/Rootfs/_install"

但跑起来的时候有下面错误:
我的ram0是在ubuntu上这样生成的,请问有问题吗?
sudo mknod ram0 b 1 0

error:
  #0: mdm9615-sitar-snd-ca鶹FS: Cannot open root device "ram0" or unknown-block(1,0): error -2
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0  (driver?)
1f01           20736 mtdblock1  (driver?)
1f02           50688 mtdblock2  (driver?)
1f03           40704 mtdblock3  (driver?)
1f04          152576 mtdblock4  (driver?)
1f05            5376 mtdblock5  (driver?)
1f06            2304 mtdblock6  (driver?)
VFS: Unable to mount root fs on unknown-block(1,0)
User configuration error - no valid root filesystem found

论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:52:30
发表于 2014-11-03 22:25 |显示全部楼层
自己顶。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP